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鈥檒l occasionally send you account related emails.

Already on GitHub? Sign in to your account

Setting to Disable .js / .ts Autocomplete? #58

Closed
karlhorky opened this issue Jan 26, 2023 · 8 comments 路 Fixed by #81 or #85
Closed

Setting to Disable .js / .ts Autocomplete? #58

karlhorky opened this issue Jan 26, 2023 · 8 comments 路 Fixed by #81 or #85
Labels
enhancement New feature or request

Comments

@karlhorky
Copy link
Contributor

karlhorky commented Jan 26, 2023

Hi @vunguyentuan 馃憢 hope you are well :)

Would you consider adding a setting to disable the .js / .ts autocomplete feature for projects that do not use CSS-in-JS?

Currently, in a project that does not use CSS-in-JS, the extension fills the autocomplete entries all over the place in JS, JSX, TS and TSX files with useless entries for CSS variables:

Screenshot 2023-01-24 at 11 40 59

For example, adding a new setting called cssVariables.autocompleteInLanguages, default values below:

{
  "cssVariables.autocompleteInLanguages": [
    "css",
    "less",
    "scss",
    "postcss",
    "javascript",
    "javascriptreact",
    "typescriptreact"
  ],
}

Or, if this is based on file extension instead of language in the file, a new setting called cssVariables.autocompleteInFiles, default values:

{
  "cssVariables.autocompleteInFiles": [
    "*.css",
    "*.scss",
    "*.sass",
    "*.less",
    "*.js",
    "*.jsx",
    "*.ts",
    "*.tsx"
  ]
}
@Cellule
Copy link
Contributor

Cellule commented Jan 31, 2024

馃憤 I do not use styles in javascript and the autocomplete is just pollution. I really only want them in css files.
It's fine if that's the default, but I was expecting a setting

@karlhorky
Copy link
Contributor Author

@Cellule @vunguyentuan thanks for the setting!

@karlhorky
Copy link
Contributor Author

karlhorky commented Feb 21, 2024

@vunguyentuan is this new cssVariables.languages setting working completely?

I'm still receiving suggestings in a .ts files (typescript syntax), even though I have disabled those:

Screenshot 2024-02-21 at 20 34 29

Disabling the extensions makes these suggestions disappear.

This is my settings configuration:

{
  "cssVariables.languages": [
    // "astro",
    // "svelte",
    // "vue",
    // "vue-html",
    // "vue-postcss",
    "scss",
    "postcss",
    "less",
    "css",
    "html",
    // "javascript",
    // "javascriptreact",
    // "typescript",
    // "typescriptreact",
    "source.css.styled"
  ]
}

@Cellule
Copy link
Contributor

Cellule commented Feb 22, 2024

I admit something is off. It worked fine initially with my fork, then once it was published it no longer seemed to work
Haven't had time yet to investigate

@karlhorky
Copy link
Contributor Author

@vunguyentuan can we reopen this issue?

@Cellule
Copy link
Contributor

Cellule commented Mar 6, 2024

@karlhorky I found my bug 馃槄
#85
Sorry about that, hopefully it gets merged and released soon :)

@karlhorky
Copy link
Contributor Author

Amazing, thanks! Watching #85 now :)

@karlhorky
Copy link
Contributor Author

@vunguyentuan @Cellule thanks for the PR and merge!

I can confirm that this is fixed in the new 2.7.1 version which was just published 馃檶

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
3 participants