monaco-editor
monaco-editor copied to clipboard
HTMLHint (or extension support)
Currently VSCode/Monaco supports linting for a good number of languages, but HTML is not one of them. VSCode makes up for this with an extension: https://github.com/Microsoft/vscode-htmlhint
So, will VSCode extensions (perhaps with minor mods) work in Monaco? If not, any plans to add HTML linting?
fyi @aeschli
Today the html language support is still inside monaco-editor-core
aka in the vscode repo. That is because 100% the same code ships with vscode and with the editor. We plan to break up this code, to create a vscode html extension and once that is done, we can create a monaco-html
editor plugin that reuses some of the code, but that is independent of vscode. We can then consider adding more features to it.
TL;DR we can't do it yet due to it affecting vscode, but we plan to fix this by making things separate.
Sounds good, thanks. I'm creating a tool to help students learn HTML+CSS so this will be quite helpful. Happy to help with this when it becomes possible.
@alexandrudima would the creation of a monaco-html
editor plugin include support for Emmet?
@alexandrudima has there been any positive progress on this? I as well am trying to indicate syntax errors while editing HTML
May I add that I see the monaco-html plugin. @alexandrudima is there I way I can accomplish the hinting with this module? I'm browsing the object and monaco.languages.html.htmlDefaults
appears to be missing diagnosticsOptions
similar to the other languages. Am I overlooking something?
The Monaco HTML support doesn't include any validation and there are currently no plans to work on it. Contributions are welcome. The code base is at https://github.com/Microsoft/vscode-html-languageservice.
@aeschli may I ask, why? Is validating HTML just outright not interesting to Microsoft, or is it just backlogged pretty deep? I open up VS Code and have no sense of assurance that any of my markup is even close to being valid. I find this very surprising.
It just hasn't gotten any priority yet and surprisingly there haven't been many requests for it. My guess this has to do that there are plenty of good validators out there. It's quite some work to keep a validator up-to-date. One issue with HTML is that there are many templating variants of HTML around, and for these files validation often flags problems that are false positives.
@aeschli gotcha. I was hoping there could be at least something simple e.g. <div><div
isn't a closed tag and flagged by the editor (similar to how Webstorm will do it). Thanks for the explanation. hopefully more requests for this will roll in but at this point I can't see it happening!
+1 this is really needed
+1 jumping on the this is needed train
+1 Another vote for needed
+1 Another vote for needed
+1 Another vote for needed
+1 for this
We closed this issue because we don't plan to address it in the foreseeable future. If you disagree and feel that this issue is crucial: we are happy to listen and to reconsider.
If you wonder what we are up to, please see our roadmap and issue reporting guidelines.
Thanks for your understanding, and happy coding!