@theia/ai-ide 1.77.0-next.7 → 1.77.0-next.71
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/lib/browser/{project-info-agent.d.ts → agents-md-agent.d.ts} +2 -2
- package/lib/browser/agents-md-agent.d.ts.map +1 -0
- package/lib/browser/{project-info-agent.js → agents-md-agent.js} +16 -15
- package/lib/browser/agents-md-agent.js.map +1 -0
- package/lib/browser/ai-configuration/ai-configuration-label-provider-contribution.js +1 -1
- package/lib/browser/ai-configuration/ai-configuration-label-provider-contribution.js.map +1 -1
- package/lib/browser/ai-configuration/ai-configuration-resource.js +2 -1
- package/lib/browser/ai-configuration/ai-configuration-resource.js.map +1 -1
- package/lib/browser/ai-configuration/ai-configuration-search-widget.js +1 -1
- package/lib/browser/ai-configuration/ai-configuration-search-widget.js.map +1 -1
- package/lib/browser/ai-configuration/categories/agent-capabilities-settings.d.ts +11 -3
- package/lib/browser/ai-configuration/categories/agent-capabilities-settings.d.ts.map +1 -1
- package/lib/browser/ai-configuration/categories/agent-capabilities-settings.js +64 -29
- package/lib/browser/ai-configuration/categories/agent-capabilities-settings.js.map +1 -1
- package/lib/browser/ai-configuration/categories/agent-capabilities-settings.spec.js +480 -1
- package/lib/browser/ai-configuration/categories/agent-capabilities-settings.spec.js.map +1 -1
- package/lib/browser/ai-configuration/categories/agent-detail-model.d.ts +10 -0
- package/lib/browser/ai-configuration/categories/agent-detail-model.d.ts.map +1 -1
- package/lib/browser/ai-configuration/categories/agent-detail-model.js +8 -0
- package/lib/browser/ai-configuration/categories/agent-detail-model.js.map +1 -1
- package/lib/browser/ai-configuration/categories/agent-detail-model.spec.d.ts +2 -0
- package/lib/browser/ai-configuration/categories/agent-detail-model.spec.d.ts.map +1 -0
- package/lib/browser/ai-configuration/categories/agent-detail-model.spec.js +74 -0
- package/lib/browser/ai-configuration/categories/agent-detail-model.spec.js.map +1 -0
- package/lib/browser/ai-configuration/categories/agent-detail-view.d.ts.map +1 -1
- package/lib/browser/ai-configuration/categories/agent-detail-view.js +3 -2
- package/lib/browser/ai-configuration/categories/agent-detail-view.js.map +1 -1
- package/lib/browser/ai-configuration/categories/agents-configuration-category.d.ts +6 -1
- package/lib/browser/ai-configuration/categories/agents-configuration-category.d.ts.map +1 -1
- package/lib/browser/ai-configuration/categories/agents-configuration-category.js +20 -2
- package/lib/browser/ai-configuration/categories/agents-configuration-category.js.map +1 -1
- package/lib/browser/ai-configuration/categories/provider-model-discovery-section.js +5 -4
- package/lib/browser/ai-configuration/categories/provider-model-discovery-section.js.map +1 -1
- package/lib/browser/ai-configuration/categories/provider-model-discovery-section.spec.js +2 -1
- package/lib/browser/ai-configuration/categories/provider-model-discovery-section.spec.js.map +1 -1
- package/lib/browser/ai-configuration/categories/token-usage-configuration-category.js +2 -2
- package/lib/browser/ai-configuration/categories/token-usage-configuration-category.js.map +1 -1
- package/lib/browser/ai-configuration/categories/tools-configuration-category.js +1 -1
- package/lib/browser/ai-configuration/categories/tools-configuration-category.js.map +1 -1
- package/lib/browser/ai-configuration/categories/variables-configuration-category.js +1 -1
- package/lib/browser/ai-configuration/categories/variables-configuration-category.js.map +1 -1
- package/lib/browser/ai-configuration/language-model-renderer.d.ts.map +1 -1
- package/lib/browser/ai-configuration/language-model-renderer.js +8 -15
- package/lib/browser/ai-configuration/language-model-renderer.js.map +1 -1
- package/lib/browser/ai-configuration/language-model-renderer.spec.js +40 -1
- package/lib/browser/ai-configuration/language-model-renderer.spec.js.map +1 -1
- package/lib/browser/ai-sessions-widget.js +1 -1
- package/lib/browser/ai-sessions-widget.js.map +1 -1
- package/lib/browser/app-tester-prompt-template.d.ts.map +1 -1
- package/lib/browser/app-tester-prompt-template.js +4 -6
- package/lib/browser/app-tester-prompt-template.js.map +1 -1
- package/lib/browser/architect-prompt-template.d.ts.map +1 -1
- package/lib/browser/architect-prompt-template.js +20 -3
- package/lib/browser/architect-prompt-template.js.map +1 -1
- package/lib/browser/chat-session-item.js +2 -1
- package/lib/browser/chat-session-item.js.map +1 -1
- package/lib/browser/chat-sessions-welcome-message-provider.js +1 -1
- package/lib/browser/chat-sessions-welcome-message-provider.js.map +1 -1
- package/lib/browser/code-reviewer-prompt-template.d.ts.map +1 -1
- package/lib/browser/code-reviewer-prompt-template.js +2 -1
- package/lib/browser/code-reviewer-prompt-template.js.map +1 -1
- package/lib/browser/commit-message-agent.spec.js +2 -1
- package/lib/browser/commit-message-agent.spec.js.map +1 -1
- package/lib/browser/commit-message-runner.spec.js +2 -1
- package/lib/browser/commit-message-runner.spec.js.map +1 -1
- package/lib/browser/context-file-validation-service-impl.spec.js +2 -1
- package/lib/browser/context-file-validation-service-impl.spec.js.map +1 -1
- package/lib/browser/explore-prompt-template.d.ts.map +1 -1
- package/lib/browser/explore-prompt-template.js +2 -1
- package/lib/browser/explore-prompt-template.js.map +1 -1
- package/lib/browser/file-changeset-functions.d.ts +3 -1
- package/lib/browser/file-changeset-functions.d.ts.map +1 -1
- package/lib/browser/file-changeset-functions.js +60 -6
- package/lib/browser/file-changeset-functions.js.map +1 -1
- package/lib/browser/file-changeset-functions.spec.js +73 -9
- package/lib/browser/file-changeset-functions.spec.js.map +1 -1
- package/lib/browser/frontend-module.js +4 -4
- package/lib/browser/frontend-module.js.map +1 -1
- package/lib/browser/git-changes-tool.d.ts +3 -3
- package/lib/browser/git-changes-tool.d.ts.map +1 -1
- package/lib/browser/git-changes-tool.js +7 -11
- package/lib/browser/git-changes-tool.js.map +1 -1
- package/lib/browser/git-changes-tool.spec.js +16 -3
- package/lib/browser/git-changes-tool.spec.js.map +1 -1
- package/lib/browser/multi-root-paths.spec.d.ts +2 -0
- package/lib/browser/multi-root-paths.spec.d.ts.map +1 -0
- package/lib/browser/multi-root-paths.spec.js +293 -0
- package/lib/browser/multi-root-paths.spec.js.map +1 -0
- package/lib/browser/remember-command-contribution.d.ts +2 -2
- package/lib/browser/remember-command-contribution.js +6 -6
- package/lib/browser/remember-command-contribution.js.map +1 -1
- package/lib/browser/review/pr-review-prompt-template.d.ts.map +1 -1
- package/lib/browser/review/pr-review-prompt-template.js +3 -2
- package/lib/browser/review/pr-review-prompt-template.js.map +1 -1
- package/lib/browser/task-context-file-storage-service.d.ts.map +1 -1
- package/lib/browser/task-context-file-storage-service.js +1 -2
- package/lib/browser/task-context-file-storage-service.js.map +1 -1
- package/lib/browser/task-context-file-storage-service.spec.d.ts +2 -0
- package/lib/browser/task-context-file-storage-service.spec.d.ts.map +1 -0
- package/lib/browser/task-context-file-storage-service.spec.js +111 -0
- package/lib/browser/task-context-file-storage-service.spec.js.map +1 -0
- package/lib/browser/user-interaction-tool-renderer.js +1 -1
- package/lib/browser/user-interaction-tool-renderer.js.map +1 -1
- package/lib/browser/user-interaction-tool.d.ts +12 -1
- package/lib/browser/user-interaction-tool.d.ts.map +1 -1
- package/lib/browser/user-interaction-tool.js +35 -9
- package/lib/browser/user-interaction-tool.js.map +1 -1
- package/lib/browser/user-interaction-tool.spec.js +15 -2
- package/lib/browser/user-interaction-tool.spec.js.map +1 -1
- package/lib/browser/workspace-functions.d.ts +20 -17
- package/lib/browser/workspace-functions.d.ts.map +1 -1
- package/lib/browser/workspace-functions.js +77 -115
- package/lib/browser/workspace-functions.js.map +1 -1
- package/lib/browser/workspace-functions.spec.js +54 -60
- package/lib/browser/workspace-functions.spec.js.map +1 -1
- package/lib/browser/workspace-launch-provider.js +1 -1
- package/lib/browser/workspace-launch-provider.js.map +1 -1
- package/lib/browser/workspace-launch-provider.spec.js +5 -3
- package/lib/browser/workspace-launch-provider.spec.js.map +1 -1
- package/lib/browser/workspace-search-provider.spec.js +2 -1
- package/lib/browser/workspace-search-provider.spec.js.map +1 -1
- package/lib/browser/workspace-task-provider.js +1 -1
- package/lib/browser/workspace-task-provider.js.map +1 -1
- package/lib/browser/workspace-task-provider.spec.js +6 -4
- package/lib/browser/workspace-task-provider.spec.js.map +1 -1
- package/lib/common/agents-md-prompt-template.d.ts +6 -0
- package/lib/common/agents-md-prompt-template.d.ts.map +1 -0
- package/lib/common/agents-md-prompt-template.js +165 -0
- package/lib/common/agents-md-prompt-template.js.map +1 -0
- package/lib/common/coder-replace-prompt-template.d.ts.map +1 -1
- package/lib/common/coder-replace-prompt-template.js +4 -6
- package/lib/common/coder-replace-prompt-template.js.map +1 -1
- package/lib/common/command-prompt-template.js +1 -1
- package/lib/common/command-prompt-template.js.map +1 -1
- package/lib/common/orchestrator-prompt-template.js +1 -1
- package/lib/common/orchestrator-prompt-template.js.map +1 -1
- package/lib/common/universal-prompt-template.js +1 -1
- package/lib/common/universal-prompt-template.js.map +1 -1
- package/lib/common/workspace-preferences.d.ts +1 -0
- package/lib/common/workspace-preferences.d.ts.map +1 -1
- package/lib/common/workspace-preferences.js +10 -1
- package/lib/common/workspace-preferences.js.map +1 -1
- package/lib/package.spec.js +1 -0
- package/lib/package.spec.js.map +1 -1
- package/package.json +27 -28
- package/src/browser/{project-info-agent.ts → agents-md-agent.ts} +11 -10
- package/src/browser/ai-configuration/categories/agent-capabilities-settings.spec.ts +508 -2
- package/src/browser/ai-configuration/categories/agent-capabilities-settings.tsx +92 -33
- package/src/browser/ai-configuration/categories/agent-detail-model.spec.ts +78 -0
- package/src/browser/ai-configuration/categories/agent-detail-model.ts +18 -0
- package/src/browser/ai-configuration/categories/agent-detail-view.tsx +15 -12
- package/src/browser/ai-configuration/categories/agents-configuration-category.tsx +18 -3
- package/src/browser/ai-configuration/categories/provider-model-discovery-section.tsx +3 -3
- package/src/browser/ai-configuration/categories/token-usage-configuration-category.tsx +2 -2
- package/src/browser/ai-configuration/language-model-renderer.spec.ts +38 -0
- package/src/browser/ai-configuration/language-model-renderer.tsx +6 -15
- package/src/browser/app-tester-prompt-template.ts +4 -7
- package/src/browser/architect-prompt-template.ts +4 -4
- package/src/browser/code-reviewer-prompt-template.ts +2 -2
- package/src/browser/context-file-validation-service-impl.spec.ts +2 -1
- package/src/browser/explore-prompt-template.ts +2 -2
- package/src/browser/file-changeset-functions.spec.ts +91 -9
- package/src/browser/file-changeset-functions.ts +62 -7
- package/src/browser/frontend-module.ts +4 -4
- package/src/browser/git-changes-tool.spec.ts +16 -1
- package/src/browser/git-changes-tool.ts +6 -10
- package/src/browser/multi-root-paths.spec.ts +340 -0
- package/src/browser/remember-command-contribution.ts +7 -7
- package/src/browser/review/pr-review-prompt-template.ts +3 -3
- package/src/browser/style/index.css +15 -0
- package/src/browser/task-context-file-storage-service.spec.ts +125 -0
- package/src/browser/task-context-file-storage-service.ts +3 -4
- package/src/browser/user-interaction-tool.spec.ts +18 -1
- package/src/browser/user-interaction-tool.ts +34 -9
- package/src/browser/workspace-functions.spec.ts +54 -60
- package/src/browser/workspace-functions.ts +80 -125
- package/src/browser/workspace-launch-provider.spec.ts +3 -2
- package/src/browser/workspace-task-provider.spec.ts +4 -3
- package/src/common/{project-info-prompt-template.ts → agents-md-prompt-template.ts} +54 -46
- package/src/common/coder-replace-prompt-template.ts +5 -7
- package/src/common/command-prompt-template.ts +1 -1
- package/src/common/orchestrator-prompt-template.ts +1 -1
- package/src/common/universal-prompt-template.ts +1 -1
- package/src/common/workspace-preferences.ts +10 -0
- package/lib/browser/project-info-agent.d.ts.map +0 -1
- package/lib/browser/project-info-agent.js.map +0 -1
- package/lib/common/project-info-prompt-template.d.ts +0 -6
- package/lib/common/project-info-prompt-template.d.ts.map +0 -1
- package/lib/common/project-info-prompt-template.js +0 -146
- package/lib/common/project-info-prompt-template.js.map +0 -1
|
@@ -36,6 +36,7 @@ const monaco_workspace_1 = require("@theia/monaco/lib/browser/monaco-workspace")
|
|
|
36
36
|
const file_search_service_1 = require("@theia/file-search/lib/common/file-search-service");
|
|
37
37
|
const minimatch_1 = require("minimatch");
|
|
38
38
|
const mock_logger_1 = require("@theia/core/lib/common/test/mock-logger");
|
|
39
|
+
const with_workspace_service_defaults_1 = require("@theia/workspace/lib/browser/test/with-workspace-service-defaults");
|
|
39
40
|
const makeFileSearchService = (impl) => {
|
|
40
41
|
const calls = [];
|
|
41
42
|
return {
|
|
@@ -140,7 +141,7 @@ describe('Workspace Functions Cancellation Tests', () => {
|
|
|
140
141
|
};
|
|
141
142
|
// Register mocks in the container
|
|
142
143
|
container.bind(core_1.ILogger).to(mock_logger_1.MockLogger);
|
|
143
|
-
container.bind(browser_1.WorkspaceService).toConstantValue(mockWorkspaceService);
|
|
144
|
+
container.bind(browser_1.WorkspaceService).toConstantValue((0, with_workspace_service_defaults_1.withWorkspaceServiceDefaults)(mockWorkspaceService));
|
|
144
145
|
container.bind(file_service_1.FileService).toConstantValue(mockFileService);
|
|
145
146
|
container.bind(core_1.PreferenceService).toConstantValue(mockPreferenceService);
|
|
146
147
|
container.bind(monaco_workspace_1.MonacoWorkspace).toConstantValue(mockMonacoWorkspace);
|
|
@@ -240,7 +241,7 @@ describe('FileContentFunction.getArgumentsShortLabel', () => {
|
|
|
240
241
|
getTextDocument: () => undefined
|
|
241
242
|
};
|
|
242
243
|
container.bind(core_1.ILogger).to(mock_logger_1.MockLogger);
|
|
243
|
-
container.bind(browser_1.WorkspaceService).toConstantValue(mockWorkspaceService);
|
|
244
|
+
container.bind(browser_1.WorkspaceService).toConstantValue((0, with_workspace_service_defaults_1.withWorkspaceServiceDefaults)(mockWorkspaceService));
|
|
244
245
|
container.bind(file_service_1.FileService).toConstantValue(mockFileService);
|
|
245
246
|
container.bind(core_1.PreferenceService).toConstantValue(mockPreferenceService);
|
|
246
247
|
container.bind(monaco_workspace_1.MonacoWorkspace).toConstantValue(mockMonacoWorkspace);
|
|
@@ -340,7 +341,7 @@ describe('FileContentFunction handler', () => {
|
|
|
340
341
|
getTextDocument: () => undefined
|
|
341
342
|
};
|
|
342
343
|
container.bind(core_1.ILogger).to(mock_logger_1.MockLogger);
|
|
343
|
-
container.bind(browser_1.WorkspaceService).toConstantValue(mockWorkspaceService);
|
|
344
|
+
container.bind(browser_1.WorkspaceService).toConstantValue((0, with_workspace_service_defaults_1.withWorkspaceServiceDefaults)(mockWorkspaceService));
|
|
344
345
|
container.bind(file_service_1.FileService).toConstantValue(mockFileService);
|
|
345
346
|
container.bind(core_1.PreferenceService).toConstantValue(mockPreferenceService);
|
|
346
347
|
container.bind(monaco_workspace_1.MonacoWorkspace).toConstantValue(mockMonacoWorkspace);
|
|
@@ -641,7 +642,7 @@ describe('FindFilesByPattern.getArgumentsShortLabel', () => {
|
|
|
641
642
|
get: (_path, defaultValue) => defaultValue
|
|
642
643
|
};
|
|
643
644
|
container.bind(core_1.ILogger).to(mock_logger_1.MockLogger);
|
|
644
|
-
container.bind(browser_1.WorkspaceService).toConstantValue(mockWorkspaceService);
|
|
645
|
+
container.bind(browser_1.WorkspaceService).toConstantValue((0, with_workspace_service_defaults_1.withWorkspaceServiceDefaults)(mockWorkspaceService));
|
|
645
646
|
container.bind(file_service_1.FileService).toConstantValue(mockFileService);
|
|
646
647
|
container.bind(core_1.PreferenceService).toConstantValue(mockPreferenceService);
|
|
647
648
|
container.bind(ai_core_1.AiConfigurationService).toConstantValue(makeTrustAwareReader());
|
|
@@ -718,7 +719,7 @@ describe('FindFilesByPattern.findFiles', () => {
|
|
|
718
719
|
};
|
|
719
720
|
fileSearchService = makeFileSearchService(async () => searchResults);
|
|
720
721
|
container.bind(core_1.ILogger).to(mock_logger_1.MockLogger);
|
|
721
|
-
container.bind(browser_1.WorkspaceService).toConstantValue(mockWorkspaceService);
|
|
722
|
+
container.bind(browser_1.WorkspaceService).toConstantValue((0, with_workspace_service_defaults_1.withWorkspaceServiceDefaults)(mockWorkspaceService));
|
|
722
723
|
container.bind(file_service_1.FileService).toConstantValue(mockFileService);
|
|
723
724
|
container.bind(core_1.PreferenceService).toConstantValue(mockPreferenceService);
|
|
724
725
|
container.bind(ai_core_1.AiConfigurationService).toConstantValue(trustAwareReader);
|
|
@@ -846,7 +847,7 @@ describe('WorkspaceFunctionScope gitignore caching', () => {
|
|
|
846
847
|
get: (path, defaultValue) => (path === 'ai-features.workspaceFunctions.considerGitIgnore' ? true : defaultValue)
|
|
847
848
|
};
|
|
848
849
|
container.bind(core_1.ILogger).to(mock_logger_1.MockLogger);
|
|
849
|
-
container.bind(browser_1.WorkspaceService).toConstantValue(mockWorkspaceService);
|
|
850
|
+
container.bind(browser_1.WorkspaceService).toConstantValue((0, with_workspace_service_defaults_1.withWorkspaceServiceDefaults)(mockWorkspaceService));
|
|
850
851
|
container.bind(file_service_1.FileService).toConstantValue(mockFileService);
|
|
851
852
|
container.bind(core_1.PreferenceService).toConstantValue(mockPreferenceService);
|
|
852
853
|
container.bind(ai_core_1.AiConfigurationService).toConstantValue(makeTrustAwareReader());
|
|
@@ -905,7 +906,7 @@ describe('GetWorkspaceFileList resolves the target directory once', () => {
|
|
|
905
906
|
};
|
|
906
907
|
const mockPreferenceService = { get: (_path, def) => def };
|
|
907
908
|
container.bind(core_1.ILogger).to(mock_logger_1.MockLogger);
|
|
908
|
-
container.bind(browser_1.WorkspaceService).toConstantValue(mockWorkspaceService);
|
|
909
|
+
container.bind(browser_1.WorkspaceService).toConstantValue((0, with_workspace_service_defaults_1.withWorkspaceServiceDefaults)(mockWorkspaceService));
|
|
909
910
|
container.bind(file_service_1.FileService).toConstantValue(mockFileService);
|
|
910
911
|
container.bind(core_1.PreferenceService).toConstantValue(mockPreferenceService);
|
|
911
912
|
container.bind(ai_core_1.AiConfigurationService).toConstantValue(makeTrustAwareReader());
|
|
@@ -958,7 +959,7 @@ describe('GetWorkspaceDirectoryStructure preserves empty folders', () => {
|
|
|
958
959
|
get: (path, def) => (path === 'ai-features.workspaceFunctions.userExcludes' ? ['node_modules'] : def)
|
|
959
960
|
};
|
|
960
961
|
container.bind(core_1.ILogger).to(mock_logger_1.MockLogger);
|
|
961
|
-
container.bind(browser_1.WorkspaceService).toConstantValue(mockWorkspaceService);
|
|
962
|
+
container.bind(browser_1.WorkspaceService).toConstantValue((0, with_workspace_service_defaults_1.withWorkspaceServiceDefaults)(mockWorkspaceService));
|
|
962
963
|
container.bind(file_service_1.FileService).toConstantValue(mockFileService);
|
|
963
964
|
container.bind(core_1.PreferenceService).toConstantValue(mockPreferenceService);
|
|
964
965
|
container.bind(ai_core_1.AiConfigurationService).toConstantValue(makeTrustAwareReader());
|
|
@@ -1018,7 +1019,7 @@ describe('FileContentFunction external paths', () => {
|
|
|
1018
1019
|
onDidChangeTrust: () => ({ dispose: () => { } })
|
|
1019
1020
|
};
|
|
1020
1021
|
container.bind(core_1.ILogger).to(mock_logger_1.MockLogger);
|
|
1021
|
-
container.bind(browser_1.WorkspaceService).toConstantValue(mockWorkspaceService);
|
|
1022
|
+
container.bind(browser_1.WorkspaceService).toConstantValue((0, with_workspace_service_defaults_1.withWorkspaceServiceDefaults)(mockWorkspaceService));
|
|
1022
1023
|
container.bind(file_service_1.FileService).toConstantValue(mockFileService);
|
|
1023
1024
|
container.bind(core_1.PreferenceService).toConstantValue(mockPreferenceService);
|
|
1024
1025
|
container.bind(monaco_workspace_1.MonacoWorkspace).toConstantValue(mockMonacoWorkspace);
|
|
@@ -1141,7 +1142,7 @@ describe('WorkspaceFunctionScope accessible root contributions', () => {
|
|
|
1141
1142
|
return contributedRoots;
|
|
1142
1143
|
}
|
|
1143
1144
|
};
|
|
1144
|
-
container.bind(browser_1.WorkspaceService).toConstantValue(mockWorkspaceService);
|
|
1145
|
+
container.bind(browser_1.WorkspaceService).toConstantValue((0, with_workspace_service_defaults_1.withWorkspaceServiceDefaults)(mockWorkspaceService));
|
|
1145
1146
|
container.bind(file_service_1.FileService).toConstantValue(mockFileService);
|
|
1146
1147
|
container.bind(core_1.PreferenceService).toConstantValue({ get: (_path, defaultValue) => defaultValue });
|
|
1147
1148
|
container.bind(monaco_workspace_1.MonacoWorkspace).toConstantValue({ getTextDocument: () => undefined });
|
|
@@ -1244,7 +1245,7 @@ describe('GetWorkspaceFileList / GetWorkspaceDirectoryStructure with external pa
|
|
|
1244
1245
|
onDidChangeTrust: () => ({ dispose: () => { } })
|
|
1245
1246
|
};
|
|
1246
1247
|
container.bind(core_1.ILogger).to(mock_logger_1.MockLogger);
|
|
1247
|
-
container.bind(browser_1.WorkspaceService).toConstantValue(mockWorkspaceService);
|
|
1248
|
+
container.bind(browser_1.WorkspaceService).toConstantValue((0, with_workspace_service_defaults_1.withWorkspaceServiceDefaults)(mockWorkspaceService));
|
|
1248
1249
|
container.bind(file_service_1.FileService).toConstantValue(mockFileService);
|
|
1249
1250
|
container.bind(core_1.PreferenceService).toConstantValue(mockPreferenceService);
|
|
1250
1251
|
container.bind(ai_core_1.AiConfigurationService).toConstantValue(trustAwareReader);
|
|
@@ -1328,7 +1329,7 @@ describe('FindFilesByPattern with searchRoot', () => {
|
|
|
1328
1329
|
onDidChangeTrust: () => ({ dispose: () => { } })
|
|
1329
1330
|
};
|
|
1330
1331
|
container.bind(core_1.ILogger).to(mock_logger_1.MockLogger);
|
|
1331
|
-
container.bind(browser_1.WorkspaceService).toConstantValue(mockWorkspaceService);
|
|
1332
|
+
container.bind(browser_1.WorkspaceService).toConstantValue((0, with_workspace_service_defaults_1.withWorkspaceServiceDefaults)(mockWorkspaceService));
|
|
1332
1333
|
container.bind(file_service_1.FileService).toConstantValue(mockFileService);
|
|
1333
1334
|
container.bind(core_1.PreferenceService).toConstantValue(mockPreferenceService);
|
|
1334
1335
|
container.bind(ai_core_1.AiConfigurationService).toConstantValue(trustAwareReader);
|
|
@@ -1408,7 +1409,7 @@ describe('WorkspaceFunctionScope path-traversal hardening', () => {
|
|
|
1408
1409
|
onDidChangeTrust: () => ({ dispose: () => { } })
|
|
1409
1410
|
};
|
|
1410
1411
|
container.bind(core_1.ILogger).to(mock_logger_1.MockLogger);
|
|
1411
|
-
container.bind(browser_1.WorkspaceService).toConstantValue(mockWorkspaceService);
|
|
1412
|
+
container.bind(browser_1.WorkspaceService).toConstantValue((0, with_workspace_service_defaults_1.withWorkspaceServiceDefaults)(mockWorkspaceService));
|
|
1412
1413
|
container.bind(file_service_1.FileService).toConstantValue(mockFileService);
|
|
1413
1414
|
container.bind(core_1.PreferenceService).toConstantValue(mockPreferenceService);
|
|
1414
1415
|
container.bind(monaco_workspace_1.MonacoWorkspace).toConstantValue(mockMonacoWorkspace);
|
|
@@ -1558,7 +1559,7 @@ describe('WorkspaceFunctionScope Multi-Root Tests', () => {
|
|
|
1558
1559
|
tryGetRoots: () => [{ resource: new uri_1.URI('file:///home/user/my-project') }],
|
|
1559
1560
|
onWorkspaceChanged: () => ({ dispose: () => { } })
|
|
1560
1561
|
};
|
|
1561
|
-
container.bind(browser_1.WorkspaceService).toConstantValue(mockWorkspaceService);
|
|
1562
|
+
container.bind(browser_1.WorkspaceService).toConstantValue((0, with_workspace_service_defaults_1.withWorkspaceServiceDefaults)(mockWorkspaceService));
|
|
1562
1563
|
container.bind(file_service_1.FileService).toConstantValue({});
|
|
1563
1564
|
container.bind(core_1.PreferenceService).toConstantValue({ get: () => false });
|
|
1564
1565
|
container.bind(ai_core_1.AiConfigurationService).toConstantValue(makeTrustAwareReader());
|
|
@@ -1578,7 +1579,7 @@ describe('WorkspaceFunctionScope Multi-Root Tests', () => {
|
|
|
1578
1579
|
],
|
|
1579
1580
|
onWorkspaceChanged: () => ({ dispose: () => { } })
|
|
1580
1581
|
};
|
|
1581
|
-
container.bind(browser_1.WorkspaceService).toConstantValue(mockWorkspaceService);
|
|
1582
|
+
container.bind(browser_1.WorkspaceService).toConstantValue((0, with_workspace_service_defaults_1.withWorkspaceServiceDefaults)(mockWorkspaceService));
|
|
1582
1583
|
container.bind(file_service_1.FileService).toConstantValue({});
|
|
1583
1584
|
container.bind(core_1.PreferenceService).toConstantValue({ get: () => false });
|
|
1584
1585
|
container.bind(ai_core_1.AiConfigurationService).toConstantValue(makeTrustAwareReader());
|
|
@@ -1591,7 +1592,7 @@ describe('WorkspaceFunctionScope Multi-Root Tests', () => {
|
|
|
1591
1592
|
(0, chai_1.expect)(mapping.get('backend')?.toString()).to.equal('file:///home/user/backend');
|
|
1592
1593
|
(0, chai_1.expect)(mapping.get('shared')?.toString()).to.equal('file:///home/user/shared');
|
|
1593
1594
|
});
|
|
1594
|
-
it('
|
|
1595
|
+
it('names roots sharing a basename as peers', () => {
|
|
1595
1596
|
const mockWorkspaceService = {
|
|
1596
1597
|
tryGetRoots: () => [
|
|
1597
1598
|
{ resource: new uri_1.URI('file:///alice/app') },
|
|
@@ -1599,7 +1600,7 @@ describe('WorkspaceFunctionScope Multi-Root Tests', () => {
|
|
|
1599
1600
|
],
|
|
1600
1601
|
onWorkspaceChanged: () => ({ dispose: () => { } })
|
|
1601
1602
|
};
|
|
1602
|
-
container.bind(browser_1.WorkspaceService).toConstantValue(mockWorkspaceService);
|
|
1603
|
+
container.bind(browser_1.WorkspaceService).toConstantValue((0, with_workspace_service_defaults_1.withWorkspaceServiceDefaults)(mockWorkspaceService));
|
|
1603
1604
|
container.bind(file_service_1.FileService).toConstantValue({});
|
|
1604
1605
|
container.bind(core_1.PreferenceService).toConstantValue({ get: () => false });
|
|
1605
1606
|
container.bind(ai_core_1.AiConfigurationService).toConstantValue(makeTrustAwareReader());
|
|
@@ -1607,10 +1608,9 @@ describe('WorkspaceFunctionScope Multi-Root Tests', () => {
|
|
|
1607
1608
|
container.bind(workspace_functions_1.WorkspaceFunctionScope).toSelf();
|
|
1608
1609
|
workspaceScope = container.get(workspace_functions_1.WorkspaceFunctionScope);
|
|
1609
1610
|
const mapping = workspaceScope.getRootMapping();
|
|
1610
|
-
|
|
1611
|
-
|
|
1612
|
-
(0, chai_1.expect)(mapping.
|
|
1613
|
-
(0, chai_1.expect)(mapping.get('app')?.toString()).to.equal('file:///alice/app');
|
|
1611
|
+
(0, chai_1.expect)(mapping.size).to.equal(2);
|
|
1612
|
+
(0, chai_1.expect)(mapping.get('alice/app')?.toString()).to.equal('file:///alice/app');
|
|
1613
|
+
(0, chai_1.expect)(mapping.get('bob/app')?.toString()).to.equal('file:///bob/app');
|
|
1614
1614
|
});
|
|
1615
1615
|
});
|
|
1616
1616
|
describe('toWorkspaceRelativePath', () => {
|
|
@@ -1619,7 +1619,7 @@ describe('WorkspaceFunctionScope Multi-Root Tests', () => {
|
|
|
1619
1619
|
tryGetRoots: () => [{ resource: new uri_1.URI('file:///home/user/project') }],
|
|
1620
1620
|
onWorkspaceChanged: () => ({ dispose: () => { } })
|
|
1621
1621
|
};
|
|
1622
|
-
container.bind(browser_1.WorkspaceService).toConstantValue(mockWorkspaceService);
|
|
1622
|
+
container.bind(browser_1.WorkspaceService).toConstantValue((0, with_workspace_service_defaults_1.withWorkspaceServiceDefaults)(mockWorkspaceService));
|
|
1623
1623
|
container.bind(file_service_1.FileService).toConstantValue({});
|
|
1624
1624
|
container.bind(core_1.PreferenceService).toConstantValue({ get: () => false });
|
|
1625
1625
|
container.bind(ai_core_1.AiConfigurationService).toConstantValue(makeTrustAwareReader());
|
|
@@ -1638,7 +1638,7 @@ describe('WorkspaceFunctionScope Multi-Root Tests', () => {
|
|
|
1638
1638
|
],
|
|
1639
1639
|
onWorkspaceChanged: () => ({ dispose: () => { } })
|
|
1640
1640
|
};
|
|
1641
|
-
container.bind(browser_1.WorkspaceService).toConstantValue(mockWorkspaceService);
|
|
1641
|
+
container.bind(browser_1.WorkspaceService).toConstantValue((0, with_workspace_service_defaults_1.withWorkspaceServiceDefaults)(mockWorkspaceService));
|
|
1642
1642
|
container.bind(file_service_1.FileService).toConstantValue({});
|
|
1643
1643
|
container.bind(core_1.PreferenceService).toConstantValue({ get: () => false });
|
|
1644
1644
|
container.bind(ai_core_1.AiConfigurationService).toConstantValue(makeTrustAwareReader());
|
|
@@ -1655,7 +1655,7 @@ describe('WorkspaceFunctionScope Multi-Root Tests', () => {
|
|
|
1655
1655
|
tryGetRoots: () => [{ resource: new uri_1.URI('file:///home/user/project') }],
|
|
1656
1656
|
onWorkspaceChanged: () => ({ dispose: () => { } })
|
|
1657
1657
|
};
|
|
1658
|
-
container.bind(browser_1.WorkspaceService).toConstantValue(mockWorkspaceService);
|
|
1658
|
+
container.bind(browser_1.WorkspaceService).toConstantValue((0, with_workspace_service_defaults_1.withWorkspaceServiceDefaults)(mockWorkspaceService));
|
|
1659
1659
|
container.bind(file_service_1.FileService).toConstantValue({});
|
|
1660
1660
|
container.bind(core_1.PreferenceService).toConstantValue({ get: () => false });
|
|
1661
1661
|
container.bind(ai_core_1.AiConfigurationService).toConstantValue(makeTrustAwareReader());
|
|
@@ -1671,7 +1671,7 @@ describe('WorkspaceFunctionScope Multi-Root Tests', () => {
|
|
|
1671
1671
|
tryGetRoots: () => [{ resource: new uri_1.URI('file:///home/user/project') }],
|
|
1672
1672
|
onWorkspaceChanged: () => ({ dispose: () => { } })
|
|
1673
1673
|
};
|
|
1674
|
-
container.bind(browser_1.WorkspaceService).toConstantValue(mockWorkspaceService);
|
|
1674
|
+
container.bind(browser_1.WorkspaceService).toConstantValue((0, with_workspace_service_defaults_1.withWorkspaceServiceDefaults)(mockWorkspaceService));
|
|
1675
1675
|
container.bind(file_service_1.FileService).toConstantValue({});
|
|
1676
1676
|
container.bind(core_1.PreferenceService).toConstantValue({ get: () => false });
|
|
1677
1677
|
container.bind(ai_core_1.AiConfigurationService).toConstantValue(makeTrustAwareReader());
|
|
@@ -1691,7 +1691,7 @@ describe('WorkspaceFunctionScope Multi-Root Tests', () => {
|
|
|
1691
1691
|
tryGetRoots: () => rootObjects,
|
|
1692
1692
|
onWorkspaceChanged: () => ({ dispose: () => { } })
|
|
1693
1693
|
};
|
|
1694
|
-
container.bind(browser_1.WorkspaceService).toConstantValue(mockWorkspaceService);
|
|
1694
|
+
container.bind(browser_1.WorkspaceService).toConstantValue((0, with_workspace_service_defaults_1.withWorkspaceServiceDefaults)(mockWorkspaceService));
|
|
1695
1695
|
container.bind(file_service_1.FileService).toConstantValue({});
|
|
1696
1696
|
container.bind(core_1.PreferenceService).toConstantValue({ get: () => false });
|
|
1697
1697
|
container.bind(ai_core_1.AiConfigurationService).toConstantValue(makeTrustAwareReader());
|
|
@@ -1805,40 +1805,36 @@ describe('WorkspaceFunctionScope Multi-Root Tests', () => {
|
|
|
1805
1805
|
});
|
|
1806
1806
|
});
|
|
1807
1807
|
describe('duplicate root basenames', () => {
|
|
1808
|
-
it('round-trips
|
|
1808
|
+
it('names all roots sharing a basename as peers and round-trips each of them', () => {
|
|
1809
1809
|
workspaceScope = createScope(['file:///workspace/a/app', 'file:///workspace/b/app']);
|
|
1810
1810
|
const mapping = workspaceScope.getRootMapping();
|
|
1811
|
-
(0, chai_1.expect)(mapping.
|
|
1812
|
-
(
|
|
1813
|
-
|
|
1814
|
-
|
|
1815
|
-
|
|
1816
|
-
|
|
1817
|
-
|
|
1818
|
-
(0, chai_1.expect)(resolved.toString()).to.equal(uri.toString());
|
|
1811
|
+
(0, chai_1.expect)(Array.from(mapping.keys())).to.deep.equal(['a/app', 'b/app']);
|
|
1812
|
+
for (const [name, rootUri] of mapping) {
|
|
1813
|
+
const uri = rootUri.resolve('src/index.ts');
|
|
1814
|
+
const relPath = workspaceScope.toWorkspaceRelativePath(uri);
|
|
1815
|
+
(0, chai_1.expect)(relPath).to.equal(`${name}/src/index.ts`);
|
|
1816
|
+
(0, chai_1.expect)(workspaceScope.resolveRelativePath(relPath).toString()).to.equal(uri.toString());
|
|
1817
|
+
}
|
|
1819
1818
|
});
|
|
1820
|
-
it('
|
|
1819
|
+
it('rejects the shared basename as ambiguous', () => {
|
|
1821
1820
|
workspaceScope = createScope(['file:///workspace/a/app', 'file:///workspace/b/app']);
|
|
1822
|
-
|
|
1823
|
-
const relPath = workspaceScope.toWorkspaceRelativePath(uri);
|
|
1824
|
-
(0, chai_1.expect)(relPath).to.be.undefined;
|
|
1821
|
+
(0, chai_1.expect)(() => workspaceScope.resolveRelativePath('app/src/index.ts')).to.throw(/ambiguous.*a\/app.*b\/app/);
|
|
1825
1822
|
});
|
|
1826
|
-
it('resolves
|
|
1823
|
+
it('resolves a longer parent-qualified path (Phase 2)', () => {
|
|
1827
1824
|
workspaceScope = createScope(['file:///workspace/a/app', 'file:///workspace/b/app']);
|
|
1828
|
-
|
|
1829
|
-
|
|
1830
|
-
(0, chai_1.expect)(result.toString()).to.equal('file:///workspace/a/app/src/index.ts');
|
|
1825
|
+
const result = workspaceScope.resolveRelativePath('workspace/b/app/src/index.ts');
|
|
1826
|
+
(0, chai_1.expect)(result.toString()).to.equal('file:///workspace/b/app/src/index.ts');
|
|
1831
1827
|
});
|
|
1832
|
-
// The
|
|
1833
|
-
it('resolves a uri for
|
|
1828
|
+
// The external file change notice names files by a uri when roots share a basename.
|
|
1829
|
+
it('resolves a uri for a root sharing its basename', async () => {
|
|
1834
1830
|
workspaceScope = createScope(['file:///workspace/a/app', 'file:///workspace/b/app']);
|
|
1835
|
-
const
|
|
1836
|
-
(0, chai_1.expect)((await workspaceScope.resolveAccessiblePath(
|
|
1831
|
+
const uri = 'file:///workspace/b/app/src/index.ts';
|
|
1832
|
+
(0, chai_1.expect)((await workspaceScope.resolveAccessiblePath(uri)).toString()).to.equal(uri);
|
|
1837
1833
|
});
|
|
1838
1834
|
});
|
|
1839
1835
|
});
|
|
1840
1836
|
describe('getRootMapping duplicate basename stability', () => {
|
|
1841
|
-
it('assigns the same
|
|
1837
|
+
it('assigns the same name to a root regardless of tryGetRoots order', () => {
|
|
1842
1838
|
// First ordering
|
|
1843
1839
|
const mockWorkspaceServiceA = {
|
|
1844
1840
|
tryGetRoots: () => [
|
|
@@ -1847,7 +1843,7 @@ describe('WorkspaceFunctionScope Multi-Root Tests', () => {
|
|
|
1847
1843
|
],
|
|
1848
1844
|
onWorkspaceChanged: () => ({ dispose: () => { } })
|
|
1849
1845
|
};
|
|
1850
|
-
container.bind(browser_1.WorkspaceService).toConstantValue(mockWorkspaceServiceA);
|
|
1846
|
+
container.bind(browser_1.WorkspaceService).toConstantValue((0, with_workspace_service_defaults_1.withWorkspaceServiceDefaults)(mockWorkspaceServiceA));
|
|
1851
1847
|
container.bind(file_service_1.FileService).toConstantValue({});
|
|
1852
1848
|
container.bind(core_1.PreferenceService).toConstantValue({ get: () => false });
|
|
1853
1849
|
container.bind(ai_core_1.AiConfigurationService).toConstantValue(makeTrustAwareReader());
|
|
@@ -1865,7 +1861,7 @@ describe('WorkspaceFunctionScope Multi-Root Tests', () => {
|
|
|
1865
1861
|
onWorkspaceChanged: () => ({ dispose: () => { } })
|
|
1866
1862
|
};
|
|
1867
1863
|
container2.bind(core_1.ILogger).to(mock_logger_1.MockLogger);
|
|
1868
|
-
container2.bind(browser_1.WorkspaceService).toConstantValue(mockWorkspaceServiceB);
|
|
1864
|
+
container2.bind(browser_1.WorkspaceService).toConstantValue((0, with_workspace_service_defaults_1.withWorkspaceServiceDefaults)(mockWorkspaceServiceB));
|
|
1869
1865
|
container2.bind(file_service_1.FileService).toConstantValue({});
|
|
1870
1866
|
container2.bind(core_1.PreferenceService).toConstantValue({ get: () => false });
|
|
1871
1867
|
container2.bind(ai_core_1.AiConfigurationService).toConstantValue(makeTrustAwareReader());
|
|
@@ -1873,12 +1869,10 @@ describe('WorkspaceFunctionScope Multi-Root Tests', () => {
|
|
|
1873
1869
|
container2.bind(workspace_functions_1.WorkspaceFunctionScope).toSelf();
|
|
1874
1870
|
const scopeB = container2.get(workspace_functions_1.WorkspaceFunctionScope);
|
|
1875
1871
|
const mappingB = scopeB.getRootMapping();
|
|
1876
|
-
|
|
1877
|
-
|
|
1878
|
-
|
|
1879
|
-
(0, chai_1.expect)(
|
|
1880
|
-
(0, chai_1.expect)(mappingA.get('app')?.toString()).to.equal(mappingB.get('app')?.toString());
|
|
1881
|
-
(0, chai_1.expect)(mappingA.get('app')?.toString()).to.equal('file:///workspace/a/app');
|
|
1872
|
+
for (const name of ['a/app', 'b/app']) {
|
|
1873
|
+
(0, chai_1.expect)(mappingA.get(name)?.toString()).to.equal(mappingB.get(name)?.toString());
|
|
1874
|
+
}
|
|
1875
|
+
(0, chai_1.expect)(mappingA.get('a/app')?.toString()).to.equal('file:///workspace/a/app');
|
|
1882
1876
|
});
|
|
1883
1877
|
});
|
|
1884
1878
|
describe('getContainingRoot', () => {
|
|
@@ -1890,7 +1884,7 @@ describe('WorkspaceFunctionScope Multi-Root Tests', () => {
|
|
|
1890
1884
|
],
|
|
1891
1885
|
onWorkspaceChanged: () => ({ dispose: () => { } })
|
|
1892
1886
|
};
|
|
1893
|
-
container.bind(browser_1.WorkspaceService).toConstantValue(mockWorkspaceService);
|
|
1887
|
+
container.bind(browser_1.WorkspaceService).toConstantValue((0, with_workspace_service_defaults_1.withWorkspaceServiceDefaults)(mockWorkspaceService));
|
|
1894
1888
|
container.bind(file_service_1.FileService).toConstantValue({});
|
|
1895
1889
|
container.bind(core_1.PreferenceService).toConstantValue({ get: () => false });
|
|
1896
1890
|
container.bind(ai_core_1.AiConfigurationService).toConstantValue(makeTrustAwareReader());
|
|
@@ -1913,7 +1907,7 @@ describe('WorkspaceFunctionScope Multi-Root Tests', () => {
|
|
|
1913
1907
|
],
|
|
1914
1908
|
onWorkspaceChanged: () => ({ dispose: () => { } })
|
|
1915
1909
|
};
|
|
1916
|
-
container.bind(browser_1.WorkspaceService).toConstantValue(mockWorkspaceService);
|
|
1910
|
+
container.bind(browser_1.WorkspaceService).toConstantValue((0, with_workspace_service_defaults_1.withWorkspaceServiceDefaults)(mockWorkspaceService));
|
|
1917
1911
|
container.bind(file_service_1.FileService).toConstantValue({});
|
|
1918
1912
|
container.bind(core_1.PreferenceService).toConstantValue({ get: () => false });
|
|
1919
1913
|
container.bind(ai_core_1.AiConfigurationService).toConstantValue(makeTrustAwareReader());
|
|
@@ -1934,7 +1928,7 @@ describe('WorkspaceFunctionScope Multi-Root Tests', () => {
|
|
|
1934
1928
|
],
|
|
1935
1929
|
onWorkspaceChanged: () => ({ dispose: () => { } })
|
|
1936
1930
|
};
|
|
1937
|
-
container.bind(browser_1.WorkspaceService).toConstantValue(mockWorkspaceService);
|
|
1931
|
+
container.bind(browser_1.WorkspaceService).toConstantValue((0, with_workspace_service_defaults_1.withWorkspaceServiceDefaults)(mockWorkspaceService));
|
|
1938
1932
|
container.bind(file_service_1.FileService).toConstantValue({});
|
|
1939
1933
|
container.bind(core_1.PreferenceService).toConstantValue({ get: () => false });
|
|
1940
1934
|
container.bind(ai_core_1.AiConfigurationService).toConstantValue(makeTrustAwareReader());
|
|
@@ -1954,7 +1948,7 @@ describe('WorkspaceFunctionScope Multi-Root Tests', () => {
|
|
|
1954
1948
|
],
|
|
1955
1949
|
onWorkspaceChanged: () => ({ dispose: () => { } })
|
|
1956
1950
|
};
|
|
1957
|
-
container.bind(browser_1.WorkspaceService).toConstantValue(mockWorkspaceService);
|
|
1951
|
+
container.bind(browser_1.WorkspaceService).toConstantValue((0, with_workspace_service_defaults_1.withWorkspaceServiceDefaults)(mockWorkspaceService));
|
|
1958
1952
|
container.bind(file_service_1.FileService).toConstantValue({});
|
|
1959
1953
|
container.bind(core_1.PreferenceService).toConstantValue({ get: () => false });
|
|
1960
1954
|
container.bind(ai_core_1.AiConfigurationService).toConstantValue(makeTrustAwareReader());
|