Open
Description
toggle_comments
should take language injections into account. For example in HTML:
<p>
C-c on this line should use the HTML comment token(s).
</p>
<script type="text/javascript">
// C-c on this line should use the javascript comment token(s).
foo();
</script>
To do this we should look at the byte range for each Range in the current Selection and find the LanguageLayer in doc.syntax()
(Syntax
) with the smallest/deepest range that completely covers the selection range. We will then need a way to find the LanguageConfiguration for a given LanguageLayer and then we can use that LanguageConfiguration's comment_token
for that range in the selection.
The changes for this will conflict with #1505 / #4718 so this feature may be better off waiting for those changes to land.