Skip to content

Commit 4466309

Browse files
committed
Update per comments
1 parent c001047 commit 4466309

File tree

2 files changed

+3
-11
lines changed

2 files changed

+3
-11
lines changed

src/vs/workbench/contrib/chat/common/promptSyntax/service/promptsServiceImpl.ts

Lines changed: 3 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -96,16 +96,12 @@ export class PromptsService extends Disposable implements IPromptsService {
9696
this.promptFileByCommandCache.clear();
9797
}
9898
else {
99-
const pendingClear = [];
99+
// Clear cache for prompt files that match the changed URI
100100
for (const [key, value] of this.promptFileByCommandCache) {
101-
if (value.value?.uri === event.uri) {
102-
pendingClear.push(key);
101+
if (isEqual(value.value?.uri, event.uri)) {
102+
this.promptFileByCommandCache.delete(key);
103103
}
104104
}
105-
106-
for (const key of pendingClear) {
107-
this.promptFileByCommandCache.delete(key);
108-
}
109105
}
110106

111107
this.onDidChangeParsedPromptFilesCacheEmitter.fire();

src/vs/workbench/contrib/chat/test/common/promptSyntax/service/promptsService.test.ts

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -14,8 +14,6 @@ import { Range } from '../../../../../../../editor/common/core/range.js';
1414
import { ILanguageService } from '../../../../../../../editor/common/languages/language.js';
1515
import { IModelService } from '../../../../../../../editor/common/services/model.js';
1616
import { ModelService } from '../../../../../../../editor/common/services/modelService.js';
17-
import { IThemeService } from '../../../../../../../platform/theme/common/themeService.js';
18-
import { TestThemeService } from '../../../../../../../platform/theme/test/common/testThemeService.js';
1917
import { IConfigurationService } from '../../../../../../../platform/configuration/common/configuration.js';
2018
import { TestConfigurationService } from '../../../../../../../platform/configuration/test/common/testConfigurationService.js';
2119
import { IExtensionDescription } from '../../../../../../../platform/extensions/common/extensions.js';
@@ -73,8 +71,6 @@ suite('PromptsService', () => {
7371
const fileService = disposables.add(instaService.createInstance(FileService));
7472
instaService.stub(IFileService, fileService);
7573

76-
// Set up model service with theme service requirement
77-
instaService.stub(IThemeService, new TestThemeService());
7874
const modelService = disposables.add(instaService.createInstance(ModelService));
7975
instaService.stub(IModelService, modelService);
8076
instaService.stub(ILanguageService, {

0 commit comments

Comments
 (0)