VScode插件CommentTranslate在WSL内无效

VScode插件CommentTranslate在WSL内无效

参考

https://github.com/intellism/vscode-comment-translate/issues/64

  1. 找到相关语言语法规则文件。如C/CPP、bat、css、java、python,这些文件都是在Windows版本的VSCode中内置的,文件路径在 C:\Users\ **userNmae** \AppData\Local\Programs\Microsoft VS Code\resources\app\extensions改过安装路径的是Microsoft VS Code\resources\app\extensions

    image-20220811202401467

  1. 将语法规则的高亮规则文件夹拷贝到远程vscode的相关插件目录。以C语言为例,将cpp目录下的高亮规则文件夹syntaxes拷贝到远程C/C++插件(ms-vscode.cpptools-x.x.x)目录下。如果你使用SSH远程,远程插件的目录在~/.vscode-server/extensions/ms-vscode.cpptools-x.x.x

    image-20220811202845203

  2. 修改远程插件,添加语法高亮规则。修改远程插件的package.json文件,如C/C++插件(ms-vscode.cpptools-x.x.x)目录下的package.json文件,将刚才cpp语法规则文件夹中的package.json文件的”grammars“部分拷贝出来,粘贴到远程插件的package.jsoncontributes部分中去。

    如果遇到格式难以复制,可以全选内容然后按Shift+Alt+F格式化选定内容。image-20220811202944334

image-20220811203114753

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
"grammars": [
{
"language": "c",
"scopeName": "source.c",
"path": "./syntaxes/c.tmLanguage.json"
},
{
"language": "cpp",
"scopeName": "source.cpp.embedded.macro",
"path": "./syntaxes/cpp.embedded.macro.tmLanguage.json"
},
{
"language": "cpp",
"scopeName": "source.cpp",
"path": "./syntaxes/cpp.tmLanguage.json"
},
{
"scopeName": "source.c.platform",
"path": "./syntaxes/platform.tmLanguage.json"
},
{
"language": "cuda-cpp",
"scopeName": "source.cuda-cpp",
"path": "./syntaxes/cuda-cpp.tmLanguage.json"
}
],

VScode插件CommentTranslate在WSL内无效
https://www.oikiou.top/2022/1d3ed0f3/
作者
Oikiou
发布于
2022年8月10日
许可协议