最新国产好看的视频,伊人天堂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中定義了一些變量,在配置任務腳本時,可能會用到。本文以launch.json腳本為例,介紹各個變量的含義。

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

C:\Users\admin\Desktop\test

+.vscode

  ++tasks.json

  ++launch.json

+main.cpp

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

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

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

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

${fileBasenameNoExtension}:當前文件的文件名,不帶后綴,也即launch

${fileBasename}:當前文件的文件名,launch.json

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

${fileExtname}:當前文件的后綴,也即.json

${lineNumber}:當前文件光標所在的行號

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

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

總結(jié)

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

相關文章

最新評論

开封县| 保靖县| 曲阳县| 格尔木市| 襄汾县| 浙江省| 潞城市| 贵阳市| 洪泽县| 和硕县| 巴东县| 阿坝| 尖扎县| 淳安县| 大冶市| 延川县| 博爱县| 邓州市| 太康县| 平果县| 长宁县| 昆明市| 绥棱县| 威宁| 茶陵县| 沙洋县| 余江县| 兴国县| 开化县| 五家渠市| 丰县| 宁化县| 呼伦贝尔市| 胶州市| 白山市| 米林县| 稻城县| 常山县| 合水县| 诏安县| 桂平市|