-
Notifications
You must be signed in to change notification settings - Fork 7
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Symbol path is incorrect when self-closing tags are used #24
Comments
I finally managed to take a look at this and #27. Unfortunately I encountered the same roadblock in both of them. The problem is that self closing and paired tags overwrite each other when I try to define ad-hoc rules. I looked at the HTML extension from @panicinc and they don't have any rules for handling a case where a tag is both self closed and paired. In fact I had the same error in plain HTML... I'll use the case of #27 as an example. This is how the standard style block is currently implemented: <scope name="vue.embedded.block.style" spell-check="false" lookup="documentation">
<starts-with>
<expression>(?=<(?i:style)\b)</expression>
</starts-with>
<ends-with />
<subscopes anchored="true" skip-whitespace="false">
<scope name="vue.tag.style.open">
<symbol type="tag-style">
<context behavior="start" group-by-name="true">
<auto-close string="</" completion="${name}>" />
</context>
</symbol>
<starts-with>
<expression><((?i:style))</expression>
<capture number="1" name="vue.tag.name" />
</starts-with>
<ends-with>
<expression>/?></expression>
</ends-with>
<subscopes>
<include syntax="html" collection="attributes" />
</subscopes>
</scope>
<scope name="vue.embedded.block.style.content">
<starts-with>
<expression>(?<=>)</expression>
</starts-with>
<ends-with>
<expression>(?=</(?i:style)\b)</expression>
</ends-with>
<subsyntax name="css">
<cut-off>
<expression>(?=</(?i:style)\b)</expression>
</cut-off>
</subsyntax>
</scope>
</subscopes>
</scope> For allowing a self closing style I tried to use something like this: <scope name="vue.tag.open.single" spell-check="false" lookup="documentation">
<symbol type="tag-style">
<context behavior="subtree" group-by-name="true" unclosed="truncate" />
</symbol>
<starts-with>
<strings prefix="<" suffix="\b" word-boundary="false" case-insensitive="true">
<string>style</string>
</strings>
<capture number="1" name="vue.tag.name" />
</starts-with>
<ends-with>
<expression>/?></expression>
</ends-with>
<subscopes>
<include syntax="html" collection="attributes" />
</subscopes>
</scope> The problem is that the first overwrite the second or viceversa depending on the order I place them in code. Maybe @logancollins can tell us something more about this error. |
Thanks for looking into this, @tommasongr 🙏 I think you're saying this might be an issue in Panic itself. Also curious if @logancollins can add any insight. Vue's single-file component syntax does allow using paired or self-closing tags, so things do feel broken if Nova syntax highlighting and symbol paths aren't correct. |
The symbol path at the top of an editor tab is incorrect when using self-closing tags (notice the
<Nav/>
:If I add a separate closing tag, the symbol path is correct for this same cursor position:
The text was updated successfully, but these errors were encountered: