微信公众号搜"智元新知"关注
微信扫一扫可直接关注哦!

VS Code 加载 React 文件图标而不是 JS 文件图标

如何解决VS Code 加载 React 文件图标而不是 JS 文件图标

我安装了材质图标,它完美地显示了 JS 图标,但最近 VS 代码由于某种原因正在加载 JS 文件的反应图标,我不知道为什么。

enter image description here

Settings.json:

   {
    "workbench.startupEditor": "newUntitledFile","workbench.iconTheme": "material-icon-theme","workbench.preferredLightColorTheme": "Monokai++","window.menuBarVisibility": "toggle","editor.minimap.enabled": false,"javascript.updateImportsOnFileMove.enabled": "always","[dart]": {
        "editor.formatOnSave": true,"editor.formatOnType": true,"editor.rulers": [
            80
        ],"editor.selectionHighlight": false,"editor.suggest.snippetsPreventQuickSuggestions": false,"editor.suggestSelection": "first","editor.tabCompletion": "onlySnippets","editor.wordBasedSuggestions": false
    },"dart.previewLsp": true,"dart.debugExternalLibraries": true,"dart.debugSdkLibraries": false,"[javascriptreact]": {
        "editor.defaultFormatter": "vscode.typescript-language-features"
    },"liveServer.settings.donotShowInfoMsg": true,"editor.formatOnSave": true,"[html]": {
        "editor.defaultFormatter": "esbenp.prettier-vscode"
    },"[css]": {
        "editor.defaultFormatter": "esbenp.prettier-vscode"
    },"workbench.colorTheme": "Monokai++","editor.fontWeight": "normal","material-icon-theme.activeIconPack": "none","material-icon-theme.folders.associations": {
    
    },"material-icon-theme.files.associations": {
       
    }
}

解决方法

尝试将以下设置添加到您的配置中:

"material-icon-theme.files.associations": {
    "**.js": "javascript",}

通过此设置,您可以将每个 .js 文件的图标设置为 javascript 图标

版权声明:本文内容由互联网用户自发贡献,该文观点与技术仅代表作者本人。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌侵权/违法违规的内容, 请发送邮件至 dio@foxmail.com 举报,一经查实,本站将立刻删除。