|
3 | 3 | * Licensed under the MIT License. See License.txt in the project root for license information.
|
4 | 4 | *--------------------------------------------------------------------------------------------*/
|
5 | 5 |
|
6 |
| -import { |
7 |
| - FormattingOptions, |
8 |
| - InsertTextFormat, |
9 |
| - MessageDirection, |
10 |
| - NotificationType, |
11 |
| - Position, |
12 |
| - RequestType, |
13 |
| - RequestType0, |
14 |
| - TextDocumentIdentifier, |
15 |
| - TextEdit, |
16 |
| - URI, |
17 |
| - integer, |
18 |
| -} from 'vscode-languageserver-protocol'; |
| 6 | +import * as lsp from 'vscode-languageserver-protocol'; |
19 | 7 |
|
20 | 8 | export interface WorkspaceDebugConfigurationParams {
|
21 | 9 | /**
|
22 | 10 | * Workspace path containing the solution/projects to get debug information for.
|
23 | 11 | * This will be important eventually for multi-workspace support.
|
24 | 12 | * If not provided, configurations are returned for the workspace the server was initialized for.
|
25 | 13 | */
|
26 |
| - workspacePath: URI | undefined; |
| 14 | + workspacePath: lsp.URI | undefined; |
27 | 15 | }
|
28 | 16 |
|
29 | 17 | export interface ProjectDebugConfiguration {
|
@@ -59,44 +47,96 @@ export interface ProjectDebugConfiguration {
|
59 | 47 | }
|
60 | 48 |
|
61 | 49 | export interface OnAutoInsertParams {
|
62 |
| - _vs_textDocument: TextDocumentIdentifier; |
63 |
| - _vs_position: Position; |
| 50 | + _vs_textDocument: lsp.TextDocumentIdentifier; |
| 51 | + _vs_position: lsp.Position; |
64 | 52 | _vs_ch: string;
|
65 |
| - _vs_options: FormattingOptions; |
| 53 | + _vs_options: lsp.FormattingOptions; |
66 | 54 | }
|
67 | 55 |
|
68 | 56 | export interface OnAutoInsertResponseItem {
|
69 |
| - _vs_textEditFormat: InsertTextFormat; |
70 |
| - _vs_textEdit: TextEdit; |
| 57 | + _vs_textEditFormat: lsp.InsertTextFormat; |
| 58 | + _vs_textEdit: lsp.TextEdit; |
71 | 59 | }
|
72 | 60 |
|
73 | 61 | export interface RegisterSolutionSnapshotResponseItem {
|
74 | 62 | /**
|
75 | 63 | * Represents a solution snapshot.
|
76 | 64 | */
|
77 |
| - id: integer; |
| 65 | + id: lsp.integer; |
| 66 | +} |
| 67 | + |
| 68 | +export interface RunTestsParams extends lsp.WorkDoneProgressParams, lsp.PartialResultParams { |
| 69 | + /** |
| 70 | + * The text document containing the tests to run. |
| 71 | + */ |
| 72 | + textDocument: lsp.TextDocumentIdentifier; |
| 73 | + |
| 74 | + /** |
| 75 | + * The range encompasing the test methods to run. |
| 76 | + * Note that this does not have to only include tests, for example this could be a range representing a class. |
| 77 | + */ |
| 78 | + range: lsp.Range; |
| 79 | +} |
| 80 | + |
| 81 | +export interface TestProgress { |
| 82 | + /** |
| 83 | + * The total number of tests passed at the time of the report. |
| 84 | + */ |
| 85 | + testsPassed: number; |
| 86 | + /** |
| 87 | + * The total number of tests failed at the time of the report. |
| 88 | + */ |
| 89 | + testsFailed: number; |
| 90 | + /** |
| 91 | + * The total number of tests skipped at the time of the report. |
| 92 | + */ |
| 93 | + testsSkipped: number; |
| 94 | + /** |
| 95 | + * The total number of tests that will eventually be run. |
| 96 | + */ |
| 97 | + totalTests: number; |
| 98 | +} |
| 99 | + |
| 100 | +export interface RunTestsPartialResult { |
| 101 | + stage: string; |
| 102 | + message: string; |
| 103 | + progress?: TestProgress; |
78 | 104 | }
|
79 | 105 |
|
80 | 106 | export namespace WorkspaceDebugConfigurationRequest {
|
81 | 107 | export const method = 'workspace/debugConfiguration';
|
82 |
| - export const messageDirection: MessageDirection = MessageDirection.clientToServer; |
83 |
| - export const type = new RequestType<WorkspaceDebugConfigurationParams, ProjectDebugConfiguration[], void>(method); |
| 108 | + export const messageDirection: lsp.MessageDirection = lsp.MessageDirection.clientToServer; |
| 109 | + export const type = new lsp.RequestType<WorkspaceDebugConfigurationParams, ProjectDebugConfiguration[], void>( |
| 110 | + method |
| 111 | + ); |
84 | 112 | }
|
85 | 113 |
|
86 | 114 | export namespace OnAutoInsertRequest {
|
87 | 115 | export const method = 'textDocument/_vs_onAutoInsert';
|
88 |
| - export const messageDirection: MessageDirection = MessageDirection.clientToServer; |
89 |
| - export const type = new RequestType<OnAutoInsertParams, OnAutoInsertResponseItem, void>(method); |
| 116 | + export const messageDirection: lsp.MessageDirection = lsp.MessageDirection.clientToServer; |
| 117 | + export const type = new lsp.RequestType<OnAutoInsertParams, OnAutoInsertResponseItem, void>(method); |
90 | 118 | }
|
91 | 119 |
|
92 | 120 | export namespace RegisterSolutionSnapshotRequest {
|
93 | 121 | export const method = 'workspace/_vs_registerSolutionSnapshot';
|
94 |
| - export const messageDirection: MessageDirection = MessageDirection.clientToServer; |
95 |
| - export const type = new RequestType0<RegisterSolutionSnapshotResponseItem, void>(method); |
| 122 | + export const messageDirection: lsp.MessageDirection = lsp.MessageDirection.clientToServer; |
| 123 | + export const type = new lsp.RequestType0<RegisterSolutionSnapshotResponseItem, void>(method); |
96 | 124 | }
|
97 | 125 |
|
98 | 126 | export namespace ProjectInitializationCompleteNotification {
|
99 | 127 | export const method = 'workspace/projectInitializationComplete';
|
100 |
| - export const messageDirection: MessageDirection = MessageDirection.serverToClient; |
101 |
| - export const type = new NotificationType(method); |
| 128 | + export const messageDirection: lsp.MessageDirection = lsp.MessageDirection.serverToClient; |
| 129 | + export const type = new lsp.NotificationType(method); |
| 130 | +} |
| 131 | + |
| 132 | +export namespace RunTestsRequest { |
| 133 | + export const method = 'textDocument/runTests'; |
| 134 | + export const messageDirection: lsp.MessageDirection = lsp.MessageDirection.clientToServer; |
| 135 | + export const type = new lsp.ProtocolRequestType< |
| 136 | + RunTestsParams, |
| 137 | + RunTestsPartialResult[], |
| 138 | + RunTestsPartialResult, |
| 139 | + void, |
| 140 | + void |
| 141 | + >(method); |
102 | 142 | }
|
0 commit comments