6
2

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?

More than 3 years have passed since last update.

VSCode デバッグの設定等で使用する定義済み変数のリスト

Last updated at Posted at 2020-12-02

変数リファレンス

Visual Studio Codeは、デバッグおよびタスク構成ファイルの変数置換と、いくつかの選択設定をサポートしています。
変数置換は、$ {variableName}構文を使用して、launch.jsonファイルとtasks.jsonファイルのキー文字列と値文字列内でサポートされています。

定義済み変数のリスト

変数名 説明
${workspaceFolder} the path of the folder opened in VS Code
${workspaceFolderBasename} the name of the folder opened in VS Code without any slashes (/)
${file} the current opened file
${relativeFile} the current opened file relative to workspaceFolder
${relativeFileDirname} the current opened file's dirname relative to workspaceFolder
${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
${selectedText} the current selected text in the active file
${execPath} the path to the running VS Code executable
${defaultBuildTask} the name of the default build task

変数名
${workspaceFolder} /home/your-username/your-project
${workspaceFolderBasename} your-project
${file} /home/your-username/your-project/folder/file.ext
${relativeFile} folder/file.ext
${relativeFileDirname} folder
${fileBasename} file.ext
${fileBasenameNoExtension} file
${fileDirname} /home/your-username/your-project/folder
${fileExtname} .ext
${lineNumber} line number of the cursor
${selectedText} text selected in your code editor
${execPath} location of Code.exe

参考

Visual Studio Code Variables Reference

6
2
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
6
2

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?