当前位置:网站首页>VS Code `launch. Json` and `task Predefined variables available in json`
VS Code `launch. Json` and `task Predefined variables available in json`
2022-06-09 04:03:00 【Boy Baoding】
brief introduction
VS Code Debuging The configuration file 、Task Variable substitution is supported in the configuration file and some optional settings ,VS Code Variables that support variable substitution in key:value Formal definition , And key and value All strings . stay launch.json and task.json Variable substitution is often used in , The syntax used by variables is : ${variableName} .
Official documents : variables-reference
Predefined variables
VS Code The following variables are predefined :
Suppose that VS Code The file is opened in the editor /home/your-username/your-project/folder/file.ext, Catalog /home/your-username/your-project stay VS Code Open in the root directory of . In this case , The values of the predefined variables are as follows :
- ${userHome}: Current user home directory of the system
A variable's value : /home/your-username
- ${workspaceFolder}:VS Code Currently open folder path
A variable's value : /home/your-username/your-project
- ${workspaceFolderBasename}:VS Code Name of the currently open folder
A variable's value : your-project
- ${file}: VS Code Currently open file path
A variable's value : /home/your-username/your-project/folder/file.ext
- ${fileWorkspaceFolder}: VS Code The absolute path of the currently open folder
A variable's value : /home/your-username/your-project
- ${relativeFile}: be relative to ${workspaceFolder} , The relative path of the currently open file in the editor
A variable's value : folder/file.ext
- ${relativeFileDirname}: be relative to ${workspaceFolder}, The name of the folder where the currently open file is located in the editor
A variable's value : folder
- ${fileBasename}: Edit the current file name opened in , With suffix
A variable's value : file.ext
- ${fileBasenameNoExtension}: Edit the current file name opened in , No suffix
A variable's value : file
- ${fileDirname}: The absolute path of the folder where the currently open file is located in the editor
A variable's value : /home/your-username/your-project/folder
- ${fileExtname}: The suffix of the currently open file in the editor
A variable's value : .ext
- ${cwd}:the task runner’s current working directory upon the startup of VS Code
A variable's value :-
- ${lineNumber}:the current selected line number in the active file
A variable's value : -
- ${selectedText}: The text currently selected in the active state file with the editor open
A variable's value : The currently selected text
- ${execPath}:Code.exe/code The absolute path of the executable program
A variable's value : Code.exe/code The absolute path of the executable program (location of Code.exe)
- ${defaultBuildTask}:the name of the default build task
A variable's value :the name of the default build task
- ${pathSeparator}:the character used by the operating system to separate components in file paths
A variable's value : / on macOS or linux, \ on Windows
Tip: stay tasks.json and launch.json Use predefined variables in ,VS Code intellisense (IntelliSense) A list of predefined variables will be provided dynamically .
Refer to the official documentation for more variables : variables-reference
边栏推荐
- Solve the problem that the MySQL library or table is stuck during deletion and other operations
- ACM教程 - 希尔排序
- TypeScript的泛型和装饰器
- After 15000 interns joined Amazon, what was life like in the big factory?
- 测试网站搭建+渗透+审计之第一篇使用IDEA启动网站
- OnlineJudge使用说明
- 测试网站搭建+渗透+审计之第三篇Swagger接口渗透测试
- Wwdc2022 interesting news Apple released the free weather API weatherkit
- 域名解析(公网)
- JS逆向字体反爬,某供应商平台反爬实践
猜你喜欢

1264_FreeRTOS任务的初始化以及堆栈初始化处理分析

《Attention-ocr-Chinese-Version-mas # ter》代码运行逻辑

Internet winter? How software testers go against the trend to enter high paid factories

ACM tutorial - Hill sort

Pdf splitting based on pyqt5

Attention OCR Chinese version mas # ter Code Running Logic

Final assignment of Web Design - scenic spot tourism website (including navigation bar, rotation map, exquisite style)

网页设计期末大作业-景点旅游网站(含导航栏,轮播图,样式精美)

Graph to document function based on pyqt5

在线JSON转XML工具
随机推荐
Generics and decorators for typescript
[examination in May] Oracle OCP 19C passed
Assembly: JMP instructions
JS reverse font reverse crawling, a supplier platform reverse crawling practice
基于PyQt5完成的图转文功能
Today in history: kubernetes open source version released; Worldofwarcraft landed in China; The inventor of packet switching network was born
Online Morse code online translation and conversion tool
Winform UI界面设计例程——自定义控件progressBar
基於FPGA的VGA顯示彩條、字符、圖片
解决MYSQL库or表进行删除等操作时出现卡死等情况
月薪近万,3年销售助理转行测试,0经验的我如何拿到多份offer?
On June 12, MSG enterprise bank focused on Langfang AI enterprises to promote the integrated development of "double chain"
带团队,你的老板“独断专行”吗?(深有感触)
The talent gap is more than 500000, and the average salary is 20K? Network security, the next outlet for testers~
用户控制 键盘鼠标自定义 脚本
OnlineJudge使用说明
Interface performance test: Web service interface test
Internet winter? How software testers go against the trend to enter high paid factories
基于OpenCV的人脸检测、训练、识别
知识点滴- BC和BCE的区别