-
Notifications
You must be signed in to change notification settings - Fork 97
Closely-named XML tags are not matched correctly using vue grammar #392
Description
Prerequisites
- Put an X between the brackets on this line if you have done all of the following:
- Reproduced the problem in Safe Mode: https://flight-manual.atom.io/hacking-atom/sections/debugging/#using-safe-mode
- Followed all applicable steps in the debugging guide: https://flight-manual.atom.io/hacking-atom/sections/debugging/
- Checked the FAQs on the message board for common solutions: https://discuss.atom.io/c/faq
- Checked that your issue isn't already filed: https://github.com/issues?utf8=✓&q=is%3Aissue+user%3Aatom
- Checked that there is not already an Atom package that provides the described functionality: https://atom.io/packages
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:
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:
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
- Write a Vue Component-like text file like this
<VCard>
<VCardTitle>
</VCardTitle>
</VCard>
- In Atom, with both the
language-vueandbracket-matcherlibraries installed, view the file using the 'Vue Component' syntax - 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

