最新国产好看的视频,伊人天堂AV在线,国产Aaaaaa视频,蜜臀视频在线观看一区,人妻av色图,密臀久久久精品影片,青青视频免费观看毛片,久草在线观看视,国产三级精品色情在线

淺析VSCode launch.json中的各種替換變量的意思 ${workspaceFolder} ${file} ${fileBasename} ${fileDirname}等

 更新時間:2020年03月20日 11:32:48   作者:bat67  
這篇文章主要介紹了VSCode launch.json中的各種替換變量的意思 ${workspaceFolder} ${file} ${fileBasename} ${fileDirname}等,非常不錯具有一定的參考借鑒價值,需要的朋友可以參考下

VS Code supports variable substitution inside strings in launch.json and has the following predefined variables:

  • ${workspaceFolder} - the path of the folder opened in VS Code
  • ${workspaceRootFolderName} - the name of the folder opened in VS Code without any slashes (/)
  • ${file} - the current opened file
  • ${relativeFile} - the current opened file relative to workspaceRoot
  • ${fileBasename} - the current opened file's basename
  • ${fileBasenameNoExtension} - the current opened file's basename with no file extension
  • ${fileDirname} - the current opened file's dirname
  • ${fileExtname} - the current opened file's extension
  • ${cwd} - the task runner's current working directory on startup
  • ${lineNumber} - the current selected line number in the active file

You can also reference environment variables through ${env:Name} syntax (for example, ${env:PATH}). Be sure to match the environment variable name's casing, for example ${env:Path} on Windows.

{
 "type": "node",
 "request": "launch",
 "name": "Launch Program",
 "program": "${workspaceFolder}/app.js",
 "cwd": "${workspaceFolder}",
 "args": [ "${env:USERNAME}" ]
}

You can reference VS Code settings and commands using the following syntax:

  • ${config:Name} - example: ${config:editor.fontSize}
  • ${command:CommandID} - example: ${command:explorer.newFolder}

在vscode中定義了一些變量,在配置任務(wù)腳本時,可能會用到。本文以launch.json腳本為例,介紹各個變量的含義。

假設(shè)當(dāng)前workspace的路徑為:"C:\Users\admin\Desktop\test",workspace文件夾下的結(jié)構(gòu)如下(+表示下一層):

C:\Users\admin\Desktop\test

+.vscode

  ++tasks.json

  ++launch.json

+main.cpp

${workspaceFolder} :表示當(dāng)前workspace文件夾路徑,也即C:\Users\admin\Desktop\test

${workspaceRootFolderName}:表示workspace的文件夾名,也即test

${file}:文件自身的絕對路徑,也即C:\Users\admin\Desktop\test\.vscode\launch.json

${relativeFile}:文件在workspace中的路徑,也即.vscode\launch.json

${fileBasenameNoExtension}:當(dāng)前文件的文件名,不帶后綴,也即launch

${fileBasename}:當(dāng)前文件的文件名,launch.json

${fileDirname}:文件所在的文件夾路徑,也即C:\Users\admin\Desktop\test\.vscode

${fileExtname}:當(dāng)前文件的后綴,也即.json

${lineNumber}:當(dāng)前文件光標(biāo)所在的行號

${env:PATH}:系統(tǒng)中的環(huán)境變量

更新一個鏈接:https://code.visualstudio.com/docs/editor/variables-reference

總結(jié)

到此這篇關(guān)于VSCode launch.json中的各種替換變量的意思 ${workspaceFolder} ${file} ${fileBasename} ${fileDirname}等的文章就介紹到這了,更多相關(guān)VSCode launch.json 替換變量內(nèi)容請搜索腳本之家以前的文章或繼續(xù)瀏覽下面的相關(guān)文章希望大家以后多多支持腳本之家!

相關(guān)文章

最新評論

德清县| 太保市| 长子县| 息烽县| 固原市| 哈尔滨市| 洛阳市| 故城县| 石台县| 花莲县| 金寨县| 万全县| 南宁市| 瓦房店市| 巴南区| 涪陵区| 高台县| 太康县| 绥滨县| 竹溪县| 塘沽区| 庆元县| 东山县| 离岛区| 武冈市| 德惠市| 鄄城县| 镇沅| 望都县| 汉沽区| 巴中市| 泰宁县| 乐都县| 石阡县| 卫辉市| 霍州市| 江源县| 伊川县| 扎兰屯市| 阜阳市| 磐安县|