prettier / prettier/vim-prettier
Formatting HTML templates for Angular uses html parser instead of angular parser
Nobody has claimed this yet.
- Dominant language
- Vim Script
- Stars
- 1.8k
- Forks
- 137
- PR merge metrics
- No merged PRs in 30d
Description
Do you want to request a feature or report a bug?
Report a bug
What is the current/expected behavior?
Setting g:prettier#config#parser to empty string should let prettier decide on the parser. Instead, when editing html files, the parser seems to always be set to html. This is a problem when editing Angular templates.
What version of vim-prettier are you using - (output of :PrettierVersion) ?
1.0.0-alpha
What version of prettier are you using - (output of :PrettierCliVersion) ?
2.0.5
What is your prettier executable path - (output of :PrettierCliPath) ?
Absolute path to the project's node_modules/.bin/prettier
Did this work in previous versions of vim-prettier and/or prettier ?
Haven't tested
I solved this locally by just removing lines 1-8 of ftplugin/html.vim, that for some reason sets the parser to html as soon as the file is an html file, seemingly disregarding the setting of g:prettier#config#parser. I am guessing those lines were there for a reason, however.
Contributor guide
No contributing guide indexed for this repository
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start with lines 1-8 of ftplugin/html.vim, which the report identifies as forcing the HTML parser, and inspect how that interacts with an empty g:prettier#config#parser. Verify the behavior using an HTML file containing an Angular template with vim-prettier 1.0.0-alpha and Prettier 2.0.5; done means Prettier can choose the Angular parser instead of always using HTML.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- angular, vim
- Domain
- tooling
- Issue type
- Bug
- Difficulty
- 2/5
- Estimated time
- 1-3 hours
- Activity status
- Stale
- Clarity
- Clearly specified
- Newbie friendliness
- 38/100