-
Notifications
You must be signed in to change notification settings - Fork 107
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Extension claims to have a formatter, but doesn't #515
Comments
Hi @hho, thank you for the feedback, you're right, and the extension needs an additional formatter installed to be able to format files, it describes on the extensions page in "Document formatting" section. For now Prettier formatter works well. You also could try to use yaml formatted from RedHat but seems like it needs an additional setting to be able to format. |
@DmitriiBobreshev Do you have more details about that additional setting for the RedHat formatter? |
As described I have configured the following in the "[azure-pipelines]": {
"editor.defaultFormatter": "esbenp.prettier-vscode"
}, but VSCode still complains |
I'm having the same issue as @jafin, adding this to my "[azure-pipelines]": {
"editor.defaultFormatter": "esbenp.prettier-vscode"
}, |
@jafin @SpaceOgre I also ran into this exact problem, my Check in the bottom bar in VSCode window for This is what it was before, and when you click on it you get a debug output indicating the problem |
This is on my radar. I assume the YAML formatting is made possible by its language server; if we can similarly update our language server (which was forked from Red Hat's in 2018) to merge in the improvements from the past 5 years, I assume we'll be 95% of the way there to getting formatting working properly. |
Any update on this matter maybe? Seems like previous comment/change is not applied effectively yet. |
Well, it turns out that merging 5 years' worth of changes back into a codebase that's significantly diverged is quite difficult 😅. I have been making progress, but there's still quite a bit of work to do before it's "ready". |
Thank you for the update. I was more hoping to hear about you last sentance about "If it turns out that's going to take a while" remedy :) That would definetly help a lot and looks like a low hanging fruit. |
Awesome, thank you. |
(This is a followup to #209 , as requested by @50Wliu)
When trying to format a file marked as
azure-pipelines
, it doesn't work and VS Code says no formatter for this file type is installed:Searching for a formatter in the Marketplace then only results in this very same extension again, because it (falsely) is registered as a formatter there:
However, when I switch the filetype to YAML instead, this extension does offer a formatter, so if you have another formatter installed, you're being forced to choose one:
Unfortunately, if you actually do select this extension as the default formatter for YAML, it doesn't work either (no formatting is happening).
The workaround mentioned in the README and on the Marketplace page only seems to work with Prettier, not with the YAML language server from RedHat or other YAML extensions.
Possible fixes:
azure-pipelines
file type (this is what Allow VS Code to "format document" when a file is marked as Azure Pipelines #209 was about)or
Formatter
tag for this extension in the MarketplaceThe text was updated successfully, but these errors were encountered: