【发布时间】:2018-10-11 03:54:15
【问题描述】:
我正在向 VS Code 添加 ISPC(英特尔 SPMD 编译器)语言支持,但遇到了问题。我无法让环绕声工作。我已将 configurationDefaults 添加到 package.json 中的贡献部分,并添加了一个包含括号、autoClosingPairs 和aroundPairs 部分的语言配置文件。
我也尝试过全局设置编辑器设置,但是无论我做什么,选择都会被删除并替换为括号/引号/注释字符。希望我只是在这里做错了什么。提前感谢您的帮助。
vscode 版本 - 1.28.0
package.json
"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
{
"comments": {
"lineComment": "//",
"blockComment": ["/*", "*/"]
},
"brackets": [
["{", "}"],
["[", "]"],
["(", ")"]
],
"autoClosingPairs": [
{ "open": "[", "close": "]" },
{ "open": "{", "close": "}" },
{ "open": "(", "close": ")" },
{ "open": "'", "close": "'", "notIn": ["string", "comment"] },
{ "open": "\"", "close": "\"", "notIn": ["string"] }
],
"surroundingPairs": [
["{", "}"],
["[", "]"],
["(", ")"],
["\"", "\""],
["'", "'"],
["<", ">"]
]
}
【问题讨论】:
标签: visual-studio-code vscode-extensions