antonk52 / cssmodules-language-server

autocompletion and go-to-defintion for cssmodules
MIT License
54 stars 8 forks source link

Not working with :global in scss file #6

Closed zigotica closed 2 years ago

zigotica commented 2 years ago

Hi, thank you for the server.

It is not working when CSS module is used in separate scss file, and we use :global

Screenshot 2022-01-10 at 12 34 24
antonk52 commented 2 years ago

Hello and thank you for the issue! Sorry for a late reply.

I have tried to repro what I could see on a screenshot and the completion worked as expected.

Screenshot 2022-01-18 at 11 53 56

If the issue is about the red diagnostics from the screenshot in scss file These are from cssls and not from cssmodules-language-server. This can be fixed with changing the selector from :global(> .cell) to > :global(.cell) as global is supposed to only wrap the classname and not the entire selector. Please see css modules docs.

I did notice that with this setup go-to-definition worked, but with .cell it lands on :global instead of the sell directly. It would be nice to fix this.

If you are still having an issue can you share a minimal code example that reproduces the issue?

zigotica commented 2 years ago

Hi ANton, thanks for your reply. You were right, this was a wrong syntax from my example. Thank you