ManuelGil/vscode-mustache-snippets

Extension cannot be selected as formatter for HTML(Mustache)

Closed this issue · 6 comments

First of all, thanks for providing the extension!

I have basically found it because it is tagged with the Formatters Category in the Marketplace.
However, when hitting Shift + Alt + F to format a .mustache document and selecting Configure in the Configure Default Formatters dialog for file type HTML (Mustache), this extension is not showing up in the available extensions.

Does this extension support formatting mustache files?
If so then there may be some kind of bug, if not it would be great if you would remove the Formatter category since it may be misleading for users.

Hi @FieteO ,

Thank you very much for your support. This extension allows you to identify the Mustache format as an extension of HTML as you can see on line 38 of the mustache.tmLanguage.json file. This allows the settings you have in your vscode to be applied to these types of files.

It also automatically recognizes files with the .mustache extension.

image

Please confirm if everything is correct or what changes do you propose to apply it in the next version.

Thanks for the reply, however I fear that that is not quite what I mean.
When right clicking -> Format Document, the Configure Default Formatter dialog will pop up:
image
Now, when I select Configure, your extension is not showing up as far as I can tell:
image

Is this the expected behaviour? Am I just using the wrong language mode?

At the moment this functionality is not implemented but I am going to start planning it for the next version

Great to hear that! Thanks for looking into it.

@ManuelGil is this still planned? I'm also interested in this—for now I have to switch between .mustache (for syntax highlighting) and .html (for formatting via e.g. prettier)

The issue presented above is that the mustache extension was overriding HTML extensions and affecting formatters.

You may be able to add formatting to Mustache files through other methods, such as EditorConfig or Prettier by adding the rules for the .mustache files, since this extension only contains the basic language definition and is not prepared for customizations.

I may make some future updates if I can find additional information about adding new rules to the language definitions without affecting the current definitions, but for now I have no updates planned for this extension.