Skip to content

Commit 6141100

Browse files
committed
Include workspace name in file references for multi-root workspaces
1 parent 8f4a670 commit 6141100

1 file changed

Lines changed: 8 additions & 1 deletion

File tree

‎packages/vscode/src/commands/reference-in-prompt-command.ts‎

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,14 @@ export const reference_in_prompt_command = (params: {
4343
)
4444
}
4545

46-
const relative_path = path.relative(workspace_root, file_path)
46+
let relative_path = path.relative(workspace_root, file_path)
47+
48+
if (params.workspace_provider.getWorkspaceRoots().length > 1) {
49+
const workspace_name =
50+
params.workspace_provider.get_workspace_name(workspace_root)
51+
relative_path = path.join(workspace_name, relative_path)
52+
}
53+
4754
const reference_text = `\`${relative_path}\``
4855

4956
params.panel_provider.add_text_at_cursor_position(reference_text)

0 commit comments

Comments
 (0)