【问题标题】:VSCode User Snippet not working inside other snippetVSCode 用户代码段在其他代码段中不起作用
【发布时间】:2019-12-11 16:06:55
【问题描述】:

我创建了一些 VSCode 用户片段,但它在其他 sn-p 中不起作用。

这是 VSCode 的最新版本,1.36。

如果我有这个sn-p,

    "tmp": {
        "prefix": "tmp",
        "body": [
            "#include <bits/stdc++.h>",
            "using namespace std;",
            "",
            "int main()",
            "{",
            "    ${1:int} ans;",
            "    ${2:/* code */}",
            "    return 0;",
            "}"
        ],
        "description": "template"
    },

并在上面的 $2 中尝试这个 sn-p,

    "cin1": {
        "prefix": "cin1",
        "body": [
            "int a;",
            "cin >> a;"
        ],
        "description": "template"
    },

它永远不会起作用,并且在完成时什么也不显示。

我想在 sn-p 中显示完成。 任何帮助表示赞赏。

【问题讨论】:

    标签: c++ visual-studio-code vscode-settings code-snippets tab-completion


    【解决方案1】:

    将此设置为 false(如取消选中设置面板中的复选框):

    "editor.suggest.snippetsPreventQuickSuggestions": false
    

    默认是true,会阻止你的内部sn-p作为sn-p工作。

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 2020-11-06
      • 2021-11-23
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2022-12-22
      • 1970-01-01
      相关资源
      最近更新 更多