Skip to content

Commit 055a535

Browse files
committed
changes to socket client
1 parent fc1b6bc commit 055a535

3 files changed

Lines changed: 93 additions & 363 deletions

File tree

src/client/jedi/commands.ts

Lines changed: 25 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -1,25 +1,32 @@
11
"use strict";
22

33
export class Commands {
4-
public static ExitCommandBytes: Buffer = new Buffer("exit");
5-
public static PingBytes: Buffer = new Buffer("ping");
6-
public static ListKernelSpecsBytes: Buffer = new Buffer("lsks");
7-
public static StartKernelBytes: Buffer = new Buffer("strk");
8-
public static ShutdownKernelBytes: Buffer = new Buffer("stpk");
9-
public static RestartKernelBytes: Buffer = new Buffer("rstk");
10-
public static InterruptKernelBytes: Buffer = new Buffer("itpk");
11-
public static RunCodeBytes: Buffer = new Buffer("run ");
4+
public static Exit: Buffer = new Buffer("exit");
5+
public static Ping: Buffer = new Buffer("ping");
6+
public static Arguments = new Buffer("args");
7+
public static Completions = new Buffer("comp");
8+
public static Definitions = new Buffer("defs");
9+
public static Hover = new Buffer("hovr");
10+
public static Usages = new Buffer("usaaag");
11+
public static Names = new Buffer("name");
1212
}
1313

1414
export namespace ResponseCommands {
15-
export const Pong = 'PONG';
16-
export const ListKernelsSpecs = 'LSKS';
17-
export const Error = 'EROR';
18-
export const KernelStarted = 'STRK';
19-
export const KernelShutdown = 'STPK';
20-
export const KernelRestarted = 'RSTK';
21-
export const KernelInterrupted = 'ITPK';
22-
export const RunCode = 'RUN ';
23-
export const ShellResult = 'SHEL';
24-
export const IOPUBMessage = 'IOPB';
15+
export const Pong = 'pong';
16+
export const Error = 'eror';
17+
export const Arguments = "args";
18+
export const Completions = "comp";
19+
export const Definitions = "defs";
20+
export const Hover = "hovr";
21+
export const Usages = "usag";
22+
export const Names = "name";
2523
}
24+
25+
/*
26+
commandNames.set(CommandType.Arguments, "arguments");
27+
commandNames.set(CommandType.Completions, "completions");
28+
commandNames.set(CommandType.Definitions, "definitions");
29+
commandNames.set(CommandType.Hover, "tooltip");
30+
commandNames.set(CommandType.Usages, "usages");
31+
commandNames.set(CommandType.Symbols, "names");
32+
*/

src/client/jedi/contracts.ts

Lines changed: 0 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,16 +1,8 @@
11
"use strict";
22

3-
import { KernelspecMetadata, Kernelspec, ParsedIOMessage } from '../contracts';
43
import * as Rx from 'rx';
54

65
export interface IJupyterClientAdapter {
7-
getAllKernelSpecs(): Promise<{ [key: string]: Kernelspec }>;
8-
startKernel(kernelSpec: KernelspecMetadata): Promise<[string, any, string]>;
9-
shutdownkernel(kernelUUID: string): Promise<any>;
10-
interruptKernel(kernelUUID: string): Promise<any>;
11-
restartKernel(kernelUUID: string): Promise<any>;
12-
runCode(code: string): Rx.IObservable<ParsedIOMessage>;
13-
on(event: string | symbol, listener: Function): this;
146
}
157

168
export enum KernelCommand {

0 commit comments

Comments
 (0)