tailwindlabs / tailwindcss-intellisense

Intelligent Tailwind CSS tooling for Visual Studio Code
2.74k stars 183 forks source link

Fix hovers and conflicts in Vue `<style lang="sass">` blocks #930

Closed thecrypticace closed 3 months ago

thecrypticace commented 3 months ago

We weren't parsing these blocks as Sass (or any semicolon-less language) and we were instead assuming CSS syntax. Because of this we wouldn't pick up conflicts when we should and sometimes would pick up conflicts when we shouldn't.

This PR fixes this by handling language boundaries on hover and threading language information from <style lang="…"> blocks.

Fixes #895

RobinMalfait commented 3 months ago

Do you think it's a lot of work to setup CI for tests? I can't figure out if these tests are expected to fail or not:

image
RobinMalfait commented 3 months ago

Ah figured it out, I had to manually go into each tests/fixtures/v{1,4} and run npm install. I think this is something we should improve in a future PR to make sure that all those sub folders are part of the workspace if possible.

thecrypticace commented 3 months ago

Ah figured it out, I had to manually go into each tests/fixtures/v{1,4} and run npm install. I think this is something we should improve in a future PR to make sure that all those sub folders are part of the workspace if possible.

We can't make them a part of the normal project workspace because of dependency hoisting, unfortunately. If there's a way to disable hoisting but still use workspaces I'd use them for all of these.

thecrypticace commented 3 months ago

I need to fix the test:prepare script though, good call. I'll do that in a separate PR.