Skip to content
This repository was archived by the owner on Dec 15, 2022. It is now read-only.
This repository was archived by the owner on Dec 15, 2022. It is now read-only.

Closely-named XML tags are not matched correctly using vue grammar #392

@jonboiser

Description

@jonboiser

Prerequisites

Description

Hi, the issue might be due to the internal workings of the language-vue, but maybe you can help me understand the internals of this library so I can try to patch language-vue.

When using the Tree-Sitter HTML grammar, the tag matching works properly:

Screen Shot 2020-01-22 at 12 22 43 PM

But when I switch the (non-Tree Sitter) grammar to the "Vue component" text.html.vue, the VCard start tag is being matched with the inner VCardTitle end tag:

Screen Shot 2020-01-22 at 12 23 07 PM

Does 'bracket-matcher' internally rely on the grammar scope names to find the pairs?

I've added the scopes for the highlighted tags on both screenshots to show that there is a slight difference in the Vue scopes. It is also reminiscent of the various nested-tag bugs reported before (e.g. #320 )

Steps to Reproduce

  1. Write a Vue Component-like text file like this
<VCard>
  <VCardTitle>
  </VCardTitle>
</VCard>
  1. In Atom, with both the language-vue and bracket-matcher libraries installed, view the file using the 'Vue Component' syntax
  2. The wrong bracket will be matched when the cursor is on the first line "VCard"

Expected behavior:

For this example, the first "VCard" tag is matched with the second on line 4.

Actual behavior:

For this example, the first "VCard" tag is matched with the "VCardTitle" tag on line 3.

Reproduces how often:

Always

Versions

apm  2.4.3
npm  6.2.0
node 10.2.1 x64
atom 1.43.0
python 3.7.5
git 2.21.1

MacOS Catalina

Additional Information

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions