Skip to content
This repository has been archived by the owner on Apr 17, 2023. It is now read-only.

Parser overrrides #613

Closed
amk221 opened this issue Dec 9, 2019 · 2 comments
Closed

Parser overrrides #613

amk221 opened this issue Dec 9, 2019 · 2 comments

Comments

@amk221
Copy link
Contributor

amk221 commented Dec 9, 2019

With the following configuration file:

module.exports = {
  overrides: [{
    files: '*.hbs',
    options: {
      parser: 'glimmer'
    }
  }]
};

shouldFormatOnSave is returning false.

...this is because one its conditions is returning false: doesFileInfoIndicateFormattable.

...and this is because Prettier's getFileInfo is returning the inferredParser as null.


Even if you set Include (list of globs) to include *.hbs the issue remains.

Notice however that cmd+pFormat does work.

So, I'm not sure what the difference is between the two (Format on Save and cmd+p → Format). But it feels like they should be aligned somehow.

I'm happy to have a go at fixing with some guidance

Possible duplicate: #500

@robwise
Copy link
Collaborator

robwise commented Dec 9, 2019

It's actually a dupe of this one: #556

Prettier was not properly implementing getFileInfo as you've found, but that guy fixed it, so I think we need to update our code to use it.

@amk221
Copy link
Contributor Author

amk221 commented Dec 10, 2019

Thanks

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

2 participants