-
Notifications
You must be signed in to change notification settings - Fork 16
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
Language configuration (comments) not adjusting properly #6
Comments
I tried several things to resolve the issue, with no success. I will list some ideas:
The only workaround I found, is to use the monarch tokenizer for HTML, as it provides the nextEmbedded and works perfectly with the CSS/JS TM Grammars, but unfortunately, this is not a great solution for obvious reasons.. |
Can you please setup a minimal project for us to look at (and use as a base reference for patches that follow)? Could be as little as an Please create a repo and link it here. (If it's done well, we can look into linking it into readme of this project as an example for other folks to look at) |
@NeekSandhu I think you can reproduce this issue just by loading up an html tmlLanguage like https://github.com/Microsoft/vscode/blob/master/extensions/html/syntaxes/html.tmLanguage.json alone side the css and javascript embeds (https://github.com/microsoft/vscode/blob/master/extensions/javascript/syntaxes/JavaScript.tmLanguage.json & https://github.com/microsoft/vscode/blob/master/extensions/css/syntaxes/css.tmLanguage.json). Then simply write something like: <div>
Hello
</div>
<script>
console.log("Hello")
</script>
<style>
.hello { color: green }
</style> Then try commenting out ( <div>
<!-- Hello -->
</div>
<script>
<!-- console.log("Hello") -->
</script>
<style>
<!-- .hello { color: green } -->
</style> |
Hello,
In monaco-editor, each language has a configuration (type of comments, foldind, etc.). So if you are in html mode, the "toggle comment" key wraps the code in
<!-- -->
, if you are in css, the comments become/* */
, etc.This behavior stops working correctly if we have languages with embedded modes (ex. html with <style> or <script>). In that case, all the comments become
<!-- -->
, no matter if you are in one of the tags mentioned.Is there a call you can make on the fly (during tokenization) to change the configuration, based on the language type of the current line that we are tokenizing?
The text was updated successfully, but these errors were encountered: