Warning: file_get_contents(/data/phpspider/zhask/data//catemap/8/visual-studio-code/3.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Batch file 如何在VS代码中将切换注释从@REM更改为REM_Batch File_Visual Studio Code - Fatal编程技术网

Batch file 如何在VS代码中将切换注释从@REM更改为REM

Batch file 如何在VS代码中将切换注释从@REM更改为REM,batch-file,visual-studio-code,Batch File,Visual Studio Code,在VS代码中,当我使用Ctrl+/切换注释时,它会使用@REM注释行。如何更改此选项以仅用REM注释行?在VSCode安装文件夹的\resources\app\extensions\bat文件夹中,有一个名为language configuration.json的文件。在文件的最开始,有一个 {"comments":{"lineComment":"@REM"} 将此更改为 {"comments":{"li

在VS代码中,当我使用Ctrl+/切换注释时,它会使用
@REM
注释行。如何更改此选项以仅用
REM
注释行?

在VSCode安装文件夹的
\resources\app\extensions\bat
文件夹中,有一个名为
language configuration.json
的文件。在文件的最开始,有一个

{"comments":{"lineComment":"@REM"}
将此更改为

{"comments":{"lineComment":"REM"}

(请注意,如果VSCode更新,您必须再次更改此文件。)

请查看我刚刚发布的扩展名。在这里,它正在为
.bat
批处理文件
lineComments
执行您想要的操作:

它使更改一种或多种语言的注释或括号变得非常容易。通过如下设置:

  "custom-language-properties": {

    "bat.comments.lineComment": "REM",
    "python.comments.lineComment": "# ~",
    "javascript.comments.blockComment": ["/*  ","  */"]
 }

谢谢更改文件,然后重新启动VS Code后,此操作生效。Rem批处理文件中的标记不应echo发送给最终用户,它们是供源代码的查看者使用的<因此,code>@REM是最适合使用的字符串,因为它确保那些
REM
标记永远不会
echo
ed,无论
echo
状态是
on
还是
off