奇怪的是以下与Node相关的扩展; express snippet extension,expressjs4-snippets和Node Snippets会在一段时间后停止工作。我的反应片段很好,但是这三个片段却不行。
下面是我的settings.json
配置文件:
{
// //editor fontSize and tabSize configs
"editor.fontSize": 14,
"terminal.integrated.fontSize": 14,
"window.zoomLevel": -1,
"[Log]": {
"editor.fontSize": 14
},
// Controls if suggestions should be accepted on 'Enter' - in addition to 'Tab'. Helps to avoid ambiguity between inserting new lines or accepting suggestions. The value 'smart' means only accept a suggestion with Enter when it makes a textual change
"editor.acceptSuggestionOnEnter": "on",
"editor.autoIndent": true,
"editor.emptySelectionClipboard": false,
"editor.formatOnPaste": true,
"editor.multiCursorModifier": "ctrlCmd",
"editor.renderIndentGuides": true,
"editor.renderWhitespace": "none",
"editor.renderControlCharacters": false,
"editor.scrollBeyondLastLine": true,
"editor.showFoldingControls": "always",
"editor.showUnused": true,
// Controls the delay in ms after which quick suggestions will show up.
"editor.quickSuggestionsDelay": 10,
// Controls if quick suggestions should show up while typing
"editor.quickSuggestions": {
"other": true,
"comments": false,
"strings": false
},
// Controls if suggestions should automatically show up when typing trigger characters
"editor.suggestOnTriggerCharacters": true,
// Controls if pressing tab inserts the best suggestion and if tab cycles through other suggestions
"editor.tabCompletion": "on",
"editor.trimAutoWhitespace": false,
"editor.wordWrap": "on",
// Controls whether sorting favours words that appear close to the cursor
"editor.suggest.localityBonus": true,
"editor.wordBasedSuggestions": true,
// Tab config
// The number of spaces a tab is equal to. This setting is overridden
// based on the file contents when `editor.detectIndentation` is true.
"editor.tabSize": 2,
// Insert spaces when pressing Tab. This setting is overriden
// based on the file contents when `editor.detectIndentation` is true.
"editor.insertSpaces": true,
// When opening a file, `editor.tabSize` and `editor.insertSpaces`
// will be detected based on the file contents. Set to false to keep
// the values you've explicitly set, above.
"editor.detectIndentation": false,
// emmet
// When enabled, Emmet abbreviations are expanded when pressing TAB.
"emmet.triggerExpansionOnTab": true,
"emmet.syntaxProfiles": {
"javascript": "jsx",
"xml": {
"attr_quotes": "single"
}
},
"emmet.includeLanguages": {
"javascript": "javascriptreact"
},
// Enable ESLint (with Prettier plugin) to format code on save
"eslint.alwaysShowStatus": true,
"eslint.autoFixOnSave": true,
"eslint.enable": true,
"eslint.nodePath": "/Users/antonio-pavicevac-ortiz/.nvm/versions/node/v9.0.0/bin/eslint",
"files.autoSave": "onFocusChange",
"files.hotExit": "off",
"files.trimTrailingWhitespace": true,
"files.insertFinalNewline": true,
"files.associations": {
"*.js": "javascriptreact",
".gitignore": "shellscript"
},
// Disable default VSCode formatting for JavaScript
"[javascript]": {
"editor.formatOnSave": false
},
"javascript.validate.enable": true, // this controls having your unused imports or variables to appear grey
"html.format.enable": true,
"html-css-class-completion.enableEmmetSupport": true,
// //php settings
"php.executablePath": "/usr/bin/php",
"prettier.disableLanguages": [
"javascript",
"javascriptreact",
"json"
],
"editor.suggestSelection": "first",
"vsintellicode.modify.editor.suggestSelection": "automaticallyOverrodeDefaultValue",
"workbench.colorTheme": "Night Owl",
"sync.gist": "8e227eee246912533620000ceb348981"
}
任何帮助将不胜感激!
更新
不是真正的更新,而是我发现的一种使它们暂时工作的方法;
我实际上退出了vs代码,然后转到(在MacOS Mojave版本10.14.3上) 主文件夹>库>应用程序支持>代码 并将该文件夹废弃。它基本上会在启动时重新生成。
该 CODE 文件夹包含一个 USER 文件夹。在该文件夹中是 keybindings.json 和 settings.json 文件,其中一个文件覆盖默认值,调整扩展程序的首选项。
在我的情况下,因为我使用的是Settings-Sync(它的扩展名和设置可以保存在github上的gist中,并由多台计算机和团队共享!!)收回一切。
答案 0 :(得分:0)
所以我再次像上面提到的那样丢弃了所有内容,但是这次在我的 settings.json 中,我决定重新输入每个设置以查看是否很闷这些插件。原来是一个!
罪魁祸首是:
"files.associations": { // breaks node, express auto completes
"*.js": "javascriptreact",
".gitignore": "shellscript"
},
很明显,它是"*.js": "javascriptreact",
,但我必须深入研究为什么?