Skip to content

Using expand to parent syntax node inside an injected context selects the whole injection #2311

@EpocSquadron

Description

@EpocSquadron

Summary

As described in the title and repro steps.

Reproduction Steps

For example in the following minimal vue example:

<script type="javascript">
export default {
  computed: {
    isRendered () {
      return this.$store.state.isRendered
    }
}
</script>

<style>
.isRendered {
  display: block;
}
</style>

If you start with a single-character selection somewhere on the return line, and press Alt-k or Alt-<up>, instead of selecting the inner scope of the isRendered method as expected, the entire contents of the <script> are instead.

Helix log

Log is not applicable, but tree-sittier-scopes does not report the scopes in the javascript, just ["component", "script_element", "raw_text"] and the subtree shows only (raw_text). This is in opposite to the fact that the highlight scopes must be applied to the actual scopes in the javascript injection, so these commands, and the expansion keybind are somehow not getting access to the injected scopes.

Platform

Linux

Terminal Emulator

wezterm 20220427-144728-efcc4b48

Helix Version

helix 22.05-dev (477b88e)

Metadata

Metadata

Assignees

No one assigned

    Labels

    A-helix-termArea: Helix term improvementsC-bugCategory: This is a bug

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions