Skip to content

Commit a289e64

Browse files
authored
Switch to finalized TS protocol types (microsoft#152259)
1 parent 8fb977f commit a289e64

File tree

2 files changed

+3
-30
lines changed

2 files changed

+3
-30
lines changed

extensions/typescript-language-features/src/languageFeatures/sourceDefinition.ts

Lines changed: 2 additions & 30 deletions
Original file line numberDiff line numberDiff line change
@@ -6,41 +6,13 @@
66
import * as vscode from 'vscode';
77
import * as nls from 'vscode-nls';
88
import { Command, CommandManager } from '../commands/commandManager';
9-
import * as Proto from '../protocol';
10-
import { ExecConfig, ITypeScriptServiceClient, ServerResponse } from '../typescriptService';
9+
import { ITypeScriptServiceClient } from '../typescriptService';
1110
import API from '../utils/api';
1211
import { isSupportedLanguageMode } from '../utils/languageIds';
1312
import * as typeConverters from '../utils/typeConverters';
1413

1514
const localize = nls.loadMessageBundle();
1615

17-
namespace ExperimentalProto {
18-
export const enum CommandTypes {
19-
FindSourceDefinition = 'findSourceDefinition'
20-
}
21-
22-
export interface SourceDefinitionRequestArgs extends Proto.FileLocationRequestArgs { }
23-
24-
export interface SourceDefinitionRequest extends Proto.Request {
25-
command: CommandTypes.FindSourceDefinition;
26-
arguments: SourceDefinitionRequestArgs;
27-
}
28-
29-
export interface InlayHintsResponse extends Proto.DefinitionResponse { }
30-
31-
export interface IExtendedTypeScriptServiceClient {
32-
execute<K extends keyof ExtendedTsServerRequests>(
33-
command: K,
34-
args: ExtendedTsServerRequests[K][0],
35-
token: vscode.CancellationToken,
36-
config?: ExecConfig
37-
): Promise<ServerResponse.Response<ExtendedTsServerRequests[K][1]>>;
38-
}
39-
40-
export interface ExtendedTsServerRequests {
41-
'findSourceDefinition': [SourceDefinitionRequestArgs, InlayHintsResponse];
42-
}
43-
}
4416

4517
class SourceDefinitionCommand implements Command {
4618

@@ -85,7 +57,7 @@ class SourceDefinitionCommand implements Command {
8557

8658
const position = activeEditor.selection.anchor;
8759
const args = typeConverters.Position.toFileLocationRequestArgs(openedFiledPath, position);
88-
const response = await (this.client as ExperimentalProto.IExtendedTypeScriptServiceClient).execute('findSourceDefinition', args, token);
60+
const response = await this.client.execute('findSourceDefinition', args, token);
8961
if (response.type === 'response' && response.body) {
9062
const locations: vscode.Location[] = response.body.map(reference =>
9163
typeConverters.Location.fromTextSpan(this.client.toResource(reference.file), reference));

extensions/typescript-language-features/src/typescriptService.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -73,6 +73,7 @@ interface StandardTsServerRequests {
7373
'fileReferences': [Proto.FileRequestArgs, Proto.FileReferencesResponse];
7474
'provideInlayHints': [Proto.InlayHintsRequestArgs, Proto.InlayHintsResponse];
7575
'encodedSemanticClassifications-full': [Proto.EncodedSemanticClassificationsRequestArgs, Proto.EncodedSemanticClassificationsResponse];
76+
'findSourceDefinition': [Proto.FileLocationRequestArgs, Proto.DefinitionResponse];
7677
}
7778

7879
interface NoResponseTsServerRequests {

0 commit comments

Comments
 (0)