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

:global() selector causes syntax highlighting to fail #2650

Open
blake-regalia opened this issue Jan 5, 2025 · 1 comment
Open

:global() selector causes syntax highlighting to fail #2650

blake-regalia opened this issue Jan 5, 2025 · 1 comment
Labels
bug Something isn't working upstream

Comments

@blake-regalia
Copy link

Describe the bug

When using the :global(...) selector with an argument nested under an element selector in a LESS css block, the syntax highlighting gets messed up (it continues to lex in LESS even after the closing </style>)

Reproduction

<style lang="less">
    div {
        :global(.demo) {
            color: blue;
        }
    }
</style>


<div class="demo">
    Text
</div>

Screenshot 2025-01-05 at 02 40 48

Inspecting the scopes at class="demo" reveals that it is still lexing as LESS:

Text: ' class="demo"'
Length: 13
Scopes:
  - meta.embedded.block.svelte
  - meta.lang.less.svelte
  - meta.property-list.less
  - meta.selector.less
  - meta.style.svelte
  - source.css.less
  - source.svelte

Expected behaviour

What the proper syntax highlighting should show:

Screenshot 2025-01-05 at 02 46 34

System Info

  • OS: MacOS
  • IDE: VSCode

Which package is the issue about?

svelte-language-server

Additional Information, eg. Screenshots

No response

@dummdidumm
Copy link
Member

This is an issue with the less grammar, opened radium-v/Better-Less#56 for this

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working upstream
Projects
None yet
Development

No branches or pull requests

2 participants