Skip to content

breaks editor features #3

@claytonrcarter

Description

@claytonrcarter

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:

  1. ensure this extension is not installed
  2. open a file for any language that has the injection installed (eg Rust, but I also tested it with PHP and this patch)
  3. run "toggle comment" several times to confirm that it works
  4. install this extension
  5. run "toggle comment" once → works
  6. 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.

Metadata

Metadata

Assignees

No one assigned

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions