Skip to content

Add support for @container queries by updating the CSS language service - #439

Closed
marvinroger wants to merge 2 commits into
styled-components:mainfrom
marvinroger:main
Closed

marvinroger wants to merge 2 commits into
styled-components:mainfrom
marvinroger:main

Conversation

@marvinroger

@marvinroger marvinroger commented Dec 11, 2023 •

Copy link
Copy Markdown

This PR updates the CSS language service in order to support @container queries.

C.f. microsoft/vscode-css-languageservice#365 and microsoft/vscode-css-languageservice#371

The PR is ready to be published to npm 😉

@jasonwilliams

Copy link
Copy Markdown
Collaborator

Thanks @marvinroger
We will need to also update this here https://github.com/styled-components/typescript-styled-plugin/blob/main/package.json as that’s where the intellisense is handled.

Testing this is explained here: https://github.com/styled-components/vscode-styled-components/blob/main/CONTRIBUTING.md#intellisense

@marvinroger

Copy link
Copy Markdown
Author

I messed up the link in the description but it's already done styled-components/typescript-styled-plugin#19

This is why this PR is in draft

@jasonwilliams

jasonwilliams commented Dec 11, 2023 •

Copy link
Copy Markdown
Collaborator

Ok great thanks, have you tested these changes locally?
I can take a look myself later

@marvinroger

Copy link
Copy Markdown
Author

I did not test locally, but I can confirm that vscode-css-languageservice@6.2.11 does support container queries.
I'll let you test if you're OK with that 😉

@jasonwilliams

Copy link
Copy Markdown
Collaborator

@marvinroger
marvinroger marked this pull request as ready for review December 12, 2023 08:27
@marvinroger

Copy link
Copy Markdown
Author

Thanks, just updated the PR!

@macko911

macko911 commented Dec 13, 2023 •

Copy link
Copy Markdown

Thanks for doing this!
I tried to test this locally (built the extension and installed to VSCode) but it doesn't seem to have an effect - I still see the following warning.
image
This is the first time I'm building/installing a VSCode extension locally so it's probably just me not doing it right, but wanted to let you know. Hope your own test goes well. I can try and share some small reproduction later if it will be of any help.

It also looks like @container queries should be supported in the latest version of VSCode (1.85) in .css files based on this Stack Overflow answer but that also doesn't seem to be the case for me either. Not sure what's up.

@jasonwilliams

jasonwilliams commented Dec 13, 2023 •

Copy link
Copy Markdown
Collaborator

Yeah I've tested this branch and I'm still getting the warning too, are we sure this has been fixed in the styled plugin?
@marvinroger If you could make a fixture and add it to this branch which we can all look at that would help.

Sorry I know you've already done work in this repo but you may need to add a test here so we can be sure this has been fixed in the plugin before we try adding it to the extension.

I've also updated the main branch so you'll need to rebase if you can too

This is the first time I'm building/installing a VSCode extension locally so it's probably just me not doing it right, but wanted to let you know. Hope your own test goes well. I can try and share some small reproduction later if it will be of any help.

@macko911 I don't know how you set up before, but if you want to help fix this, I would say follow https://github.com/styled-components/vscode-styled-components/blob/main/CONTRIBUTING.md#intellisense

Then set some breakpoints in the styled plugin to see why its still warning about the unknown property at rule

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

Successfully merging this pull request may close these issues.

3 participants