Skip to content

Commit 0f3eb8b

Browse files
committed
Standardize method naming by replacing getWorkspaceRoots with get_workspace_roots and update all references
1 parent 0a984af commit 0f3eb8b

20 files changed

Lines changed: 26 additions & 28 deletions

‎packages/vscode/src/commands/add-file-to-context-command.ts‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ export const add_file_to_context_command = (
1616
return vscode.commands.registerCommand(
1717
'codeWebChat.addFileToContext',
1818
async () => {
19-
const workspace_roots = workspace_provider.getWorkspaceRoots()
19+
const workspace_roots = workspace_provider.get_workspace_roots()
2020
if (workspace_roots.length === 0) {
2121
return
2222
}

‎packages/vscode/src/commands/apply-context-command/apply-context-command.ts‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,7 @@ export const apply_context_command = (
4444
return
4545
}
4646

47-
const workspace_root = workspace_provider.getWorkspaceRoot()
47+
const workspace_root = workspace_provider.get_workspace_roots()[0]
4848
if (!workspace_root) {
4949
vscode.window.showErrorMessage(
5050
dictionary.error_message.NO_WORKSPACE_ROOT

‎packages/vscode/src/commands/apply-context-command/helpers/applying/resolve-glob-patterns.ts‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ export const resolve_glob_patterns = async (
1010
): Promise<string[]> => {
1111
const all_files_in_cache = new Set<string>()
1212

13-
for (const root of workspace_provider.getWorkspaceRoots()) {
13+
for (const root of workspace_provider.get_workspace_roots()) {
1414
const files = await workspace_provider.find_all_files(root)
1515
files.forEach((file) => all_files_in_cache.add(file))
1616
}

‎packages/vscode/src/commands/apply-context-command/helpers/saving/handle-quick-save.ts‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ export const handle_quick_save = async (
2222
const existing = quick_saves[slot]
2323

2424
if (existing) {
25-
const primary_workspace_root = workspace_provider.getWorkspaceRoot()!
25+
const primary_workspace_root = workspace_provider.get_workspace_roots()[0]!
2626
await apply_saved_context(
2727
existing,
2828
primary_workspace_root,

‎packages/vscode/src/commands/apply-context-command/sources/json-file-source.ts‎

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -352,7 +352,8 @@ export const handle_json_file_source = async (
352352
}
353353

354354
if (selection.context) {
355-
const primary_workspace_root = workspace_provider.getWorkspaceRoot()!
355+
const primary_workspace_root =
356+
workspace_provider.get_workspace_roots()[0]!
356357
await apply_saved_context(
357358
selection.context,
358359
primary_workspace_root,

‎packages/vscode/src/commands/apply-context-command/sources/unstaged-files-source.ts‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -61,7 +61,7 @@ export const handle_unstaged_files_source = async (
6161
return
6262
}
6363

64-
const workspace_roots = workspace_provider.getWorkspaceRoots()
64+
const workspace_roots = workspace_provider.get_workspace_roots()
6565
const quick_pick_items = await Promise.all(
6666
existing_unstaged_files.map(async (file_path) => {
6767
const token_count =

‎packages/vscode/src/commands/apply-context-command/sources/workspace-state-source.ts‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@ export const handle_workspace_state_source = async (
2424
on_context_selected: () => void
2525
): Promise<'back' | void> => {
2626
try {
27-
const workspace_root = workspace_provider.getWorkspaceRoot()
27+
const workspace_root = workspace_provider.get_workspace_roots()[0]
2828
if (!workspace_root) {
2929
vscode.window.showErrorMessage(dictionary.error_message.NO_WORKSPACE_ROOT)
3030
return

‎packages/vscode/src/commands/find-paths-in-clipboard-command/find-paths-in-clipboard-command.ts‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,7 @@ export function find_paths_in_clipboard_command(
3636
return
3737
}
3838

39-
const workspace_roots = workspace_provider.getWorkspaceRoots()
39+
const workspace_roots = workspace_provider.get_workspace_roots()
4040
const absolute_paths: string[] = []
4141

4242
const workspace_map = new Map<string, string>()

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -45,7 +45,7 @@ export const reference_in_prompt_command = (params: {
4545

4646
let relative_path = path.relative(workspace_root, file_path)
4747

48-
if (params.workspace_provider.getWorkspaceRoots().length > 1) {
48+
if (params.workspace_provider.get_workspace_roots().length > 1) {
4949
const workspace_name =
5050
params.workspace_provider.get_workspace_name(workspace_root)
5151
relative_path = path.join(workspace_name, relative_path)

‎packages/vscode/src/commands/remove-file-from-context-command.ts‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ export const remove_file_from_context_command = (
2323
return
2424
}
2525

26-
const workspace_roots = workspace_provider.getWorkspaceRoots()
26+
const workspace_roots = workspace_provider.get_workspace_roots()
2727
let files_to_show = current_checked
2828
let show_workspace_prefix = workspace_roots.length > 1
2929

0 commit comments

Comments
 (0)