mirror of
https://github.com/microsoft/vscode.git
synced 2026-04-27 12:04:04 +01:00
Merge branch 'main' into organizeImportsSettingsFix
This commit is contained in:
@@ -16,7 +16,7 @@ export class TSServerRequestCommand implements Command {
|
||||
private readonly lazyClientHost: Lazy<TypeScriptServiceClientHost>
|
||||
) { }
|
||||
|
||||
public execute(requestID: keyof TypeScriptRequests, args?: any, config?: any) {
|
||||
public execute(command: keyof TypeScriptRequests, args?: any, config?: any) {
|
||||
// A cancellation token cannot be passed through the command infrastructure
|
||||
const token = nulToken;
|
||||
|
||||
@@ -36,8 +36,11 @@ export class TSServerRequestCommand implements Command {
|
||||
'completionInfo'
|
||||
];
|
||||
|
||||
if (!allowList.includes(requestID)) { return; }
|
||||
return this.lazyClientHost.value.serviceClient.execute(requestID, args, token, config);
|
||||
if (!allowList.includes(command) || command.startsWith('_')) {
|
||||
return;
|
||||
}
|
||||
|
||||
return this.lazyClientHost.value.serviceClient.execute(command, args, token, config);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -70,12 +70,10 @@ export function register(
|
||||
if (!file) {
|
||||
return { entries: [] };
|
||||
}
|
||||
// @ts-expect-error until ts5.7
|
||||
const response = await client.execute('copilotRelated', { file, }, token) as Proto.CopilotRelatedResponse;
|
||||
if (response.type !== 'response' || !response.body) {
|
||||
return { entries: [] };
|
||||
}
|
||||
// @ts-expect-error until ts5.7
|
||||
return { entries: response.body.relatedFiles.map(f => client.toResource(f)), traits: [] };
|
||||
}));
|
||||
}
|
||||
|
||||
@@ -19,18 +19,5 @@ declare module '../../../../node_modules/typescript/lib/typescript' {
|
||||
interface Response {
|
||||
readonly _serverType?: ServerType;
|
||||
}
|
||||
|
||||
//#region PreparePasteEdits
|
||||
interface PreparePasteEditsRequest extends FileRequest {
|
||||
command: 'preparePasteEdits';
|
||||
arguments: PreparePasteEditsRequestArgs;
|
||||
}
|
||||
interface PreparePasteEditsRequestArgs extends FileRequestArgs {
|
||||
copiedTextSpan: TextSpan[];
|
||||
}
|
||||
interface PreparePasteEditsResponse extends Response {
|
||||
body: boolean;
|
||||
}
|
||||
//#endregion
|
||||
}
|
||||
}
|
||||
|
||||
@@ -77,7 +77,6 @@ interface StandardTsServerRequests {
|
||||
'getMoveToRefactoringFileSuggestions': [Proto.GetMoveToRefactoringFileSuggestionsRequestArgs, Proto.GetMoveToRefactoringFileSuggestions];
|
||||
'linkedEditingRange': [Proto.FileLocationRequestArgs, Proto.LinkedEditingRangeResponse];
|
||||
'mapCode': [Proto.MapCodeRequestArgs, Proto.MapCodeResponse];
|
||||
// @ts-expect-error until ts5.7
|
||||
'copilotRelated': [Proto.FileRequestArgs, Proto.CopilotRelatedResponse];
|
||||
'getPasteEdits': [Proto.GetPasteEditsRequestArgs, Proto.GetPasteEditsResponse];
|
||||
'preparePasteEdits': [Proto.PreparePasteEditsRequestArgs, Proto.PreparePasteEditsResponse];
|
||||
|
||||
Reference in New Issue
Block a user