Disable intellisense for css classnames in .tsx/.ts files

别等时光非礼了梦想. 提交于 2019-12-02 18:21:29

问题


Whenever I enter a . after a object the autocomplete dropdown contains a lot of unnecessary css classnames as options:

Is it possible to ignore css files for ts/tsx intellisense, so i only get relevant options?

VS Code version: 1.37.1


回答1:


Try something like this in your settings:

"[typescript]": {
  "editor.suggest.filteredTypes": {
    "class": false,
  }
},
"[typescriptreact]": {
  "editor.suggest.filteredTypes": {
    "class": false,
  }
}

[it would be nice if you could combine these but [typescript, typescriptreact] didn't work for me.

From types of completions it looks like it is class that you want to filter out.

And see create language-specific settings to see how to create settings for specific languages.

You will have to reload vscode to see these changes take effect.



来源:https://stackoverflow.com/questions/57724902/disable-intellisense-for-css-classnames-in-tsx-ts-files

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!