mirror of
https://github.com/microsoft/vscode.git
synced 2026-04-17 15:24:40 +01:00
sessions: use proper DI for fileService and pathService in AgenticPromptsService (#305727)
refactor: streamline access to file and path services in PromptsService
This commit is contained in:
@@ -38,8 +38,7 @@ export class AgenticPromptsService extends PromptsService {
|
||||
|
||||
private getCopilotRoot(): URI {
|
||||
if (!this._copilotRoot) {
|
||||
const pathService = this.instantiationService.invokeFunction(accessor => accessor.get(IPathService));
|
||||
this._copilotRoot = joinPath(pathService.userHome({ preferLocal: true }), '.copilot');
|
||||
this._copilotRoot = joinPath(this.pathService.userHome({ preferLocal: true }), '.copilot');
|
||||
}
|
||||
return this._copilotRoot;
|
||||
}
|
||||
@@ -62,9 +61,8 @@ export class AgenticPromptsService extends PromptsService {
|
||||
* Each subdirectory containing a SKILL.md is treated as a skill.
|
||||
*/
|
||||
private async discoverBuiltinSkills(): Promise<readonly IAgentSkill[]> {
|
||||
const fileService = this.instantiationService.invokeFunction(accessor => accessor.get(IFileService));
|
||||
try {
|
||||
const stat = await fileService.resolve(BUILTIN_SKILLS_URI);
|
||||
const stat = await this.fileService.resolve(BUILTIN_SKILLS_URI);
|
||||
if (!stat.children) {
|
||||
return [];
|
||||
}
|
||||
|
||||
@@ -175,13 +175,13 @@ export class PromptsService extends Disposable implements IPromptsService {
|
||||
@IInstantiationService protected readonly instantiationService: IInstantiationService,
|
||||
@IUserDataProfileService private readonly userDataService: IUserDataProfileService,
|
||||
@IConfigurationService private readonly configurationService: IConfigurationService,
|
||||
@IFileService private readonly fileService: IFileService,
|
||||
@IFileService protected readonly fileService: IFileService,
|
||||
@IFilesConfigurationService private readonly filesConfigService: IFilesConfigurationService,
|
||||
@IStorageService private readonly storageService: IStorageService,
|
||||
@IExtensionService private readonly extensionService: IExtensionService,
|
||||
@ITelemetryService private readonly telemetryService: ITelemetryService,
|
||||
@IWorkspaceContextService private readonly workspaceService: IWorkspaceContextService,
|
||||
@IPathService private readonly pathService: IPathService,
|
||||
@IPathService protected readonly pathService: IPathService,
|
||||
@IContextKeyService private readonly contextKeyService: IContextKeyService,
|
||||
@IAgentPluginService private readonly agentPluginService: IAgentPluginService,
|
||||
@IWorkspaceTrustManagementService private readonly workspaceTrustService: IWorkspaceTrustManagementService,
|
||||
|
||||
Reference in New Issue
Block a user