首页
学习
活动
专区
圈层
工具
发布
社区首页 >问答首页 >在vscode语言扩展中让编辑器环绕工作有困难

在vscode语言扩展中让编辑器环绕工作有困难
EN

Stack Overflow用户
提问于 2018-10-11 11:54:16
回答 1查看 118关注 0票数 1

我正在向VS Code添加ISPC (Intel SPMD Compiler)语言支持,但我遇到了一个问题。我无法让环绕声起作用。我已经将configurationDefaults添加到package.json的contributes部分,并添加了一个包含括号、autoClosingPairs和surroundingPairs部分的语言配置文件。

我还尝试了全局设置编辑器设置,但是,无论我做什么,所选内容都会被删除,并替换为括号/引号/注释字符。希望我只是做错了什么。提前感谢您的帮助。

vscode版本- 1.28.0

package.json

代码语言:javascript
复制
"contributes": {
    "languages": [
      {
        "id": "ispc",
        "aliases": ["Intel® SPMD Program Compiler", "ISPC", "Volta"],
        "extensions": [".ispc", ".isph" ],
        "configuration": "./ispc.configuration.json"
      }
    ],

    "grammars": [
      {
          "language": "ispc",
          "scopeName": "source.ispc",
          "path": "./ispc.tmLanguage"
      }
    ],

      "snippets": [
      {
          "language": "ispc",
          "path": "./ispc-snippets.json"
      }
    ],

    "configuration": {
      "type": "object",
      "title": "ISPC ",
      "properties": {
        "ispc.maxNumberOfProblems": {
          "type": "number",
          "default": 100,
          "description": "Controls the maximum number of problems returned by the server."
        },
        "ispc.trace.server": {
          "type": "string",
          "enum": [
            "off",
            "messages",
            "verbose"
          ],
          "default": "off",
          "description": "Traces the communication between VSCode and the ISPC language server."
        }
      }
    },

    "configurationDefaults": {
         "[ispc]": {
             "editor.autoClosingBrackets": "always",
             "editor.autoClosingQuotes": "always",
             "editor.autoSurround": "brackets"
        }
    }
},

ispc.configuration.json

代码语言:javascript
复制
{
    "comments": {
        "lineComment": "//",
        "blockComment": ["/*", "*/"]
    },

    "brackets": [
        ["{", "}"],
        ["[", "]"],
        ["(", ")"]
    ],

    "autoClosingPairs": [
        { "open": "[", "close": "]" },
        { "open": "{", "close": "}" },
        { "open": "(", "close": ")" },
        { "open": "'", "close": "'", "notIn": ["string", "comment"] },
        { "open": "\"", "close": "\"", "notIn": ["string"] }
    ],

    "surroundingPairs": [
        ["{", "}"],
        ["[", "]"],
        ["(", ")"],
        ["\"", "\""],
        ["'", "'"],
        ["<", ">"]
    ]
}
EN

回答 1

Stack Overflow用户

发布于 2018-10-12 06:03:04

我能够解决这个问题。我在配置文件名中有一个拼写错误。

代码语言:javascript
复制
"configuration": "./ispc.configuration.json"

应该是:

代码语言:javascript
复制
"configuration": "./ispc-configuration.json"

现在一切都像预期的那样工作。

票数 0
EN
页面原文内容由Stack Overflow提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://stackoverflow.com/questions/52751935

复制
相关文章

相似问题

领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档