From 9412abbd192855184efc329e120ec465654effc0 Mon Sep 17 00:00:00 2001 From: Awin Huang Date: Wed, 22 Oct 2025 16:41:08 +0800 Subject: [PATCH] vault backup: 2025-10-22 16:41:08 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Affected files: 22.01. 軟體工具、設定/copilot/Prompt Variable.md --- .../copilot/Prompt Variable.md | 29 +++++++++++++++++++ 1 file changed, 29 insertions(+) create mode 100644 22.01. 軟體工具、設定/copilot/Prompt Variable.md diff --git a/22.01. 軟體工具、設定/copilot/Prompt Variable.md b/22.01. 軟體工具、設定/copilot/Prompt Variable.md new file mode 100644 index 0000000..5928b3a --- /dev/null +++ b/22.01. 軟體工具、設定/copilot/Prompt Variable.md @@ -0,0 +1,29 @@ +--- +tags: +aliases: +date: 2025-10-22 +time: 16:37:25 +description: +--- + +- **Syntax:**  + You reference variables using the `${variableName}` syntax within the prompt file. + +- **Types of Variables:** + - **Workspace Variables:** + - `${workspaceFolder}`: The absolute path to the root of the current workspace. + - `${workspaceFolderBasename}`: The name of the workspace folder. + - **Selection Variables:** + - `${selection}`: The currently selected text in the active editor. + - `${selectedText}`: Another way to refer to the currently selected text. + - **File Context Variables:** + - `${file}`: The absolute path to the currently active file. + - `${fileBasename}`: The name of the active file, including its extension. + - `${fileDirname}`: The directory name of the active file. + - `${fileBasenameNoExtension}`: The name of the active file without its extension. + - **Input Variables:** + - `${input:variableName}`: Prompts the user to enter a value for the specified `variableName` when the prompt is run. + - `${input:variableName:placeholder}`: Similar to the above, but includes a placeholder text within the input field. + +# 參考來源 +- [variable in copilot prompt file](https://www.google.com/search?q=variable+in+copilot+prompt+file&rlz=1C1GCEA_enTW1166TW1166&oq=variable+in+copilot+prompt+file&gs_lcrp=EgZjaHJvbWUyBggAEEUYOTIHCAEQIRigATIHCAIQIRigAdIBCTEwNDY2ajBqNKgCALACAQ&sourceid=chrome&ie=UTF-8) \ No newline at end of file