Skip to content

Commit df58385

Browse files
committed
Refactor WorkspaceProvider to use modular architecture by moving token calculation logic to a separate module
1 parent b08919c commit df58385

34 files changed

Lines changed: 546 additions & 474 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
@@ -3,7 +3,7 @@ import * as path from 'path'
33
import {
44
WorkspaceProvider,
55
FileItem
6-
} from '../context/providers/workspace-provider'
6+
} from '../context/providers/workspace/workspace-provider'
77
import { natural_sort } from '../utils/natural-sort'
88

99
interface FileQuickPickItem extends vscode.QuickPickItem {

‎packages/vscode/src/commands/apply-chat-response-command/apply-chat-response-command.ts‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ import { FileInPreview } from '@shared/types/file-in-preview'
88
import { get_checkpoint_path } from '../checkpoints-command/utils'
99
import { PanelProvider } from '@/views/panel/backend/panel-provider'
1010
import { dictionary } from '@shared/constants/dictionary'
11-
import { WorkspaceProvider } from '@/context/providers/workspace-provider'
11+
import { WorkspaceProvider } from '@/context/providers/workspace/workspace-provider'
1212
import { response_preview_promise_resolve } from './utils/preview/preview'
1313
import { get_diff_stats } from './utils/preview/diff-utils'
1414
import { create_safe_path } from '@/utils/path-sanitizer'

‎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
@@ -1,5 +1,5 @@
11
import * as vscode from 'vscode'
2-
import { WorkspaceProvider } from '../../context/providers/workspace-provider'
2+
import { WorkspaceProvider } from '../../context/providers/workspace/workspace-provider'
33
import {
44
SAVED_CONTEXTS_STATE_KEY,
55
LAST_APPLY_CONTEXT_OPTION_STATE_KEY

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
import * as vscode from 'vscode'
22
import * as path from 'path'
33
import * as fs from 'fs'
4-
import { WorkspaceProvider } from '../../../context/providers/workspace-provider'
4+
import { WorkspaceProvider } from '../../../context/providers/workspace/workspace-provider'
55
import { LAST_SELECTED_FILE_CONTEXT_NAME_STATE_KEY } from '../../../constants/state-keys'
66
import { SavedContext } from '@/types/context'
77
import { Logger } from '@shared/utils/logger'

‎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
@@ -1,7 +1,7 @@
11
import * as vscode from 'vscode'
22
import * as path from 'path'
33
import * as fs from 'fs'
4-
import { WorkspaceProvider } from '../../../context/providers/workspace-provider'
4+
import { WorkspaceProvider } from '../../../context/providers/workspace/workspace-provider'
55
import { dictionary } from '@shared/constants/dictionary'
66
import { Logger } from '@shared/utils/logger'
77
import { display_token_count } from '../../../utils/display-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
@@ -1,5 +1,5 @@
11
import * as vscode from 'vscode'
2-
import { WorkspaceProvider } from '../../../context/providers/workspace-provider'
2+
import { WorkspaceProvider } from '../../../context/providers/workspace/workspace-provider'
33
import {
44
SAVED_CONTEXTS_STATE_KEY,
55
LAST_SELECTED_WORKSPACE_CONTEXT_NAME_STATE_KEY

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
import * as vscode from 'vscode'
22
import * as path from 'path'
3-
import { WorkspaceProvider } from '../../../context/providers/workspace-provider'
3+
import { WorkspaceProvider } from '../../../context/providers/workspace/workspace-provider'
44
import { LAST_CONTEXT_MERGE_REPLACE_OPTION_STATE_KEY } from '../../../constants/state-keys'
55
import { SavedContext } from '@/types/context'
66
import { Logger } from '@shared/utils/logger'

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
import * as path from 'path'
22
import * as fs from 'fs'
33
import * as glob from 'glob'
4-
import { WorkspaceProvider } from '../../../context/providers/workspace-provider'
4+
import { WorkspaceProvider } from '../../../context/providers/workspace/workspace-provider'
55
import { Logger } from '@shared/utils/logger'
66

77
export async function resolve_glob_patterns(

‎packages/vscode/src/commands/check-parent-folder-command.ts‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ import * as path from 'path'
33
import {
44
WorkspaceProvider,
55
FileItem
6-
} from '../context/providers/workspace-provider'
6+
} from '../context/providers/workspace/workspace-provider'
77

88
export const check_parent_folder_command = (
99
workspace_provider: WorkspaceProvider

‎packages/vscode/src/commands/checkpoints-command/actions/create-checkpoint.ts‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ import {
44
TEMPORARY_CHECKPOINT_STATE_KEY,
55
CHECKPOINT_OPERATION_IN_PROGRESS_STATE_KEY
66
} from '../../../constants/state-keys'
7-
import { WorkspaceProvider } from '../../../context/providers/workspace-provider'
7+
import { WorkspaceProvider } from '../../../context/providers/workspace/workspace-provider'
88
import type { Checkpoint, CheckpointTab } from '../types'
99
import { get_checkpoints } from './get-checkpoints'
1010
import {

0 commit comments

Comments
 (0)