willofindie / vscode-cssvar

VSCode extension to support CSS Variables Intellisense
https://marketplace.visualstudio.com/items?itemName=phoenisx.cssvar
MIT License
252 stars 4 forks source link

[Bug] Nested color values does not work for Multi-Root WS #68

Open phoenisx opened 2 years ago

phoenisx commented 2 years ago

Describe the bug Nested variable declarations do not get evaluated for color values, where one of the parent CSS source file is present in multiple folder settings.

To Reproduce Steps to reproduce the behavior:

  1. Create a Multi Root project, and define two folders (f1 and f2) in it.
  2. cssvar settings for both these folders would look something like the following:
// f1/.vscode/settings.json
{
  "cssvar.files": ["../node_modules/open-props/open-props.min.css"],
  "cssvar.ignore": []
}
// f2/.vscode/settings.json
{
  "cssvar.files": ["../node_modules/open-props/open-props.min.css", "theme*.css"],
  "cssvar.ignore": [],
}
  1. As you can see both f1 and f2 folders depend on variables provided by open-props.css and are defined in both folder's settings
  2. Intellisense for CSS variables in one of these folders (f2 for example) is not provided, even though open-props is declared in f2 folder's settings.

Expected behavior Intellisense should work in both f1 and f2 folders, for open-props CSS variables.

Additional context This is happening because a CSS source file is evaluated only once, unless it is modified later. Since open-props is served from node-modules, and is less likely to get updated, it isn't added to f2 intellisense providers.