Skip to content

Commit

Permalink
[debt]: remove unused config service injection (#239544)
Browse files Browse the repository at this point in the history
  • Loading branch information
legomushroom authored Feb 3, 2025
1 parent 4b9eb5a commit a9b6512
Show file tree
Hide file tree
Showing 4 changed files with 5 additions and 14 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,6 @@ import { IDynamicVariable } from '../../../common/chatVariables.js';
import { IRange } from '../../../../../../editor/common/core/range.js';
import { ILogService } from '../../../../../../platform/log/common/log.js';
import { FilePromptParser } from '../../../common/promptSyntax/parsers/filePromptParser.js';
import { IConfigurationService } from '../../../../../../platform/configuration/common/configuration.js';
import { IInstantiationService } from '../../../../../../platform/instantiation/common/instantiation.js';

/**
Expand All @@ -24,7 +23,6 @@ export class ChatFileReference extends FilePromptParser implements IDynamicVaria
constructor(
public readonly reference: IDynamicVariable,
@IInstantiationService initService: IInstantiationService,
@IConfigurationService configService: IConfigurationService,
@ILogService logService: ILogService,
) {
const { data } = reference;
Expand All @@ -34,7 +32,7 @@ export class ChatFileReference extends FilePromptParser implements IDynamicVaria
`Variable data must be an URI, got '${data}'.`,
);

super(data, [], initService, configService, logService);
super(data, [], initService, logService);
}

/**
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,6 @@ import { ObservableDisposable } from '../../../../../../base/common/observableDi
import { FilePromptContentProvider } from '../contentProviders/filePromptContentsProvider.js';
import { PROMPT_SNIPPET_FILE_EXTENSION } from '../contentProviders/promptContentsProviderBase.js';
import { IInstantiationService } from '../../../../../../platform/instantiation/common/instantiation.js';
import { IConfigurationService } from '../../../../../../platform/configuration/common/configuration.js';
import { MarkdownLink } from '../../../../../../editor/common/codecs/markdownCodec/tokens/markdownLink.js';
import { FileOpenFailed, NonPromptSnippetFile, RecursiveReference, ParseError, FailedToResolveContentsStream } from '../../promptFileReferenceErrors.js';

Expand Down Expand Up @@ -145,7 +144,6 @@ export abstract class BasePromptParser<T extends IPromptContentsProvider> extend
private readonly promptContentsProvider: T,
seenReferences: string[] = [],
@IInstantiationService protected readonly instantiationService: IInstantiationService,
@IConfigurationService protected readonly configService: IConfigurationService,
@ILogService protected readonly logService: ILogService,
) {
super();
Expand Down Expand Up @@ -173,7 +171,7 @@ export abstract class BasePromptParser<T extends IPromptContentsProvider> extend

this._register(
this.promptContentsProvider.onContentChanged((streamOrError) => {
// process the the received message
// process the received message
this.onContentsChanged(streamOrError, seenReferences);

// indicate that we've received at least one `onContentChanged` event
Expand Down Expand Up @@ -559,13 +557,12 @@ export class PromptFileReference extends BasePromptParser<FilePromptContentProvi
dirname: URI,
seenReferences: string[] = [],
@IInstantiationService initService: IInstantiationService,
@IConfigurationService configService: IConfigurationService,
@ILogService logService: ILogService,
) {
const fileUri = extUri.resolvePath(dirname, token.path);
const provider = initService.createInstance(FilePromptContentProvider, fileUri);

super(provider, seenReferences, initService, configService, logService);
super(provider, seenReferences, initService, logService);
}

/**
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,6 @@ import { BasePromptParser } from './basePromptParser.js';
import { URI } from '../../../../../../base/common/uri.js';
import { ILogService } from '../../../../../../platform/log/common/log.js';
import { FilePromptContentProvider } from '../contentProviders/filePromptContentsProvider.js';
import { IConfigurationService } from '../../../../../../platform/configuration/common/configuration.js';
import { IInstantiationService } from '../../../../../../platform/instantiation/common/instantiation.js';

/**
Expand All @@ -19,11 +18,10 @@ export class FilePromptParser extends BasePromptParser<FilePromptContentProvider
uri: URI,
seenReferences: string[] = [],
@IInstantiationService initService: IInstantiationService,
@IConfigurationService configService: IConfigurationService,
@ILogService logService: ILogService,
) {
const contentsProvider = initService.createInstance(FilePromptContentProvider, uri);
super(contentsProvider, seenReferences, initService, configService, logService);
super(contentsProvider, seenReferences, initService, logService);
}

/**
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,6 @@ import { BasePromptParser } from './basePromptParser.js';
import { ITextModel } from '../../../../../../editor/common/model.js';
import { ILogService } from '../../../../../../platform/log/common/log.js';
import { TextModelContentsProvider } from '../contentProviders/textModelContentsProvider.js';
import { IConfigurationService } from '../../../../../../platform/configuration/common/configuration.js';
import { IInstantiationService } from '../../../../../../platform/instantiation/common/instantiation.js';

/**
Expand All @@ -19,11 +18,10 @@ export class TextModelPromptParser extends BasePromptParser<TextModelContentsPro
model: ITextModel,
seenReferences: string[] = [],
@IInstantiationService initService: IInstantiationService,
@IConfigurationService configService: IConfigurationService,
@ILogService logService: ILogService,
) {
const contentsProvider = initService.createInstance(TextModelContentsProvider, model);
super(contentsProvider, seenReferences, initService, configService, logService);
super(contentsProvider, seenReferences, initService, logService);
}

/**
Expand Down

0 comments on commit a9b6512

Please sign in to comment.