mirror of
https://github.com/microsoft/vscode.git
synced 2025-12-19 17:58:39 +00:00
This commit is contained in:
1291
.vscode/searches/no-any-casts.code-search
vendored
1291
.vscode/searches/no-any-casts.code-search
vendored
File diff suppressed because it is too large
Load Diff
@@ -603,27 +603,6 @@ export default tseslint.config(
|
||||
'src/vs/workbench/contrib/bulkEdit/browser/bulkTextEdits.ts',
|
||||
'src/vs/workbench/contrib/bulkEdit/browser/preview/bulkEditPane.ts',
|
||||
'src/vs/workbench/contrib/bulkEdit/browser/preview/bulkEditPreview.ts',
|
||||
'src/vs/workbench/contrib/chat/browser/actions/chatCodeblockActions.ts',
|
||||
'src/vs/workbench/contrib/chat/browser/actions/chatContextActions.ts',
|
||||
'src/vs/workbench/contrib/chat/browser/chatEditing/chatEditingActions.ts',
|
||||
'src/vs/workbench/contrib/chat/browser/chatEditing/chatEditingEditorActions.ts',
|
||||
'src/vs/workbench/contrib/chat/browser/chatEditing/chatEditingServiceImpl.ts',
|
||||
'src/vs/workbench/contrib/chat/browser/chatSessions.contribution.ts',
|
||||
'src/vs/workbench/contrib/chat/browser/chatSessions/common.ts',
|
||||
'src/vs/workbench/contrib/chat/browser/chatSessions/view/sessionsTreeRenderer.ts',
|
||||
'src/vs/workbench/contrib/chat/browser/contrib/chatDynamicVariables.ts',
|
||||
'src/vs/workbench/contrib/chat/common/chatModel.ts',
|
||||
'src/vs/workbench/contrib/chat/common/chatService.ts',
|
||||
'src/vs/workbench/contrib/chat/common/chatServiceImpl.ts',
|
||||
'src/vs/workbench/contrib/chat/common/chatSessionsService.ts',
|
||||
'src/vs/workbench/contrib/chat/common/chatWidgetHistoryService.ts',
|
||||
'src/vs/workbench/contrib/chat/common/languageModelToolsService.ts',
|
||||
'src/vs/workbench/contrib/chat/common/languageModels.ts',
|
||||
'src/vs/workbench/contrib/chat/common/promptSyntax/service/promptsServiceImpl.ts',
|
||||
'src/vs/workbench/contrib/chat/common/tools/manageTodoListTool.ts',
|
||||
'src/vs/workbench/contrib/chat/test/common/languageModels.ts',
|
||||
'src/vs/workbench/contrib/chat/test/common/mockLanguageModelToolsService.ts',
|
||||
'src/vs/workbench/contrib/chat/test/common/mockPromptsService.ts',
|
||||
'src/vs/workbench/contrib/codeEditor/browser/inspectEditorTokens/inspectEditorTokens.ts',
|
||||
'src/vs/workbench/contrib/codeEditor/browser/outline/documentSymbolsOutline.ts',
|
||||
'src/vs/workbench/contrib/codeEditor/electron-browser/selectionClipboard.ts',
|
||||
|
||||
@@ -85,6 +85,7 @@ abstract class ChatCodeBlockAction extends Action2 {
|
||||
return this.runWithContext(accessor, context);
|
||||
}
|
||||
|
||||
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
||||
abstract runWithContext(accessor: ServicesAccessor, context: ICodeBlockActionContext): any;
|
||||
}
|
||||
|
||||
@@ -621,6 +622,7 @@ export function registerChatCodeCompareBlockActions() {
|
||||
return this.runWithContext(accessor, context);
|
||||
}
|
||||
|
||||
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
||||
abstract runWithContext(accessor: ServicesAccessor, context: ICodeCompareBlockActionContext): any;
|
||||
}
|
||||
|
||||
@@ -641,6 +643,7 @@ export function registerChatCodeCompareBlockActions() {
|
||||
});
|
||||
}
|
||||
|
||||
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
||||
async runWithContext(accessor: ServicesAccessor, context: ICodeCompareBlockActionContext): Promise<any> {
|
||||
|
||||
const instaService = accessor.get(IInstantiationService);
|
||||
@@ -693,6 +696,7 @@ export function registerChatCodeCompareBlockActions() {
|
||||
});
|
||||
}
|
||||
|
||||
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
||||
async runWithContext(accessor: ServicesAccessor, context: ICodeCompareBlockActionContext): Promise<any> {
|
||||
const instaService = accessor.get(IInstantiationService);
|
||||
const editor = instaService.createInstance(DefaultChatTextEditor);
|
||||
|
||||
@@ -258,6 +258,7 @@ class AttachSelectionToChatAction extends Action2 {
|
||||
});
|
||||
}
|
||||
|
||||
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
||||
override async run(accessor: ServicesAccessor, ...args: any[]): Promise<void> {
|
||||
const editorService = accessor.get(IEditorService);
|
||||
|
||||
|
||||
@@ -53,12 +53,14 @@ export abstract class EditingSessionAction extends Action2 {
|
||||
return this.runEditingSessionAction(accessor, context.editingSession, context.chatWidget, ...args);
|
||||
}
|
||||
|
||||
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
||||
abstract runEditingSessionAction(accessor: ServicesAccessor, editingSession: IChatEditingSession, chatWidget: IChatWidget, ...args: unknown[]): any;
|
||||
}
|
||||
|
||||
/**
|
||||
* Resolve view title toolbar context. If none, return context from the lastFocusedWidget.
|
||||
*/
|
||||
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
||||
export function getEditingSessionContext(accessor: ServicesAccessor, args: any[]): { editingSession?: IChatEditingSession; chatWidget: IChatWidget } | undefined {
|
||||
const arg0 = args.at(0);
|
||||
const context = isChatViewTitleActionContext(arg0) ? arg0 : undefined;
|
||||
@@ -96,6 +98,7 @@ abstract class WorkingSetAction extends EditingSessionAction {
|
||||
return this.runWorkingSetAction(accessor, editingSession, chatWidget, ...uris);
|
||||
}
|
||||
|
||||
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
||||
abstract runWorkingSetAction(accessor: ServicesAccessor, editingSession: IChatEditingSession, chatWidget: IChatWidget | undefined, ...uris: URI[]): any;
|
||||
}
|
||||
|
||||
|
||||
@@ -82,9 +82,9 @@ export class ChatEditingService extends Disposable implements IChatEditingServic
|
||||
|
||||
// TODO@jrieken
|
||||
// some ugly casting so that this service can pass itself as argument instad as service dependeny
|
||||
// eslint-disable-next-line local/code-no-any-casts
|
||||
// eslint-disable-next-line local/code-no-any-casts, @typescript-eslint/no-explicit-any
|
||||
this._register(textModelService.registerTextModelContentProvider(ChatEditingTextModelContentProvider.scheme, _instantiationService.createInstance(ChatEditingTextModelContentProvider as any, this)));
|
||||
// eslint-disable-next-line local/code-no-any-casts
|
||||
// eslint-disable-next-line local/code-no-any-casts, @typescript-eslint/no-explicit-any
|
||||
this._register(textModelService.registerTextModelContentProvider(Schemas.chatEditingSnapshotScheme, _instantiationService.createInstance(ChatEditingSnapshotTextModelContentProvider as any, this)));
|
||||
|
||||
this._register(this._chatService.onDidDisposeSession((e) => {
|
||||
@@ -104,9 +104,11 @@ export class ChatEditingService extends Disposable implements IChatEditingServic
|
||||
this._register(extensionService.onDidChangeExtensions(setReadonlyFilesEnabled));
|
||||
|
||||
|
||||
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
||||
let storageTask: Promise<any> | undefined;
|
||||
|
||||
this._register(storageService.onWillSaveState(() => {
|
||||
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
||||
const tasks: Promise<any>[] = [];
|
||||
|
||||
for (const session of this.editingSessionsObs.get()) {
|
||||
|
||||
@@ -920,6 +920,7 @@ export class ChatSessionsService extends Disposable implements IChatSessionsServ
|
||||
*/
|
||||
public async getNewChatSessionItem(chatSessionType: string, options: {
|
||||
request: IChatAgentRequest;
|
||||
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
||||
metadata?: any;
|
||||
}, token: CancellationToken): Promise<IChatSessionItem> {
|
||||
if (!(await this.activateChatSessionItemProvider(chatSessionType))) {
|
||||
|
||||
@@ -68,7 +68,7 @@ export function extractTimestamp(item: IChatSessionItem): number | undefined {
|
||||
|
||||
// For other items, timestamp might already be set
|
||||
if ('timestamp' in item) {
|
||||
// eslint-disable-next-line local/code-no-any-casts
|
||||
// eslint-disable-next-line local/code-no-any-casts, @typescript-eslint/no-explicit-any
|
||||
return (item as any).timestamp;
|
||||
}
|
||||
|
||||
@@ -109,7 +109,9 @@ export function getSessionItemContextOverlay(
|
||||
provider?: IChatSessionItemProvider,
|
||||
chatService?: IChatService,
|
||||
editorGroupsService?: IEditorGroupsService
|
||||
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
||||
): [string, any][] {
|
||||
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
||||
const overlay: [string, any][] = [];
|
||||
if (provider) {
|
||||
overlay.push([ChatContextKeys.sessionType.key, provider.chatSessionType]);
|
||||
|
||||
@@ -86,6 +86,7 @@ export interface IGettingStartedItem {
|
||||
label: string;
|
||||
commandId: string;
|
||||
icon?: ThemeIcon;
|
||||
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
||||
args?: any[];
|
||||
}
|
||||
|
||||
|
||||
@@ -177,6 +177,7 @@ export class ChatDynamicVariableModel extends Disposable implements IChatWidgetC
|
||||
/**
|
||||
* Loose check to filter objects that are obviously missing data
|
||||
*/
|
||||
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
||||
function isDynamicVariable(obj: any): obj is IDynamicVariable {
|
||||
return obj &&
|
||||
typeof obj.id === 'string' &&
|
||||
@@ -194,6 +195,7 @@ export interface IAddDynamicVariableContext {
|
||||
command?: Command;
|
||||
}
|
||||
|
||||
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
||||
function isAddDynamicVariableContext(context: any): context is IAddDynamicVariableContext {
|
||||
return 'widget' in context &&
|
||||
'range' in context &&
|
||||
|
||||
@@ -669,6 +669,7 @@ export class Response extends AbstractResponse implements IDisposable {
|
||||
const uri = notebookUri ?? progress.uri;
|
||||
let found = false;
|
||||
const groupKind = progress.kind === 'textEdit' && !notebookUri ? 'textEditGroup' : 'notebookEditGroup';
|
||||
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
||||
const edits: any = groupKind === 'textEditGroup' ? progress.edits : progress.edits.map(edit => TextEdit.isTextEdit(edit) ? { uri: progress.uri, edit } : edit);
|
||||
const isExternalEdit = progress.isExternalEdit;
|
||||
for (let i = 0; !found && i < this._responseParts.length; i++) {
|
||||
@@ -1392,7 +1393,7 @@ function normalizeOldFields(raw: ISerializableChatDataIn): void {
|
||||
}
|
||||
}
|
||||
|
||||
// eslint-disable-next-line local/code-no-any-casts
|
||||
// eslint-disable-next-line @typescript-eslint/no-explicit-any, local/code-no-any-casts
|
||||
if ((raw.initialLocation as any) === 'editing-session') {
|
||||
raw.initialLocation = ChatAgentLocation.Chat;
|
||||
}
|
||||
@@ -1811,7 +1812,7 @@ export class ChatModel extends Disposable implements IChatModel {
|
||||
modelId: raw.modelId,
|
||||
});
|
||||
request.shouldBeRemovedOnSend = raw.isHidden ? { requestId: raw.requestId } : raw.shouldBeRemovedOnSend;
|
||||
// eslint-disable-next-line local/code-no-any-casts
|
||||
// eslint-disable-next-line @typescript-eslint/no-explicit-any, local/code-no-any-casts
|
||||
if (raw.response || raw.result || (raw as any).responseErrorDetails) {
|
||||
const agent = (raw.agent && 'metadata' in raw.agent) ? // Check for the new format, ignore entries in the old format
|
||||
reviveSerializedAgent(raw.agent) : undefined;
|
||||
@@ -2104,6 +2105,7 @@ export class ChatModel extends Disposable implements IChatModel {
|
||||
requests: this._requests.map((r): ISerializableChatRequestData => {
|
||||
const message = {
|
||||
...r.message,
|
||||
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
||||
parts: r.message.parts.map((p: any) => p && 'toJSON' in p ? (p.toJSON as Function)() : p)
|
||||
};
|
||||
const agent = r.response?.agent;
|
||||
@@ -2123,7 +2125,7 @@ export class ChatModel extends Disposable implements IChatModel {
|
||||
} else if (item.kind === 'confirmation') {
|
||||
return { ...item, isLive: false };
|
||||
} else {
|
||||
// eslint-disable-next-line local/code-no-any-casts
|
||||
// eslint-disable-next-line local/code-no-any-casts, @typescript-eslint/no-explicit-any
|
||||
return item as any; // TODO
|
||||
}
|
||||
})
|
||||
|
||||
@@ -42,6 +42,7 @@ export enum ChatErrorLevel {
|
||||
}
|
||||
|
||||
export interface IChatResponseErrorDetailsConfirmationButton {
|
||||
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
||||
data: any;
|
||||
label: string;
|
||||
isSecondary?: boolean;
|
||||
@@ -273,6 +274,7 @@ export interface IChatNotebookEdit {
|
||||
export interface IChatConfirmation {
|
||||
title: string;
|
||||
message: string | IMarkdownString;
|
||||
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
||||
data: any;
|
||||
/** Indicates whether this came from a current chat session (true/undefined) or a restored historic session (false) */
|
||||
isLive?: boolean;
|
||||
@@ -319,6 +321,7 @@ export interface IChatThinkingPart {
|
||||
kind: 'thinking';
|
||||
value?: string | string[];
|
||||
id?: string;
|
||||
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
||||
metadata?: { readonly [key: string]: any };
|
||||
generatedTitle?: string;
|
||||
}
|
||||
@@ -369,6 +372,7 @@ export interface ILegacyChatTerminalToolInvocationData {
|
||||
|
||||
export interface IChatToolInputInvocationData {
|
||||
kind: 'input';
|
||||
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
||||
rawInput: any;
|
||||
}
|
||||
|
||||
@@ -853,6 +857,7 @@ export interface IChatDynamicRequest {
|
||||
/**
|
||||
* Any extra metadata/context that will go to the provider.
|
||||
*/
|
||||
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
||||
metadata?: any;
|
||||
}
|
||||
|
||||
@@ -920,7 +925,9 @@ export interface IChatSendRequestOptions {
|
||||
parserContext?: IChatParserContext;
|
||||
attempt?: number;
|
||||
noCommandDetection?: boolean;
|
||||
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
||||
acceptedConfirmationData?: any[];
|
||||
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
||||
rejectedConfirmationData?: any[];
|
||||
attachedContext?: IChatRequestVariableEntry[];
|
||||
|
||||
|
||||
@@ -550,7 +550,7 @@ export class ChatService extends Disposable implements IChatService {
|
||||
// This handles the case where getName() is called before initialization completes
|
||||
// Access the internal synchronous index method via reflection
|
||||
// This is a workaround for the timing issue where initialization hasn't completed
|
||||
// eslint-disable-next-line local/code-no-any-casts
|
||||
// eslint-disable-next-line local/code-no-any-casts, @typescript-eslint/no-explicit-any
|
||||
const internalGetIndex = (this._chatSessionStore as any).internalGetIndex;
|
||||
if (typeof internalGetIndex === 'function') {
|
||||
const indexData = internalGetIndex.call(this._chatSessionStore);
|
||||
|
||||
@@ -126,6 +126,7 @@ export interface IChatSession extends IDisposable {
|
||||
requestHandler?: (
|
||||
request: IChatAgentRequest,
|
||||
progress: (progress: IChatProgress[]) => void,
|
||||
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
||||
history: any[], // TODO: Nail down types
|
||||
token: CancellationToken
|
||||
) => Promise<void>;
|
||||
@@ -137,6 +138,7 @@ export interface IChatSessionItemProvider {
|
||||
provideChatSessionItems(token: CancellationToken): Promise<IChatSessionItem[]>;
|
||||
provideNewChatSessionItem?(options: {
|
||||
request: IChatAgentRequest;
|
||||
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
||||
metadata?: any;
|
||||
}, token: CancellationToken): Promise<IChatSessionItem>;
|
||||
}
|
||||
@@ -177,6 +179,7 @@ export interface IChatSessionsService {
|
||||
|
||||
getNewChatSessionItem(chatSessionType: string, options: {
|
||||
request: IChatAgentRequest;
|
||||
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
||||
metadata?: any;
|
||||
}, token: CancellationToken): Promise<IChatSessionItem>;
|
||||
|
||||
|
||||
@@ -21,6 +21,7 @@ interface IChatHistoryEntry {
|
||||
|
||||
/** The collected input state for chat history entries */
|
||||
interface IChatInputState {
|
||||
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
||||
[key: string]: any;
|
||||
chatContextAttachments?: ReadonlyArray<IChatRequestVariableEntry>;
|
||||
|
||||
@@ -83,6 +84,7 @@ export class ChatWidgetHistoryService extends Disposable implements IChatWidgetH
|
||||
return history.map(entry => this.migrateHistoryEntry(entry));
|
||||
}
|
||||
|
||||
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
||||
private migrateHistoryEntry(entry: any): IChatModelInputState {
|
||||
// If it's already in the new format (has 'inputText' property), return as-is
|
||||
if (entry.inputText !== undefined) {
|
||||
|
||||
@@ -126,6 +126,7 @@ export namespace ToolDataSource {
|
||||
export interface IToolInvocation {
|
||||
callId: string;
|
||||
toolId: string;
|
||||
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
||||
parameters: Record<string, any>;
|
||||
tokenBudget?: number;
|
||||
context: IToolInvocationContext | undefined;
|
||||
@@ -146,11 +147,13 @@ export interface IToolInvocationContext {
|
||||
readonly sessionResource: URI;
|
||||
}
|
||||
|
||||
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
||||
export function isToolInvocationContext(obj: any): obj is IToolInvocationContext {
|
||||
return typeof obj === 'object' && typeof obj.sessionId === 'string' && URI.isUri(obj.sessionResource);
|
||||
}
|
||||
|
||||
export interface IToolInvocationPreparationContext {
|
||||
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
||||
parameters: any;
|
||||
chatRequestId?: string;
|
||||
chatSessionId?: string;
|
||||
@@ -187,10 +190,12 @@ export interface IToolResultOutputDetails {
|
||||
readonly output: { type: 'data'; mimeType: string; value: VSBuffer };
|
||||
}
|
||||
|
||||
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
||||
export function isToolResultInputOutputDetails(obj: any): obj is IToolResultInputOutputDetails {
|
||||
return typeof obj === 'object' && typeof obj?.input === 'string' && (typeof obj?.output === 'string' || Array.isArray(obj?.output));
|
||||
}
|
||||
|
||||
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
||||
export function isToolResultOutputDetails(obj: any): obj is IToolResultOutputDetails {
|
||||
return typeof obj === 'object' && typeof obj?.output === 'object' && typeof obj?.output?.mimeType === 'string' && obj?.output?.type === 'data';
|
||||
}
|
||||
@@ -262,6 +267,7 @@ export interface IToolConfirmationAction {
|
||||
label: string;
|
||||
disabled?: boolean;
|
||||
tooltip?: string;
|
||||
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
||||
data: any;
|
||||
}
|
||||
|
||||
|
||||
@@ -52,6 +52,7 @@ export interface IChatMessageThinkingPart {
|
||||
type: 'thinking';
|
||||
value: string | string[];
|
||||
id?: string;
|
||||
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
||||
metadata?: { readonly [key: string]: any };
|
||||
}
|
||||
|
||||
@@ -131,6 +132,7 @@ export interface IChatResponseToolUsePart {
|
||||
type: 'tool_use';
|
||||
name: string;
|
||||
toolCallId: string;
|
||||
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
||||
parameters: any;
|
||||
}
|
||||
|
||||
@@ -138,6 +140,7 @@ export interface IChatResponseThinkingPart {
|
||||
type: 'thinking';
|
||||
value: string | string[];
|
||||
id?: string;
|
||||
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
||||
metadata?: { readonly [key: string]: any };
|
||||
}
|
||||
|
||||
@@ -203,18 +206,21 @@ export namespace ILanguageModelChatMetadata {
|
||||
|
||||
export interface ILanguageModelChatResponse {
|
||||
stream: AsyncIterable<IChatResponsePart | IChatResponsePart[]>;
|
||||
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
||||
result: Promise<any>;
|
||||
}
|
||||
|
||||
export interface ILanguageModelChatProvider {
|
||||
readonly onDidChange: Event<void>;
|
||||
provideLanguageModelChatInfo(options: { silent: boolean }, token: CancellationToken): Promise<ILanguageModelChatMetadataAndIdentifier[]>;
|
||||
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
||||
sendChatRequest(modelId: string, messages: IChatMessage[], from: ExtensionIdentifier, options: { [name: string]: any }, token: CancellationToken): Promise<ILanguageModelChatResponse>;
|
||||
provideTokenCount(modelId: string, message: string | IChatMessage, token: CancellationToken): Promise<number>;
|
||||
}
|
||||
|
||||
export interface ILanguageModelChat {
|
||||
metadata: ILanguageModelChatMetadata;
|
||||
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
||||
sendChatRequest(messages: IChatMessage[], from: ExtensionIdentifier, options: { [name: string]: any }, token: CancellationToken): Promise<ILanguageModelChatResponse>;
|
||||
provideTokenCount(message: string | IChatMessage, token: CancellationToken): Promise<number>;
|
||||
}
|
||||
@@ -277,6 +283,7 @@ export interface ILanguageModelsService {
|
||||
|
||||
registerLanguageModelProvider(vendor: string, provider: ILanguageModelChatProvider): IDisposable;
|
||||
|
||||
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
||||
sendChatRequest(modelId: string, from: ExtensionIdentifier, messages: IChatMessage[], options: { [name: string]: any }, token: CancellationToken): Promise<ILanguageModelChatResponse>;
|
||||
|
||||
computeTokenLength(modelId: string, message: string | IChatMessage, token: CancellationToken): Promise<number>;
|
||||
@@ -547,6 +554,7 @@ export class LanguageModelsService implements ILanguageModelsService {
|
||||
});
|
||||
}
|
||||
|
||||
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
||||
async sendChatRequest(modelId: string, from: ExtensionIdentifier, messages: IChatMessage[], options: { [name: string]: any }, token: CancellationToken): Promise<ILanguageModelChatResponse> {
|
||||
const provider = this._providers.get(this._modelCache.get(modelId)?.vendor || '');
|
||||
if (!provider) {
|
||||
|
||||
@@ -387,6 +387,7 @@ export class PromptsService extends Disposable implements IPromptsService {
|
||||
const uri = promptPath.uri;
|
||||
const ast = await this.parseNew(uri, token);
|
||||
|
||||
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
||||
let metadata: any | undefined;
|
||||
if (ast.header) {
|
||||
const advanced = ast.header.getAttribute(PromptHeaderAttributes.advancedOptions);
|
||||
|
||||
@@ -30,6 +30,7 @@ export const TodoListToolDescriptionFieldSettingId = 'chat.todoListTool.descript
|
||||
export const ManageTodoListToolToolId = 'manage_todo_list';
|
||||
|
||||
export function createManageTodoListToolData(writeOnly: boolean, includeDescription: boolean = true): IToolData {
|
||||
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
||||
const baseProperties: any = {
|
||||
todoList: {
|
||||
type: 'array',
|
||||
@@ -120,6 +121,7 @@ export class ManageTodoListTool extends Disposable implements IToolImpl {
|
||||
super();
|
||||
}
|
||||
|
||||
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
||||
async invoke(invocation: IToolInvocation, _countTokens: any, _progress: any, _token: CancellationToken): Promise<IToolResult> {
|
||||
const args = invocation.parameters as IManageTodoListToolInputParams;
|
||||
// For: #263001 Use default sessionId
|
||||
|
||||
@@ -50,6 +50,7 @@ export class NullLanguageModelsService implements ILanguageModelsService {
|
||||
return [];
|
||||
}
|
||||
|
||||
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
||||
sendChatRequest(identifier: string, from: ExtensionIdentifier, messages: IChatMessage[], options: { [name: string]: any }, token: CancellationToken): Promise<ILanguageModelChatResponse> {
|
||||
throw new Error('Method not implemented.');
|
||||
}
|
||||
|
||||
@@ -49,6 +49,7 @@ export class MockLanguageModelToolsService implements ILanguageModelToolsService
|
||||
|
||||
}
|
||||
|
||||
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
||||
setToolAutoConfirmation(toolId: string, scope: any): void {
|
||||
|
||||
}
|
||||
|
||||
@@ -33,16 +33,23 @@ export class MockPromptsService implements IPromptsService {
|
||||
}
|
||||
|
||||
// Stub implementations for required interface methods
|
||||
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
||||
getSyntaxParserFor(_model: any): any { throw new Error('Not implemented'); }
|
||||
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
||||
listPromptFiles(_type: any): Promise<readonly any[]> { throw new Error('Not implemented'); }
|
||||
listPromptFilesForStorage(type: PromptsType, storage: PromptsStorage, token: CancellationToken): Promise<readonly IPromptPath[]> { throw new Error('Not implemented'); }
|
||||
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
||||
getSourceFolders(_type: any): readonly any[] { throw new Error('Not implemented'); }
|
||||
isValidSlashCommandName(_command: string): boolean { return false; }
|
||||
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
||||
resolvePromptSlashCommand(command: string, _token: CancellationToken): Promise<any> { throw new Error('Not implemented'); }
|
||||
get onDidChangeSlashCommands(): Event<void> { throw new Error('Not implemented'); }
|
||||
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
||||
getPromptSlashCommands(_token: CancellationToken): Promise<any[]> { throw new Error('Not implemented'); }
|
||||
getPromptSlashCommandName(uri: URI, _token: CancellationToken): Promise<string> { throw new Error('Not implemented'); }
|
||||
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
||||
parse(_uri: URI, _type: any, _token: CancellationToken): Promise<any> { throw new Error('Not implemented'); }
|
||||
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
||||
parseNew(_uri: URI, _token: CancellationToken): Promise<any> { throw new Error('Not implemented'); }
|
||||
getParsedPromptFile(textModel: ITextModel): ParsedPromptFile { throw new Error('Not implemented'); }
|
||||
registerContributedFile(type: PromptsType, name: string, description: string, uri: URI, extension: IExtensionDescription): IDisposable { throw new Error('Not implemented'); }
|
||||
|
||||
Reference in New Issue
Block a user