Skip to content

Commit 1a9d740

Browse files
committed
changes to socket client
1 parent 1a4be4f commit 1a9d740

1 file changed

Lines changed: 2 additions & 19 deletions

File tree

src/client/jedi/socketClient.ts

Lines changed: 2 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -18,22 +18,6 @@ import { OutputChannel, CancellationToken } from 'vscode';
1818
public static Names = new Buffer("name");
1919
*/
2020

21-
export enum Command {
22-
Signature,
23-
Completions,
24-
HoverDefinition,
25-
Usages,
26-
Definitions,
27-
Symbols
28-
}
29-
30-
const commandMapping = new Map<Command, Buffer>();
31-
commandMapping.set(Command.Signature, Commands.Arguments);
32-
commandMapping.set(Command.Completions, Commands.Completions);
33-
commandMapping.set(Command.Definitions, Commands.Definitions);
34-
commandMapping.set(Command.HoverDefinition, Commands.Hover);
35-
commandMapping.set(Command.Usages, Commands.Usages);
36-
commandMapping.set(Command.Symbols, Commands.Names);
3721

3822
export class SocketClient extends SocketCallbackHandler {
3923
constructor(socketServer: SocketServer, private outputChannel: OutputChannel) {
@@ -50,11 +34,10 @@ export class SocketClient extends SocketCallbackHandler {
5034

5135
this.idDispenser = new IdDispenser();
5236
}
53-
public getResult<T>(command: Command, token: CancellationToken, fileName: string, columnIndex: number, lineIndex: number, source: string): Promise<T> {
54-
const cmd = commandMapping.get(command);
37+
public getResult<T>(command: Buffer, token: CancellationToken, fileName: string, columnIndex: number, lineIndex: number, source: string): Promise<T> {
5538

5639
const [def, id] = this.createId<T>(token);
57-
this.SendRawCommand(cmd);
40+
this.SendRawCommand(command);
5841
this.stream.WriteString(id);
5942

6043
this.stream.WriteString(fileName);

0 commit comments

Comments
 (0)