-
Notifications
You must be signed in to change notification settings - Fork 2
Description
This extension seems to be interfering/breaking some editor features that need to work with language settings. For example, editor: toggle comments
needs to know what line comments are used for the base language so that they can be toggled on/off. However, when Zed calls snapshot.language_scope_at(...)
, it resolves to this extension (ie comment
) and then, when it later calls language.line_comment_prefixes()
, it resolves to an empty slice/vec, because of course there are no line comments defined in this language.
Features I've encountered so far that don't work with this extension installed:
- toggle comments (toggle on works, but then toggle off doesn't)
- rewrap (in a comment)
Repro:
- ensure this extension is not installed
- open a file for any language that has the injection installed (eg Rust, but I also tested it with PHP and this patch)
- run "toggle comment" several times to confirm that it works
- install this extension
- run "toggle comment" once → works
- run "toggle comment" again → 💥
I'm not a Zed expert, but my hunch is that this is a fundamental limitation of how Zed handles languages and it may require changes there (in Zed) to handle stuff like this.