vscode:Express Snippets 一段时间后停止工作 [英] vscode: Express Snippets stop working after a while

查看:28
本文介绍了vscode:Express Snippets 一段时间后停止工作的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

奇怪的是以下Node相关的扩展;快速代码段扩展expressjs4-snippetsNode Snippets 过一会儿就停止工作.我的反应片段很好,但不是这三个.

Strangely the following Node related extensions; express snippet extension, expressjs4-snippets and Node Snippets simply stop working after a while. My react snippets are fine, but not these three.

下面是我的 settings.json 配置文件:

Below is my settings.json config file:

{
     // //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" 
}

任何帮助将不胜感激!

更新

不是真正的更新,而是我发现的一种让它们暂时工作的方法;

Not really an update but a method I discovered to get them working temporarily;

我实际上退出了 vs code,然后转到(在 MacOS Mojave 版本 10.14.3 上)主文件夹 > 库 > 应用程序支持 > 代码 并删除该文件夹.它基本上会在启动时重新生成.

I actually quit vs code and then go to (on a MacOS Mojave version 10.14.3) home folder > Library > Application Support > Code and trash that folder. It essentially will regenerate upon start up.

那个 CODE 文件夹包含一个 USER 文件夹.在该文件夹中是 keybindings.jsonsettings.json 文件,这是覆盖默认值和调整扩展的首选项.

That CODE folder contains a USER folder. In that folder are the keybindings.json and the settings.json files which is where one overrides the defaults and tweak preferences of the extensions.

就我而言,因为我使用的是 Settings-Sync(它允许将一些扩展和设置保存在 github 上的一个要点中,供多台计算机和团队共享!!!)所以把所有东西都拿回来还不错.

In my case because I'm using Settings-Sync (It allows ones extensions and settings to be saved in a gist on github, to be shared by multiple computers and teams!!!) so it's not too bad to get everything back.

推荐答案

所以我再次像上面提到的那样丢弃了所有内容,但这次是在我的 settings.json我决定重新输入每个设置,看看是否有人在使用这些插件.原来是一个!

So once again I trashed everything like I mentioned above, but this time in my settings.json I decided to re-enter each setting to see if one was borking those plugins. Turns out one was!

罪魁祸首是:

 "files.associations": { // breaks node, express auto completes
   "*.js": "javascriptreact",
   ".gitignore": "shellscript"
 },

显然是 "*.js": "javascriptreact", 但我必须深入研究为什么?

Obviously its the "*.js": "javascriptreact", but I'll have to dig into why?

这篇关于vscode:Express Snippets 一段时间后停止工作的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆