欧美bbbwbbbw肥妇,免费乱码人妻系列日韩,一级黄片

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

 更新時間:2020年03月20日 11:32:31   作者:bat67  
這篇文章主要介紹了關(guān)于VSCode tasks.json中的各種替換變量的意思 ${workspaceFolder} ${file} ${fileBasename} ${fileDirname}等,本文給大家介紹的非常詳細(xì),對大家的學(xué)習(xí)或工作具有參考借鑒價值,需要的朋友可以參考下

When authoring tasks configurations, it is often useful to have a set of predefined common variables. VS Code supports variable substitution inside strings in the tasks.json file and has the following predefined variables:

  • ${workspaceFolder} the path of the workspace folder that contains the tasks.json file
  • ${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 the workspace folder containing the file
  • ${fileBasename} the current opened file's basename
  • ${fileBasenameNoExtension} the current opened file's basename without the 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} (for example, ${env:PATH}). Be sure to match the environment variable name's casing, for example ${env:Path} on Windows.

Below is an example of a custom task configuration that passes the current opened file to the TypeScript compiler.

{
  "taskName": "TypeScript compile",
  "type": "shell",
  "command": "tsc ${file}",
  "problemMatcher": [
    "$tsc"
  ]
}

部分翻譯:(來自互聯(lián)網(wǎng))

${workspaceRoot} 當(dāng)前打開的文件夾的絕對路徑+文件夾的名字

            ${workspaceRootFolderName}   當(dāng)前打開的文件夾的名字

    ${file}當(dāng)前打開正在編輯的文件名,包括絕對路徑,文件名,文件后綴名

${relativeFile}從當(dāng)前打開的文件夾到當(dāng)前打開的文件的路徑

如 當(dāng)前打開的是test文件夾,當(dāng)前的打開的是main.c,并有test / first / second / main.c

那么此變量代表的是  first / second / main.c

${fileBasename}  當(dāng)前打開的文件名+后綴名,不包括路徑

${fileBasenameNoExtension} 當(dāng)前打開的文件的文件名,不包括路徑和后綴名

${fileDirname} 當(dāng)前打開的文件所在的絕對路徑,不包括文件名

${fileExtname} 當(dāng)前打開的文件的后綴名

${cwd} the task runner's current working directory on startup

不知道怎么描述,這是原文解釋,

跟 cmd 里面的 cwd 是一樣的

${lineNumber}  當(dāng)前打開的文件,光標(biāo)所在的行數(shù)

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

總結(jié)

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

相關(guān)文章

  • C語言中有哪些字符處理函數(shù)你知道嗎

    C語言中有哪些字符處理函數(shù)你知道嗎

    這篇文章主要為大家詳細(xì)介紹了C語言字符處理函數(shù),文中示例代碼介紹的非常詳細(xì),具有一定的參考價值,感興趣的小伙伴們可以參考一下,希望能夠給你帶來幫助
    2022-03-03
  • C語言實現(xiàn)簡單圖書管理系統(tǒng)

    C語言實現(xiàn)簡單圖書管理系統(tǒng)

    這篇文章主要為大家詳細(xì)介紹了C語言實現(xiàn)圖書管理系統(tǒng),文中示例代碼介紹的非常詳細(xì),具有一定的參考價值,感興趣的小伙伴們可以參考一下
    2018-01-01
  • 在C++中實現(xiàn)aligned_malloc的方法

    在C++中實現(xiàn)aligned_malloc的方法

    這篇文章主要介紹了在C++中實現(xiàn)aligned_malloc的方法,本文給大家介紹的非常詳細(xì),對大家的學(xué)習(xí)或工作具有一定的參考借鑒價值,需要的朋友可以參考下
    2021-03-03
  • C語言驅(qū)動開發(fā)之內(nèi)核通過PEB獲取進(jìn)程參數(shù)

    C語言驅(qū)動開發(fā)之內(nèi)核通過PEB獲取進(jìn)程參數(shù)

    PEB結(jié)構(gòu)(Process Envirorment Block Structure)其中文名是進(jìn)程環(huán)境塊信息。本文將通過PEB實現(xiàn)獲取進(jìn)程參數(shù),感興趣的小伙伴可以了解一下
    2022-10-10
  • C語言中調(diào)用Swift函數(shù)實例詳解

    C語言中調(diào)用Swift函數(shù)實例詳解

    這篇文章主要介紹了C語言中調(diào)用Swift函數(shù)實例詳解的相關(guān)資料,實現(xiàn)該功能可以通過定義全局的指向Blocks的對象指針來實現(xiàn),需要的朋友可以參考下
    2017-07-07
  • C++實現(xiàn)神經(jīng)BP神經(jīng)網(wǎng)絡(luò)

    C++實現(xiàn)神經(jīng)BP神經(jīng)網(wǎng)絡(luò)

    這篇文章主要為大家詳細(xì)介紹了C++實現(xiàn)神經(jīng)BP神經(jīng)網(wǎng)絡(luò),文中示例代碼介紹的非常詳細(xì),具有一定的參考價值,感興趣的小伙伴們可以參考一下
    2020-05-05
  • VC動態(tài)生成菜單項的實現(xiàn)方法

    VC動態(tài)生成菜單項的實現(xiàn)方法

    這篇文章主要介紹了VC動態(tài)生成菜單項的實現(xiàn)方法,在桌面應(yīng)用程序開發(fā)中常會用到的一個功能,需要的朋友可以參考下
    2014-08-08
  • C++?OpenCV技術(shù)實戰(zhàn)之身份證離線識別

    C++?OpenCV技術(shù)實戰(zhàn)之身份證離線識別

    OpenCV身份證離線識別技術(shù)的主要技術(shù)就是通過OpenCV找到身份證號碼區(qū)域,然后通過OCR進(jìn)行數(shù)字識別該區(qū)域的截圖即可得到身份證號碼。感興趣的可以了解一下
    2021-12-12
  • OpenGL實現(xiàn)不規(guī)則區(qū)域填充算法

    OpenGL實現(xiàn)不規(guī)則區(qū)域填充算法

    這篇文章主要為大家詳細(xì)介紹了OpenGL實現(xiàn)不規(guī)則區(qū)域填充算法,文中示例代碼介紹的非常詳細(xì),具有一定的參考價值,感興趣的小伙伴們可以參考一下
    2020-02-02
  • C++順序容器(vector、deque、list)的使用詳解

    C++順序容器(vector、deque、list)的使用詳解

    本文主要介紹了C++順序容器(vector、deque、list)的使用詳解,文中通過示例代碼介紹的非常詳細(xì),對大家的學(xué)習(xí)或者工作具有一定的參考學(xué)習(xí)價值,需要的朋友們下面隨著小編來一起學(xué)習(xí)學(xué)習(xí)吧
    2022-06-06

最新評論