vault backup: 2025-10-22 16:41:08
Affected files: 22.01. 軟體工具、設定/copilot/Prompt Variable.md
This commit is contained in:
29
22.01. 軟體工具、設定/copilot/Prompt Variable.md
Normal file
29
22.01. 軟體工具、設定/copilot/Prompt Variable.md
Normal file
@@ -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)
|
||||||
Reference in New Issue
Block a user