|
6 | 6 | import * as vscode from 'vscode';
|
7 | 7 | import * as nls from 'vscode-nls';
|
8 | 8 | import { Command, CommandManager } from '../commands/commandManager';
|
9 |
| -import * as Proto from '../protocol'; |
10 |
| -import { ExecConfig, ITypeScriptServiceClient, ServerResponse } from '../typescriptService'; |
| 9 | +import { ITypeScriptServiceClient } from '../typescriptService'; |
11 | 10 | import API from '../utils/api';
|
12 | 11 | import { isSupportedLanguageMode } from '../utils/languageIds';
|
13 | 12 | import * as typeConverters from '../utils/typeConverters';
|
14 | 13 |
|
15 | 14 | const localize = nls.loadMessageBundle();
|
16 | 15 |
|
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 |
| -} |
44 | 16 |
|
45 | 17 | class SourceDefinitionCommand implements Command {
|
46 | 18 |
|
@@ -85,7 +57,7 @@ class SourceDefinitionCommand implements Command {
|
85 | 57 |
|
86 | 58 | const position = activeEditor.selection.anchor;
|
87 | 59 | 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); |
89 | 61 | if (response.type === 'response' && response.body) {
|
90 | 62 | const locations: vscode.Location[] = response.body.map(reference =>
|
91 | 63 | typeConverters.Location.fromTextSpan(this.client.toResource(reference.file), reference));
|
|
0 commit comments