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

Works in css files but not in tsx #3

Closed
etabard opened this issue Apr 7, 2021 · 4 comments
Closed

Works in css files but not in tsx #3

etabard opened this issue Apr 7, 2021 · 4 comments

Comments

@etabard
Copy link

etabard commented Apr 7, 2021

Hi,

Thanks for your plugin, I'm using styled component and looking for a css var completion.
It's working well in css files but can't manage to make it work in typescript files as announced in your last commit.

Thanks for your help !

@phoenisx
Copy link
Contributor

phoenisx commented Apr 8, 2021

Hi!

Thanks for your support and opening this issue. 🙏🏾
I verified the plugin on .tsx files as well, and it's working for me. Check the attached .gif:

example

Can you share me a repro for your problem, or give some details on what vscode settings you have, and is the location of your cssvar.files correct?

To support .tsx files you will have to add the following settings:

{
  "cssvar.extensions": ["css", "scss", "typescript", "typescriptreact"],
}

If you are using .ts or .tsx, instead of typescript or typescriptreact as extension values,
please change accordingly. Will update the docs as well, for the same

@etabard
Copy link
Author

etabard commented Apr 9, 2021

Hi, thanks for your reply !

Here is the config i'm using :

{
  "cssvar.files": ["@app/client/assets/vars.css"],
  "cssvar.extensions": ["ts", "tsx", "css", "less"]
}

I'm using yarn workspaces maybe that's a problem ? I'll try to make a repro !
Thanks

@phoenisx
Copy link
Contributor

phoenisx commented Apr 10, 2021

Yeah!

Please convert your configs a little bit:

  • If @app points to ./src (Since this project is language agnostic, it doesn't support @app from tsconfig.json paths.):
{
  "cssvar.files": ["src/client/assets/vars.css"],
  "cssvar.extensions": ["typescript", "typescriptreact", "css", "less"]
}

Convert ts to typescript and tsx to typescriptreact, as these names are VSCode defaults.

Will add a support for short extensions like: js or tsx in next release. For now, please modify your config as mentioned above.

@phoenisx phoenisx mentioned this issue Apr 10, 2021
12 tasks
@etabard
Copy link
Author

etabard commented Apr 12, 2021

Thanks a lot for your help @phoenisx

@app is a real path but switching to ["typescript", "typescriptreact", "css", "less"] works !

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

2 participants