equal
deleted
inserted
replaced
32 line?: number |
32 line?: number |
33 character?: number |
33 character?: number |
34 } |
34 } |
35 |
35 |
36 const caret_update_type = new NotificationType<Caret_Update, void>("PIDE/caret_update") |
36 const caret_update_type = new NotificationType<Caret_Update, void>("PIDE/caret_update") |
37 const dynamic_output_type = new NotificationType<string, void>("PIDE/dynamic_output") |
37 let last_caret_update: Caret_Update = {} |
38 |
38 |
39 let last_caret_update: Caret_Update = {} |
39 |
|
40 interface Dynamic_Output |
|
41 { |
|
42 body: string |
|
43 } |
|
44 |
|
45 const dynamic_output_type = new NotificationType<Dynamic_Output, void>("PIDE/dynamic_output") |
|
46 |
40 |
47 |
41 |
48 |
42 /* activate extension */ |
49 /* activate extension */ |
43 |
50 |
44 export function activate(context: vscode.ExtensionContext) |
51 export function activate(context: vscode.ExtensionContext) |
97 } |
104 } |
98 |
105 |
99 client.onReady().then(() => |
106 client.onReady().then(() => |
100 { |
107 { |
101 client.onNotification(dynamic_output_type, |
108 client.onNotification(dynamic_output_type, |
102 body => { |
109 params => { dynamic_output.clear(); dynamic_output.appendLine(params.body) }) |
103 if (body) { |
|
104 dynamic_output.clear() |
|
105 dynamic_output.appendLine(body) |
|
106 } |
|
107 }) |
|
108 vscode.window.onDidChangeActiveTextEditor(_ => update_caret()) |
110 vscode.window.onDidChangeActiveTextEditor(_ => update_caret()) |
109 vscode.window.onDidChangeTextEditorSelection(_ => update_caret()) |
111 vscode.window.onDidChangeTextEditorSelection(_ => update_caret()) |
110 update_caret() |
112 update_caret() |
111 }) |
113 }) |
112 |
114 |