我正在向VS Code添加ISPC (Intel SPMD Compiler)语言支持,但我遇到了一个问题。我无法让环绕声起作用。我已经将configurationDefaults添加到package.json的contributes部分,并添加了一个包含括号、autoClosingPairs和surroundingPairs部分的语言配置文件。
我还尝试了全局设置编辑器设置,但是,无论我做什么,所选内容都会被删除,并替换为括号/引号/注释字符。希望我只是做错了什么。提前感谢您的帮助。
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": [
["{", "}"],
["[", "]"],
["(", ")"],
["\"", "\""],
["'", "'"],
["<", ">"]
]
}发布于 2018-10-12 06:03:04
我能够解决这个问题。我在配置文件名中有一个拼写错误。
"configuration": "./ispc.configuration.json"应该是:
"configuration": "./ispc-configuration.json"现在一切都像预期的那样工作。
https://stackoverflow.com/questions/52751935
复制相似问题