Skip to content
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

Unknown pseudo class is tokenized wrong #56

Open
1 of 3 tasks
dummdidumm opened this issue Jan 6, 2025 · 0 comments
Open
1 of 3 tasks

Unknown pseudo class is tokenized wrong #56

dummdidumm opened this issue Jan 6, 2025 · 0 comments

Comments

@dummdidumm
Copy link

dummdidumm commented Jan 6, 2025

Please select any editor that you're experiencing this issue in.

  • Visual Studio Code
  • Sublime Text 2/3
  • TextMate 2

Please provide the name/repo of the color scheme package you're using:

  • irrelevant

(optional) Please include any packages/extensions you're using which could be conflicting:

  • Deferring to the VS Code less syntax highlighting from within a Svelte file's style tag

When using an unknown pseudo class, the highlighting ends up in a broken state, which can influence/mess up how the code after it is highlighted.

Example:

:global(.demo) {
    color: blue;
}

Will provide just meta.selector.less as the token for :global, but it should be entity.other.attribute-name.pseudo-class.less like it is for known pseudo classes, like is:(.demo) { }.

This came up in sveltejs/language-tools#2650, the repo for the Svelte extension which defers the syntax highlighting of <style lang="less"> to VS Code's built-in grammar, which to my knowledge is this grammar. :global is not a spec-ed pseudo class, rather a Svelte-specific one.

As far as I can see this is due to https://github.com/radium-v/Better-Less/blob/master/Syntaxes/Better%20Less.YAML-tmLanguage#L1952 only matching on a known list of pseudo classes.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant