Closed vojtechjelinek closed 9 years ago
Thanks for working on this.
If I recall correctly, I've tried to do this using cursor.getScopeDescriptor()
, because you can have other languages such as CSS and JS embedded in the HTML and it would be nice to add the correct comment syntax for the scope where the cursor is at.
The problem gets more complex when you consider a selection that crosses language boundaries (i.e. the beginning of the selection and end of the selection belong to different scopes), in this case I'd priorize the language at the beginning of the selection because the user would most likely be commenting out the token which causes the scope change.
In the end, I couldn't get it working as good as Emmet's toggle-comment
(which works great for HTML and CSS), so I didn't include it in this package.
I'll merge this if you can add support for HTML without breaking the comment syntax on embedded languages (specifically, code inside <script>
and <style>
tags).
So, what do you think?
Oh sorry, I didn't see that you've added new commits. I will review it soon. :)
Looks good, I'll make a few tweaks and merge. :smiley:
Released as v0.2.0.
Support for , /* */ are still default but for all html files the are used.