typescript-language-server 3.0.1 → 3.0.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (220) hide show
  1. package/CHANGELOG.md +12 -0
  2. package/lib/cli.mjs +3 -0
  3. package/lib/cli.mjs.map +1 -0
  4. package/package.json +37 -31
  5. package/lib/cli.d.ts +0 -3
  6. package/lib/cli.d.ts.map +0 -1
  7. package/lib/cli.js +0 -37
  8. package/lib/cli.js.map +0 -1
  9. package/lib/commands.d.ts +0 -13
  10. package/lib/commands.d.ts.map +0 -1
  11. package/lib/commands.js +0 -20
  12. package/lib/commands.js.map +0 -1
  13. package/lib/completion.d.ts +0 -10
  14. package/lib/completion.d.ts.map +0 -1
  15. package/lib/completion.js +0 -388
  16. package/lib/completion.js.map +0 -1
  17. package/lib/configuration-manager.d.ts +0 -48
  18. package/lib/configuration-manager.d.ts.map +0 -1
  19. package/lib/configuration-manager.js +0 -138
  20. package/lib/configuration-manager.js.map +0 -1
  21. package/lib/diagnostic-queue.d.ts +0 -31
  22. package/lib/diagnostic-queue.d.ts.map +0 -1
  23. package/lib/diagnostic-queue.js +0 -70
  24. package/lib/diagnostic-queue.js.map +0 -1
  25. package/lib/document-symbol.d.ts +0 -6
  26. package/lib/document-symbol.d.ts.map +0 -1
  27. package/lib/document-symbol.js +0 -85
  28. package/lib/document-symbol.js.map +0 -1
  29. package/lib/document.d.ts +0 -34
  30. package/lib/document.d.ts.map +0 -1
  31. package/lib/document.js +0 -115
  32. package/lib/document.js.map +0 -1
  33. package/lib/features/call-hierarchy.d.ts +0 -7
  34. package/lib/features/call-hierarchy.d.ts.map +0 -1
  35. package/lib/features/call-hierarchy.js +0 -81
  36. package/lib/features/call-hierarchy.js.map +0 -1
  37. package/lib/features/call-hierarchy.spec.d.ts +0 -2
  38. package/lib/features/call-hierarchy.spec.d.ts.map +0 -1
  39. package/lib/features/call-hierarchy.spec.js +0 -107
  40. package/lib/features/call-hierarchy.spec.js.map +0 -1
  41. package/lib/features/fix-all.d.ts +0 -12
  42. package/lib/features/fix-all.d.ts.map +0 -1
  43. package/lib/features/fix-all.js +0 -156
  44. package/lib/features/fix-all.js.map +0 -1
  45. package/lib/features/inlay-hints.d.ts +0 -11
  46. package/lib/features/inlay-hints.d.ts.map +0 -1
  47. package/lib/features/inlay-hints.js +0 -71
  48. package/lib/features/inlay-hints.js.map +0 -1
  49. package/lib/features/semantic-tokens.d.ts +0 -9
  50. package/lib/features/semantic-tokens.d.ts.map +0 -1
  51. package/lib/features/semantic-tokens.js +0 -43
  52. package/lib/features/semantic-tokens.js.map +0 -1
  53. package/lib/features/source-definition.d.ts +0 -11
  54. package/lib/features/source-definition.d.ts.map +0 -1
  55. package/lib/features/source-definition.js +0 -51
  56. package/lib/features/source-definition.js.map +0 -1
  57. package/lib/file-lsp-server.spec.d.ts +0 -2
  58. package/lib/file-lsp-server.spec.d.ts.map +0 -1
  59. package/lib/file-lsp-server.spec.js +0 -64
  60. package/lib/file-lsp-server.spec.js.map +0 -1
  61. package/lib/hover.d.ts +0 -6
  62. package/lib/hover.d.ts.map +0 -1
  63. package/lib/hover.js +0 -80
  64. package/lib/hover.js.map +0 -1
  65. package/lib/lsp-client.d.ts +0 -26
  66. package/lib/lsp-client.d.ts.map +0 -1
  67. package/lib/lsp-client.js +0 -51
  68. package/lib/lsp-client.js.map +0 -1
  69. package/lib/lsp-connection.d.ts +0 -9
  70. package/lib/lsp-connection.d.ts.map +0 -1
  71. package/lib/lsp-connection.js +0 -54
  72. package/lib/lsp-connection.js.map +0 -1
  73. package/lib/lsp-server.d.ts +0 -86
  74. package/lib/lsp-server.d.ts.map +0 -1
  75. package/lib/lsp-server.js +0 -1168
  76. package/lib/lsp-server.js.map +0 -1
  77. package/lib/lsp-server.spec.d.ts +0 -2
  78. package/lib/lsp-server.spec.d.ts.map +0 -1
  79. package/lib/lsp-server.spec.js +0 -2106
  80. package/lib/lsp-server.spec.js.map +0 -1
  81. package/lib/organize-imports.d.ts +0 -5
  82. package/lib/organize-imports.d.ts.map +0 -1
  83. package/lib/organize-imports.js +0 -19
  84. package/lib/organize-imports.js.map +0 -1
  85. package/lib/organize-imports.spec.d.ts +0 -2
  86. package/lib/organize-imports.spec.d.ts.map +0 -1
  87. package/lib/organize-imports.spec.js +0 -38
  88. package/lib/organize-imports.spec.js.map +0 -1
  89. package/lib/protocol-translation.d.ts +0 -26
  90. package/lib/protocol-translation.d.ts.map +0 -1
  91. package/lib/protocol-translation.js +0 -184
  92. package/lib/protocol-translation.js.map +0 -1
  93. package/lib/quickfix.d.ts +0 -5
  94. package/lib/quickfix.d.ts.map +0 -1
  95. package/lib/quickfix.js +0 -20
  96. package/lib/quickfix.js.map +0 -1
  97. package/lib/refactor.d.ts +0 -6
  98. package/lib/refactor.d.ts.map +0 -1
  99. package/lib/refactor.js +0 -58
  100. package/lib/refactor.js.map +0 -1
  101. package/lib/test-utils.d.ts +0 -45
  102. package/lib/test-utils.d.ts.map +0 -1
  103. package/lib/test-utils.js +0 -185
  104. package/lib/test-utils.js.map +0 -1
  105. package/lib/ts-protocol.d.ts +0 -93
  106. package/lib/ts-protocol.d.ts.map +0 -1
  107. package/lib/ts-protocol.js +0 -66
  108. package/lib/ts-protocol.js.map +0 -1
  109. package/lib/tsServer/callbackMap.d.ts +0 -17
  110. package/lib/tsServer/callbackMap.d.ts.map +0 -1
  111. package/lib/tsServer/callbackMap.js +0 -47
  112. package/lib/tsServer/callbackMap.js.map +0 -1
  113. package/lib/tsServer/cancellation.d.ts +0 -22
  114. package/lib/tsServer/cancellation.d.ts.map +0 -1
  115. package/lib/tsServer/cancellation.js +0 -51
  116. package/lib/tsServer/cancellation.js.map +0 -1
  117. package/lib/tsServer/logDirectoryProvider.d.ts +0 -13
  118. package/lib/tsServer/logDirectoryProvider.d.ts.map +0 -1
  119. package/lib/tsServer/logDirectoryProvider.js +0 -49
  120. package/lib/tsServer/logDirectoryProvider.js.map +0 -1
  121. package/lib/tsServer/requestQueue.d.ts +0 -34
  122. package/lib/tsServer/requestQueue.d.ts.map +0 -1
  123. package/lib/tsServer/requestQueue.js +0 -74
  124. package/lib/tsServer/requestQueue.js.map +0 -1
  125. package/lib/tsServer/requests.d.ts +0 -73
  126. package/lib/tsServer/requests.d.ts.map +0 -1
  127. package/lib/tsServer/requests.js +0 -30
  128. package/lib/tsServer/requests.js.map +0 -1
  129. package/lib/tsServer/server.d.ts +0 -100
  130. package/lib/tsServer/server.d.ts.map +0 -1
  131. package/lib/tsServer/server.js +0 -216
  132. package/lib/tsServer/server.js.map +0 -1
  133. package/lib/tsServer/serverError.d.ts +0 -18
  134. package/lib/tsServer/serverError.d.ts.map +0 -1
  135. package/lib/tsServer/serverError.js +0 -53
  136. package/lib/tsServer/serverError.js.map +0 -1
  137. package/lib/tsServer/serverProcess.d.ts +0 -7
  138. package/lib/tsServer/serverProcess.d.ts.map +0 -1
  139. package/lib/tsServer/serverProcess.js +0 -244
  140. package/lib/tsServer/serverProcess.js.map +0 -1
  141. package/lib/tsServer/spawner.d.ts +0 -19
  142. package/lib/tsServer/spawner.d.ts.map +0 -1
  143. package/lib/tsServer/spawner.js +0 -130
  144. package/lib/tsServer/spawner.js.map +0 -1
  145. package/lib/tsServer/tracer.d.ts +0 -26
  146. package/lib/tsServer/tracer.d.ts.map +0 -1
  147. package/lib/tsServer/tracer.js +0 -80
  148. package/lib/tsServer/tracer.js.map +0 -1
  149. package/lib/tsServer/versionProvider.d.ts +0 -29
  150. package/lib/tsServer/versionProvider.d.ts.map +0 -1
  151. package/lib/tsServer/versionProvider.js +0 -161
  152. package/lib/tsServer/versionProvider.js.map +0 -1
  153. package/lib/tsp-client.d.ts +0 -53
  154. package/lib/tsp-client.d.ts.map +0 -1
  155. package/lib/tsp-client.js +0 -228
  156. package/lib/tsp-client.js.map +0 -1
  157. package/lib/tsp-client.spec.d.ts +0 -2
  158. package/lib/tsp-client.spec.d.ts.map +0 -1
  159. package/lib/tsp-client.spec.js +0 -113
  160. package/lib/tsp-client.spec.js.map +0 -1
  161. package/lib/utils/MarkdownString.d.ts +0 -15
  162. package/lib/utils/MarkdownString.d.ts.map +0 -1
  163. package/lib/utils/MarkdownString.js +0 -45
  164. package/lib/utils/MarkdownString.js.map +0 -1
  165. package/lib/utils/SnippetString.d.ts +0 -12
  166. package/lib/utils/SnippetString.d.ts.map +0 -1
  167. package/lib/utils/SnippetString.js +0 -66
  168. package/lib/utils/SnippetString.js.map +0 -1
  169. package/lib/utils/api.d.ts +0 -49
  170. package/lib/utils/api.d.ts.map +0 -1
  171. package/lib/utils/api.js +0 -77
  172. package/lib/utils/api.js.map +0 -1
  173. package/lib/utils/configuration.d.ts +0 -20
  174. package/lib/utils/configuration.d.ts.map +0 -1
  175. package/lib/utils/configuration.js +0 -47
  176. package/lib/utils/configuration.js.map +0 -1
  177. package/lib/utils/errorCodes.d.ts +0 -12
  178. package/lib/utils/errorCodes.d.ts.map +0 -1
  179. package/lib/utils/errorCodes.js +0 -16
  180. package/lib/utils/errorCodes.js.map +0 -1
  181. package/lib/utils/fixNames.d.ts +0 -14
  182. package/lib/utils/fixNames.d.ts.map +0 -1
  183. package/lib/utils/fixNames.js +0 -18
  184. package/lib/utils/fixNames.js.map +0 -1
  185. package/lib/utils/logger.d.ts +0 -65
  186. package/lib/utils/logger.d.ts.map +0 -1
  187. package/lib/utils/logger.js +0 -187
  188. package/lib/utils/logger.js.map +0 -1
  189. package/lib/utils/modules-resolver.d.ts +0 -2
  190. package/lib/utils/modules-resolver.d.ts.map +0 -1
  191. package/lib/utils/modules-resolver.js +0 -17
  192. package/lib/utils/modules-resolver.js.map +0 -1
  193. package/lib/utils/modules-resolver.spec.d.ts +0 -2
  194. package/lib/utils/modules-resolver.spec.d.ts.map +0 -1
  195. package/lib/utils/modules-resolver.spec.js +0 -18
  196. package/lib/utils/modules-resolver.spec.js.map +0 -1
  197. package/lib/utils/previewer.d.ts +0 -15
  198. package/lib/utils/previewer.d.ts.map +0 -1
  199. package/lib/utils/previewer.js +0 -185
  200. package/lib/utils/previewer.js.map +0 -1
  201. package/lib/utils/previewer.spec.d.ts +0 -2
  202. package/lib/utils/previewer.spec.d.ts.map +0 -1
  203. package/lib/utils/previewer.spec.js +0 -123
  204. package/lib/utils/previewer.spec.js.map +0 -1
  205. package/lib/utils/tsconfig.d.ts +0 -4
  206. package/lib/utils/tsconfig.d.ts.map +0 -1
  207. package/lib/utils/tsconfig.js +0 -41
  208. package/lib/utils/tsconfig.js.map +0 -1
  209. package/lib/utils/typeConverters.d.ts +0 -29
  210. package/lib/utils/typeConverters.d.ts.map +0 -1
  211. package/lib/utils/typeConverters.js +0 -118
  212. package/lib/utils/typeConverters.js.map +0 -1
  213. package/lib/utils/types.d.ts +0 -41
  214. package/lib/utils/types.d.ts.map +0 -1
  215. package/lib/utils/types.js +0 -55
  216. package/lib/utils/types.js.map +0 -1
  217. package/lib/utils.d.ts +0 -6
  218. package/lib/utils.d.ts.map +0 -1
  219. package/lib/utils.js +0 -17
  220. package/lib/utils.js.map +0 -1
package/lib/test-utils.js DELETED
@@ -1,185 +0,0 @@
1
- /*
2
- * Copyright (C) 2017, 2018 TypeFox and others.
3
- *
4
- * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License.
5
- * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0
6
- */
7
- import { platform } from 'node:os';
8
- import * as path from 'node:path';
9
- import * as fs from 'node:fs';
10
- import { fileURLToPath } from 'node:url';
11
- import deepmerge from 'deepmerge';
12
- import * as lsp from 'vscode-languageserver';
13
- import { TextDocument } from 'vscode-languageserver-textdocument';
14
- import { normalizePath, pathToUri } from './protocol-translation.js';
15
- import { LspServer } from './lsp-server.js';
16
- import { ConsoleLogger, LogLevel } from './utils/logger.js';
17
- import { TypeScriptVersionProvider } from './tsServer/versionProvider.js';
18
- import { TsServerLogLevel } from './utils/configuration.js';
19
- const CONSOLE_LOG_LEVEL = LogLevel.fromString(process.env.CONSOLE_LOG_LEVEL);
20
- export const PACKAGE_ROOT = fileURLToPath(new URL('..', import.meta.url));
21
- const DEFAULT_TEST_CLIENT_CAPABILITIES = {
22
- textDocument: {
23
- completion: {
24
- completionItem: {
25
- insertReplaceSupport: true,
26
- snippetSupport: true,
27
- labelDetailsSupport: true,
28
- },
29
- },
30
- documentSymbol: {
31
- hierarchicalDocumentSymbolSupport: true,
32
- },
33
- publishDiagnostics: {
34
- tagSupport: {
35
- valueSet: [
36
- lsp.DiagnosticTag.Unnecessary,
37
- lsp.DiagnosticTag.Deprecated,
38
- ],
39
- },
40
- },
41
- moniker: {},
42
- },
43
- };
44
- const DEFAULT_TEST_CLIENT_INITIALIZATION_OPTIONS = {
45
- plugins: [],
46
- preferences: {
47
- allowIncompleteCompletions: true,
48
- allowRenameOfImportPath: true,
49
- allowTextChangesInNewFiles: true,
50
- displayPartsForJSDoc: true,
51
- generateReturnInDocTemplate: true,
52
- includeAutomaticOptionalChainCompletions: true,
53
- includeCompletionsForImportStatements: true,
54
- includeCompletionsForModuleExports: true,
55
- includeCompletionsWithClassMemberSnippets: true,
56
- includeCompletionsWithInsertText: true,
57
- includeCompletionsWithSnippetText: true,
58
- jsxAttributeCompletionStyle: 'auto',
59
- providePrefixAndSuffixTextForRename: true,
60
- },
61
- };
62
- const DEFAULT_WORKSPACE_SETTINGS = {};
63
- export function uri(...components) {
64
- const resolved = filePath(...components);
65
- return pathToUri(resolved, undefined);
66
- }
67
- export function filePath(...components) {
68
- return normalizePath(path.resolve(PACKAGE_ROOT, 'test-data', ...components));
69
- }
70
- export function readContents(path) {
71
- return fs.readFileSync(path, 'utf-8').toString();
72
- }
73
- export function documentFromFile({ path, languageId = 'typescript' }) {
74
- const pathComponents = path.split('/');
75
- return {
76
- languageId,
77
- text: readContents(filePath(...pathComponents)),
78
- uri: uri(...pathComponents),
79
- version: 1,
80
- };
81
- }
82
- export function positionAt(document, idx) {
83
- const doc = TextDocument.create(document.uri, document.languageId, document.version, document.text);
84
- const pos = doc.positionAt(idx);
85
- return {
86
- line: pos.line,
87
- character: pos.character,
88
- };
89
- }
90
- export function position(document, match) {
91
- return positionAt(document, document.text.indexOf(match));
92
- }
93
- export function positionAfter(document, match) {
94
- return positionAt(document, document.text.indexOf(match) + match.length);
95
- }
96
- export function lastPosition(document, match) {
97
- return positionAt(document, document.text.lastIndexOf(match));
98
- }
99
- export function toPlatformEOL(text) {
100
- if (platform() === 'win32') {
101
- return text.replace(/(?!\r)\n/g, '\r\n');
102
- }
103
- return text;
104
- }
105
- export class TestLspClient {
106
- constructor(options, logger) {
107
- this.options = options;
108
- this.logger = logger;
109
- this.workspaceEditsListener = null;
110
- }
111
- async createProgressReporter(_token, _workDoneProgress) {
112
- const reporter = new class {
113
- begin(_title, _percentage, _message, _cancellable) { }
114
- report(_message) { }
115
- done() { }
116
- };
117
- return reporter;
118
- }
119
- async withProgress(_options, task) {
120
- const progress = await this.createProgressReporter();
121
- return await task(progress);
122
- }
123
- publishDiagnostics(args) {
124
- return this.options.publishDiagnostics(args);
125
- }
126
- showErrorMessage(message) {
127
- this.logger.error(`[showErrorMessage] ${message}`);
128
- }
129
- logMessage(args) {
130
- this.logger.log('logMessage', JSON.stringify(args));
131
- }
132
- addApplyWorkspaceEditListener(listener) {
133
- this.workspaceEditsListener = listener;
134
- }
135
- async applyWorkspaceEdit(args) {
136
- if (this.workspaceEditsListener) {
137
- this.workspaceEditsListener(args);
138
- }
139
- return { applied: true };
140
- }
141
- rename() {
142
- throw new Error('unsupported');
143
- }
144
- }
145
- export class TestLspServer extends LspServer {
146
- constructor() {
147
- super(...arguments);
148
- this.workspaceEdits = [];
149
- }
150
- updateWorkspaceSettings(settings) {
151
- const configuration = {
152
- settings: deepmerge(DEFAULT_WORKSPACE_SETTINGS, settings),
153
- };
154
- this.didChangeConfiguration(configuration);
155
- }
156
- }
157
- export async function createServer(options) {
158
- const logger = new ConsoleLogger(CONSOLE_LOG_LEVEL);
159
- const lspClient = new TestLspClient(options, logger);
160
- const serverOptions = {
161
- logger,
162
- lspClient,
163
- tsserverLogVerbosity: TsServerLogLevel.Off,
164
- };
165
- const typescriptVersionProvider = new TypeScriptVersionProvider(serverOptions.tsserverPath, logger);
166
- const bundled = typescriptVersionProvider.bundledVersion();
167
- const server = new TestLspServer({
168
- ...serverOptions,
169
- tsserverPath: bundled.tsServerPath,
170
- });
171
- lspClient.addApplyWorkspaceEditListener(args => {
172
- server.workspaceEdits.push(args);
173
- });
174
- await server.initialize({
175
- rootPath: undefined,
176
- rootUri: options.rootUri,
177
- processId: 42,
178
- capabilities: deepmerge(DEFAULT_TEST_CLIENT_CAPABILITIES, options.clientCapabilitiesOverride || {}),
179
- initializationOptions: DEFAULT_TEST_CLIENT_INITIALIZATION_OPTIONS,
180
- workspaceFolders: null,
181
- });
182
- server.updateWorkspaceSettings({});
183
- return server;
184
- }
185
- //# sourceMappingURL=test-utils.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"test-utils.js","sourceRoot":"","sources":["../src/test-utils.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAEH,OAAO,EAAE,QAAQ,EAAE,MAAM,SAAS,CAAC;AACnC,OAAO,KAAK,IAAI,MAAM,WAAW,CAAC;AAClC,OAAO,KAAK,EAAE,MAAM,SAAS,CAAC;AAC9B,OAAO,EAAE,aAAa,EAAE,MAAM,UAAU,CAAC;AACzC,OAAO,SAAS,MAAM,WAAW,CAAC;AAClC,OAAO,KAAK,GAAG,MAAM,uBAAuB,CAAC;AAC7C,OAAO,EAAE,YAAY,EAAE,MAAM,oCAAoC,CAAC;AAElE,OAAO,EAAE,aAAa,EAAE,SAAS,EAAE,MAAM,2BAA2B,CAAC;AAGrE,OAAO,EAAE,SAAS,EAAE,MAAM,iBAAiB,CAAC;AAC5C,OAAO,EAAE,aAAa,EAAE,QAAQ,EAAE,MAAM,mBAAmB,CAAC;AAC5D,OAAO,EAAE,yBAAyB,EAAE,MAAM,+BAA+B,CAAC;AAC1E,OAAO,EAAE,gBAAgB,EAAkC,MAAM,0BAA0B,CAAC;AAE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C,YAAY,EAAE,MAAM,CAAC,CAAC;IACpG,MAAM,OAAO,GAAG,yBAAyB,CAAC,cAAc,EAAE,CAAC;IAC3D,MAAM,MAAM,GAAG,IAAI,aAAa,CAAC;QAC7B,GAAG,aAAa;QAChB,YAAY,EAAE,OAAQ,CAAC,YAAY;KACtC,CAAC,CAAC;IAEH,SAAS,CAAC,6BAA6B,CAAC,IAAI,CAAC,EAAE;QAC3C,MAAM,CAAC,cAAc,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC;IACrC,CAAC,CAAC,CAAC;IAEH,MAAM,MAAM,CAAC,UAAU,CAAC;QACpB,QAAQ,EAAE,SAAS;QACnB,OAAO,EAAE,OAAO,CAAC,OAAO;QACxB,SAAS,EAAE,EAAE;QACb,YAAY,EAAE,SAAS,CAAC,gCAAgC,EAAE,OAAO,CAAC,0BAA0B,IAAI,EAAE,CAAC;QACnG,qBAAqB,EAAE,0CAA0C;QACjE,gBAAgB,EAAE,IAAI;KACzB,CAAC,CAAC;IACH,MAAM,CAAC,uBAAuB,CAAC,EAAE,CAAC,CAAC;IACnC,OAAO,MAAM,CAAC;AAClB,CAAC"}
@@ -1,93 +0,0 @@
1
- /**
2
- * **IMPORTANT** this module should not depend on `vscode-languageserver` only protocol and types
3
- */
4
- import lsp from 'vscode-languageserver-protocol';
5
- import tslib from 'typescript/lib/tsserverlibrary.js';
6
- import type { TraceValue } from './tsServer/tracer.js';
7
- import tsp = tslib.server.protocol;
8
- export { tslib, tsp };
9
- export declare namespace TypeScriptRenameRequest {
10
- const type: lsp.RequestType<lsp.TextDocumentPositionParams, void, void>;
11
- }
12
- declare module 'typescript/lib/tsserverlibrary.js' {
13
- namespace server.protocol {
14
- enum CommandTypes {
15
- EncodedSemanticClassificationsFull = "encodedSemanticClassifications-full"
16
- }
17
- }
18
- }
19
- export declare const enum EventTypes {
20
- ConfigFileDiag = "configFileDiag",
21
- SyntaxDiag = "syntaxDiag",
22
- SementicDiag = "semanticDiag",
23
- SuggestionDiag = "suggestionDiag",
24
- ProjectLoadingStart = "projectLoadingStart",
25
- ProjectLoadingFinish = "projectLoadingFinish"
26
- }
27
- export declare class KindModifiers {
28
- static readonly optional = "optional";
29
- static readonly deprecated = "deprecated";
30
- static readonly dtsFile = ".d.ts";
31
- static readonly tsFile = ".ts";
32
- static readonly tsxFile = ".tsx";
33
- static readonly jsFile = ".js";
34
- static readonly jsxFile = ".jsx";
35
- static readonly jsonFile = ".json";
36
- static readonly fileExtensionKindModifiers: string[];
37
- }
38
- export declare function toSymbolDisplayPartKind(kind: string): tslib.SymbolDisplayPartKind;
39
- export interface SupportedFeatures {
40
- codeActionDisabledSupport?: boolean;
41
- completionInsertReplaceSupport?: boolean;
42
- completionLabelDetails?: boolean;
43
- completionSnippets?: boolean;
44
- definitionLinkSupport?: boolean;
45
- diagnosticsTagSupport?: boolean;
46
- }
47
- export interface TypeScriptPlugin {
48
- name: string;
49
- location: string;
50
- }
51
- export interface TypeScriptInitializationOptions {
52
- disableAutomaticTypingAcquisition?: boolean;
53
- hostInfo?: string;
54
- locale?: string;
55
- maxTsServerMemory?: number;
56
- npmLocation?: string;
57
- plugins: TypeScriptPlugin[];
58
- preferences?: tsp.UserPreferences;
59
- tsserver?: TsserverOptions;
60
- }
61
- interface TsserverOptions {
62
- /**
63
- * The path to the directory where the `tsserver` log files will be created.
64
- * If not provided, the log files will be created within the workspace, inside the `.log` directory.
65
- * If no workspace root is provided when initializating the server and no custom path is specified then
66
- * the logs will not be created.
67
- * @default undefined
68
- */
69
- logDirectory?: string;
70
- /**
71
- * Verbosity of the information logged into the `tsserver` log files.
72
- *
73
- * Log levels from least to most amount of details: `'terse'`, `'normal'`, `'requestTime`', `'verbose'`.
74
- * Enabling particular level also enables all lower levels.
75
- *
76
- * @default 'off'
77
- */
78
- logVerbosity?: 'off' | 'terse' | 'normal' | 'requestTime' | 'verbose';
79
- /**
80
- * The path to the `tsserver.js` file or the typescript lib directory. For example: `/Users/me/typescript/lib/tsserver.js`.
81
- */
82
- path?: string;
83
- /**
84
- * The verbosity of logging the tsserver communication through the LSP messages.
85
- * This doesn't affect the file logging.
86
- * @default 'off'
87
- */
88
- trace?: TraceValue;
89
- }
90
- export type TypeScriptInitializeParams = lsp.InitializeParams & {
91
- initializationOptions?: Partial<TypeScriptInitializationOptions>;
92
- };
93
- //# sourceMappingURL=ts-protocol.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"ts-protocol.d.ts","sourceRoot":"","sources":["../src/ts-protocol.ts"],"names":[],"mappings":"AAOA;;GAEG;AACH,OAAO,GAAG,MAAM,gCAAgC,CAAC;AACjD,OAAO,KAAK,MAAM,mCAAmC,CAAC;AACtD,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,sBAAsB,CAAC;AAEvD,OAAO,GAAG,GAAG,KAAK,CAAC,MAAM,CAAC,QAAQ,CAAC;AAEnC,OAAO,EAAE,KAAK,EAAE,GAAG,EAAE,CAAC;AAEtB,yBAAiB,uBAAuB,CAAC;IAC9B,MAAM,IAAI,6DAAwF,CAAC;CAC7G;AAED,OAAO,QAAQ,mCAAmC,CAAC;IAC/C,UAAU,MAAM,CAAC,QAAQ,CAAC;QACtB,KAAK,YAAY;YAEb,kCAAkC,wCAAwC;SAC7E;KACJ;CACJ;AAED,0BAAkB,UAAU;IACxB,cAAc,mBAAmB;IACjC,UAAU,eAAe;IACzB,YAAY,iBAAiB;IAC7B,cAAc,mBAAmB;IACjC,mBAAmB,wBAAwB;IAC3C,oBAAoB,yBAAyB;CAChD;AAED,qBAAa,aAAa;IACtB,gBAAuB,QAAQ,cAAc;IAC7C,gBAAuB,UAAU,gBAAgB;IACjD,gBAAuB,OAAO,WAAW;IACzC,gBAAuB,MAAM,SAAS;IACtC,gBAAuB,OAAO,UAAU;IACxC,gBAAuB,MAAM,SAAS;IACtC,gBAAuB,OAAO,UAAU;IACxC,gBAAuB,QAAQ,WAAW;IAE1C,gBAAuB,0BAA0B,WAO/C;CACL;AA8BD,wBAAgB,uBAAuB,CAA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- * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License.
5
- * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0
6
- */
7
- /**
8
- * **IMPORTANT** this module should not depend on `vscode-languageserver` only protocol and types
9
- */
10
- import lsp from 'vscode-languageserver-protocol';
11
- import tslib from 'typescript/lib/tsserverlibrary.js';
12
- var tsp = tslib.server.protocol;
13
- export { tslib, tsp };
14
- export var TypeScriptRenameRequest;
15
- (function (TypeScriptRenameRequest) {
16
- TypeScriptRenameRequest.type = new lsp.RequestType('_typescript.rename');
17
- })(TypeScriptRenameRequest = TypeScriptRenameRequest || (TypeScriptRenameRequest = {}));
18
- export class KindModifiers {
19
- }
20
- KindModifiers.optional = 'optional';
21
- KindModifiers.deprecated = 'deprecated';
22
- KindModifiers.dtsFile = '.d.ts';
23
- KindModifiers.tsFile = '.ts';
24
- KindModifiers.tsxFile = '.tsx';
25
- KindModifiers.jsFile = '.js';
26
- KindModifiers.jsxFile = '.jsx';
27
- KindModifiers.jsonFile = '.json';
28
- KindModifiers.fileExtensionKindModifiers = [
29
- KindModifiers.dtsFile,
30
- KindModifiers.tsFile,
31
- KindModifiers.tsxFile,
32
- KindModifiers.jsFile,
33
- KindModifiers.jsxFile,
34
- KindModifiers.jsonFile,
35
- ];
36
- const SYMBOL_DISPLAY_PART_KIND_MAP = {
37
- aliasName: 0,
38
- className: 1,
39
- enumName: 2,
40
- fieldName: 3,
41
- interfaceName: 4,
42
- keyword: 5,
43
- lineBreak: 6,
44
- numericLiteral: 7,
45
- stringLiteral: 8,
46
- localName: 9,
47
- methodName: 10,
48
- moduleName: 11,
49
- operator: 12,
50
- parameterName: 13,
51
- propertyName: 14,
52
- punctuation: 15,
53
- space: 16,
54
- text: 17,
55
- typeParameterName: 18,
56
- enumMemberName: 19,
57
- functionName: 20,
58
- regularExpressionLiteral: 21,
59
- link: 22,
60
- linkName: 23,
61
- linkText: 24,
62
- };
63
- export function toSymbolDisplayPartKind(kind) {
64
- return SYMBOL_DISPLAY_PART_KIND_MAP[kind];
65
- }
66
- //# sourceMappingURL=ts-protocol.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"ts-protocol.js","sourceRoot":"","sources":["../src/ts-protocol.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAEH;;GAEG;AACH,OAAO,GAAG,MAAM,gCAAgC,CAAC;AACjD,OAAO,KAAK,MAAM,mCAAmC,CAAC;AAGtD,IAAO,GAAG,GAAG,KAAK,CAAC,MAAM,CAAC,QAAQ,CAAC;AAEnC,OAAO,EAAE,KAAK,EAAE,GAAG,EAAE,CAAC;AAEtB,MAAM,KAAW,uBAAuB,CAEvC;AAFD,WAAiB,uBAAuB;IACvB,4BAAI,GAAG,IAAI,GAAG,CAAC,WAAW,CAA6C,oBAAoB,CAAC,CAAC;AAC9G,CAAC,EAFgB,uBAAuB,GAAvB,uBAAuB,KAAvB,uBAAuB,QAEvC;AAoBD,MAAM,OAAO,aAAa;;AACC,sBAAQ,GAAG,UAAU,CAAC;AACtB,wBAAU,GAAG,YAAY,CAAC;AAC1B,qBAAO,GAAG,OAAO,CAAC;AAClB,oBAAM,GAAG,KAAK,CAAC;AACf,qBAAO,GAAG,MAAM,CAAC;AACjB,oBAAM,GAAG,KAAK,CAAC;AACf,qBAAO,GAAG,MAAM,CAAC;AACjB,sBAAQ,GAAG,OAAO,CAAC;AAEnB,wCAA0B,GAAG;IAChD,aAAa,CAAC,OAAO;IACrB,aAAa,CAAC,MAAM;IACpB,aAAa,CAAC,OAAO;IACrB,aAAa,CAAC,MAAM;IACpB,aAAa,CAAC,OAAO;IACrB,aAAa,CAAC,QAAQ;CACzB,CAAC;AAGN,MAAM,4BAA4B,GAAkF;IAChH,SAAS,EAAE,CAAC;IACZ,SAAS,EAAE,CAAC;IACZ,QAAQ,EAAE,CAAC;IACX,SAAS,EAAE,CAAC;IACZ,aAAa,EAAE,CAAC;IAChB,OAAO,EAAE,CAAC;IACV,SAAS,EAAE,CAAC;IACZ,cAAc,EAAE,CAAC;IACjB,aAAa,EAAE,CAAC;IAChB,SAAS,EAAE,CAAC;IACZ,UAAU,EAAE,EAAE;IACd,UAAU,EAAE,EAAE;IACd,QAAQ,EAAE,EAAE;IACZ,aAAa,EAAE,EAAE;IACjB,YAAY,EAAE,EAAE;IAChB,WAAW,EAAE,EAAE;IACf,KAAK,EAAE,EAAE;IACT,IAAI,EAAE,EAAE;IACR,iBAAiB,EAAE,EAAE;IACrB,cAAc,EAAE,EAAE;IAClB,YAAY,EAAE,EAAE;IAChB,wBAAwB,EAAE,EAAE;IAC5B,IAAI,EAAE,EAAE;IACR,QAAQ,EAAE,EAAE;IACZ,QAAQ,EAAE,EAAE;CACf,CAAC;AAEF,MAAM,UAAU,uBAAuB,CAAC,IAAY;IAChD,OAAO,4BAA4B,CAAC,IAAgD,CAAC,CAAC;AAC1F,CAAC"}
@@ -1,17 +0,0 @@
1
- import { ServerResponse } from './requests.js';
2
- import type { tsp } from '../ts-protocol.js';
3
- export interface CallbackItem<R> {
4
- readonly onSuccess: (value: R) => void;
5
- readonly onError: (err: Error) => void;
6
- readonly queuingStartTime: number;
7
- readonly isAsync: boolean;
8
- }
9
- export declare class CallbackMap<R extends tsp.Response> {
10
- private readonly _callbacks;
11
- private readonly _asyncCallbacks;
12
- destroy(cause: string): void;
13
- add(seq: number, callback: CallbackItem<ServerResponse.Response<R> | undefined>, isAsync: boolean): void;
14
- fetch(seq: number): CallbackItem<ServerResponse.Response<R> | undefined> | undefined;
15
- private delete;
16
- }
17
- //# sourceMappingURL=callbackMap.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"callbackMap.d.ts","sourceRoot":"","sources":["../../src/tsServer/callbackMap.ts"],"names":[],"mappings":"AAWA,OAAO,EAAE,cAAc,EAAE,MAAM,eAAe,CAAC;AAC/C,OAAO,KAAK,EAAE,GAAG,EAAE,MAAM,mBAAmB,CAAC;AAE7C,MAAM,WAAW,YAAY,CAAC,CAAC;IAC3B,QAAQ,CAAC,SAAS,EAAE,CAAC,KAAK,EAAE,CAAC,KAAK,IAAI,CAAC;IACvC,QAAQ,CAAC,OAAO,EAAE,CAAC,GAAG,EAAE,KAAK,KAAK,IAAI,CAAC;IACvC,QAAQ,CAAC,gBAAgB,EAAE,MAAM,CAAC;IAClC,QAAQ,CAAC,OAAO,EAAE,OAAO,CAAC;CAC7B;AAED,qBAAa,WAAW,CAAC,CAAC,SAAS,GAAG,CAAC,QAAQ;IAC3C,OAAO,CAAC,QAAQ,CAAC,UAAU,CAA2E;IACtG,OAAO,CAAC,QAAQ,CAAC,eAAe,CAA2E;IAEpG,OAAO,CAAC,KAAK,EAAE,MAAM,GAAG,IAAI;IAY5B,GAAG,CAAC,GAAG,EAAE,MAAM,EAAE,QAAQ,EAAE,YAAY,CAAC,cAAc,CAAC,QAAQ,CAAC,CAAC,CAAC,GAAG,SAAS,CAAC,EAAE,OAAO,EAAE,OAAO,GAAG,IAAI;IAQxG,KAAK,CAAC,GAAG,EAAE,MAAM,GAAG,YAAY,CAAC,cAAc,CAAC,QAAQ,CAAC,CAAC,CAAC,GAAG,SAAS,CAAC,GAAG,SAAS;IAM3F,OAAO,CAAC,MAAM;CAKjB"}
@@ -1,47 +0,0 @@
1
- /*---------------------------------------------------------------------------------------------
2
- * Copyright (c) Microsoft Corporation. All rights reserved.
3
- * Licensed under the MIT License. See License.txt in the project root for license information.
4
- *--------------------------------------------------------------------------------------------*/
5
- /*
6
- * Copyright (C) 2022 TypeFox and others.
7
- *
8
- * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License.
9
- * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0
10
- */
11
- import { ServerResponse } from './requests.js';
12
- export class CallbackMap {
13
- constructor() {
14
- this._callbacks = new Map();
15
- this._asyncCallbacks = new Map();
16
- }
17
- destroy(cause) {
18
- const cancellation = new ServerResponse.Cancelled(cause);
19
- for (const callback of this._callbacks.values()) {
20
- callback.onSuccess(cancellation);
21
- }
22
- this._callbacks.clear();
23
- for (const callback of this._asyncCallbacks.values()) {
24
- callback.onSuccess(cancellation);
25
- }
26
- this._asyncCallbacks.clear();
27
- }
28
- add(seq, callback, isAsync) {
29
- if (isAsync) {
30
- this._asyncCallbacks.set(seq, callback);
31
- }
32
- else {
33
- this._callbacks.set(seq, callback);
34
- }
35
- }
36
- fetch(seq) {
37
- const callback = this._callbacks.get(seq) || this._asyncCallbacks.get(seq);
38
- this.delete(seq);
39
- return callback;
40
- }
41
- delete(seq) {
42
- if (!this._callbacks.delete(seq)) {
43
- this._asyncCallbacks.delete(seq);
44
- }
45
- }
46
- }
47
- //# sourceMappingURL=callbackMap.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"callbackMap.js","sourceRoot":"","sources":["../../src/tsServer/callbackMap.ts"],"names":[],"mappings":"AAAA;;;gGAGgG;AAChG;;;;;GAKG;AAEH,OAAO,EAAE,cAAc,EAAE,MAAM,eAAe,CAAC;AAU/C,MAAM,OAAO,WAAW;IAAxB;QACqB,eAAU,GAAG,IAAI,GAAG,EAAgE,CAAC;QACrF,oBAAe,GAAG,IAAI,GAAG,EAAgE,CAAC;IAiC/G,CAAC;IA/BU,OAAO,CAAC,KAAa;QACxB,MAAM,YAAY,GAAG,IAAI,cAAc,CAAC,SAAS,CAAC,KAAK,CAAC,CAAC;QACzD,KAAK,MAAM,QAAQ,IAAI,IAAI,CAAC,UAAU,CAAC,MAAM,EAAE,EAAE;YAC7C,QAAQ,CAAC,SAAS,CAAC,YAAY,CAAC,CAAC;SACpC;QACD,IAAI,CAAC,UAAU,CAAC,KAAK,EAAE,CAAC;QACxB,KAAK,MAAM,QAAQ,IAAI,IAAI,CAAC,eAAe,CAAC,MAAM,EAAE,EAAE;YAClD,QAAQ,CAAC,SAAS,CAAC,YAAY,CAAC,CAAC;SACpC;QACD,IAAI,CAAC,eAAe,CAAC,KAAK,EAAE,CAAC;IACjC,CAAC;IAEM,GAAG,CAAC,GAAW,EAAE,QAA8D,EAAE,OAAgB;QACpG,IAAI,OAAO,EAAE;YACT,IAAI,CAAC,eAAe,CAAC,GAAG,CAAC,GAAG,EAAE,QAAQ,CAAC,CAAC;SAC3C;aAAM;YACH,IAAI,CAAC,UAAU,CAAC,GAAG,CAAC,GAAG,EAAE,QAAQ,CAAC,CAAC;SACtC;IACL,CAAC;IAEM,KAAK,CAAC,GAAW;QACpB,MAAM,QAAQ,GAAG,IAAI,CAAC,UAAU,CAAC,GAAG,CAAC,GAAG,CAAC,IAAI,IAAI,CAAC,eAAe,CAAC,GAAG,CAAC,GAAG,CAAC,CAAC;QAC3E,IAAI,CAAC,MAAM,CAAC,GAAG,CAAC,CAAC;QACjB,OAAO,QAAQ,CAAC;IACpB,CAAC;IAEO,MAAM,CAAC,GAAW;QACtB,IAAI,CAAC,IAAI,CAAC,UAAU,CAAC,MAAM,CAAC,GAAG,CAAC,EAAE;YAC9B,IAAI,CAAC,eAAe,CAAC,MAAM,CAAC,GAAG,CAAC,CAAC;SACpC;IACL,CAAC;CACJ"}
@@ -1,22 +0,0 @@
1
- import Tracer from './tracer.js';
2
- export interface OngoingRequestCanceller {
3
- readonly cancellationPipeName: string | undefined;
4
- tryCancelOngoingRequest(seq: number): boolean;
5
- }
6
- export interface OngoingRequestCancellerFactory {
7
- create(serverId: string, tracer: Tracer): OngoingRequestCanceller;
8
- }
9
- export declare const noopRequestCancellerFactory: {
10
- create(_serverId: string, _tracer: Tracer): OngoingRequestCanceller;
11
- };
12
- export declare class NodeRequestCanceller implements OngoingRequestCanceller {
13
- private readonly _serverId;
14
- private readonly _tracer;
15
- readonly cancellationPipeName: string;
16
- constructor(_serverId: string, _tracer: Tracer);
17
- tryCancelOngoingRequest(seq: number): boolean;
18
- }
19
- export declare const nodeRequestCancellerFactory: {
20
- create(serverId: string, tracer: Tracer): OngoingRequestCanceller;
21
- };
22
- //# sourceMappingURL=cancellation.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"cancellation.d.ts","sourceRoot":"","sources":["../../src/tsServer/cancellation.ts"],"names":[],"mappings":"AAaA,OAAO,MAAM,MAAM,aAAa,CAAC;AAEjC,MAAM,WAAW,uBAAuB;IACpC,QAAQ,CAAC,oBAAoB,EAAE,MAAM,GAAG,SAAS,CAAC;IAClD,uBAAuB,CAAC,GAAG,EAAE,MAAM,GAAG,OAAO,CAAC;CACjD;AAED,MAAM,WAAW,8BAA8B;IAC3C,MAAM,CAAC,QAAQ,EAAE,MAAM,EAAE,MAAM,EAAE,MAAM,GAAG,uBAAuB,CAAC;CACrE;AAUD,eAAO,MAAM,2BAA2B;sBAClB,MAAM,WAAW,MAAM,GAAG,uBAAuB;CAGtE,CAAC;AAEF,qBAAa,oBAAqB,YAAW,uBAAuB;IAI5D,OAAO,CAAC,QAAQ,CAAC,SAAS;IAC1B,OAAO,CAAC,QAAQ,CAAC,OAAO;IAJ5B,SAAgB,oBAAoB,EAAE,MAAM,CAAC;gBAGxB,SAAS,EAAE,MAAM,EACjB,OAAO,EAAE,MAAM;IAK7B,uBAAuB,CAAC,GAAG,EAAE,MAAM,GAAG,OAAO;CAYvD;AAED,eAAO,MAAM,2BAA2B;qBACnB,MAAM,UAAU,MAAM,GAAG,uBAAuB;CAGpE,CAAC"}
@@ -1,51 +0,0 @@
1
- /*---------------------------------------------------------------------------------------------
2
- * Copyright (c) Microsoft Corporation. All rights reserved.
3
- * Licensed under the MIT License. See License.txt in the project root for license information.
4
- *--------------------------------------------------------------------------------------------*/
5
- /*
6
- * Copyright (C) 2022 TypeFox and others.
7
- *
8
- * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License.
9
- * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0
10
- */
11
- import fs from 'node:fs';
12
- import { temporaryFile } from 'tempy';
13
- const noopRequestCanceller = new class {
14
- constructor() {
15
- this.cancellationPipeName = undefined;
16
- }
17
- tryCancelOngoingRequest(_seq) {
18
- return false;
19
- }
20
- };
21
- export const noopRequestCancellerFactory = new class {
22
- create(_serverId, _tracer) {
23
- return noopRequestCanceller;
24
- }
25
- };
26
- export class NodeRequestCanceller {
27
- constructor(_serverId, _tracer) {
28
- this._serverId = _serverId;
29
- this._tracer = _tracer;
30
- this.cancellationPipeName = temporaryFile({ name: 'tscancellation' });
31
- }
32
- tryCancelOngoingRequest(seq) {
33
- if (!this.cancellationPipeName) {
34
- return false;
35
- }
36
- this._tracer.logTrace(this._serverId, `TypeScript Server: trying to cancel ongoing request with sequence number ${seq}`);
37
- try {
38
- fs.writeFileSync(this.cancellationPipeName + String(seq), '');
39
- }
40
- catch {
41
- // noop
42
- }
43
- return true;
44
- }
45
- }
46
- export const nodeRequestCancellerFactory = new class {
47
- create(serverId, tracer) {
48
- return new NodeRequestCanceller(serverId, tracer);
49
- }
50
- };
51
- //# sourceMappingURL=cancellation.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"cancellation.js","sourceRoot":"","sources":["../../src/tsServer/cancellation.ts"],"names":[],"mappings":"AAAA;;;gGAGgG;AAChG;;;;;GAKG;AAEH,OAAO,EAAE,MAAM,SAAS,CAAC;AACzB,OAAO,EAAE,aAAa,EAAE,MAAM,OAAO,CAAC;AAYtC,MAAM,oBAAoB,GAAG,IAAI;IAAA;QACb,yBAAoB,GAAG,SAAS,CAAC;IAKrD,CAAC;IAHU,uBAAuB,CAAC,IAAY;QACvC,OAAO,KAAK,CAAC;IACjB,CAAC;CACJ,CAAC;AAEF,MAAM,CAAC,MAAM,2BAA2B,GAAG,IAAI;IAC3C,MAAM,CAAC,SAAiB,EAAE,OAAe;QACrC,OAAO,oBAAoB,CAAC;IAChC,CAAC;CACJ,CAAC;AAEF,MAAM,OAAO,oBAAoB;IAG7B,YACqB,SAAiB,EACjB,OAAe;QADf,cAAS,GAAT,SAAS,CAAQ;QACjB,YAAO,GAAP,OAAO,CAAQ;QAEhC,IAAI,CAAC,oBAAoB,GAAG,aAAa,CAAC,EAAE,IAAI,EAAE,gBAAgB,EAAE,CAAC,CAAC;IAC1E,CAAC;IAEM,uBAAuB,CAAC,GAAW;QACtC,IAAI,CAAC,IAAI,CAAC,oBAAoB,EAAE;YAC5B,OAAO,KAAK,CAAC;SAChB;QACD,IAAI,CAAC,OAAO,CAAC,QAAQ,CAAC,IAAI,CAAC,SAAS,EAAE,4EAA4E,GAAG,EAAE,CAAC,CAAC;QACzH,IAAI;YACA,EAAE,CAAC,aAAa,CAAC,IAAI,CAAC,oBAAoB,GAAG,MAAM,CAAC,GAAG,CAAC,EAAE,EAAE,CAAC,CAAC;SACjE;QAAC,MAAM;YACJ,OAAO;SACV;QACD,OAAO,IAAI,CAAC;IAChB,CAAC;CACJ;AAED,MAAM,CAAC,MAAM,2BAA2B,GAAG,IAAI;IAC3C,MAAM,CAAC,QAAgB,EAAE,MAAc;QACnC,OAAO,IAAI,oBAAoB,CAAC,QAAQ,EAAE,MAAM,CAAC,CAAC;IACtD,CAAC;CACJ,CAAC"}
@@ -1,13 +0,0 @@
1
- export interface ILogDirectoryProvider {
2
- getNewLogDirectory(): string | undefined;
3
- }
4
- export declare class LogDirectoryProvider implements ILogDirectoryProvider {
5
- private readonly rootPath?;
6
- constructor(rootPath?: string | undefined);
7
- getNewLogDirectory(): string | undefined;
8
- private logDirectory;
9
- }
10
- export declare const noopLogDirectoryProvider: {
11
- getNewLogDirectory(): undefined;
12
- };
13
- //# sourceMappingURL=logDirectoryProvider.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"logDirectoryProvider.d.ts","sourceRoot":"","sources":["../../src/tsServer/logDirectoryProvider.ts"],"names":[],"mappings":"AAcA,MAAM,WAAW,qBAAqB;IAClC,kBAAkB,IAAI,MAAM,GAAG,SAAS,CAAC;CAC5C;AAED,qBAAa,oBAAqB,YAAW,qBAAqB;IAE1D,OAAO,CAAC,QAAQ,CAAC,QAAQ,CAAC;gBAAT,QAAQ,CAAC,oBAAQ;IAG/B,kBAAkB,IAAI,MAAM,GAAG,SAAS;IAY/C,OAAO,CAAC,YAAY;CAavB;AAED,eAAO,MAAM,wBAAwB;0BACJ,SAAS;CAGzC,CAAC"}
@@ -1,49 +0,0 @@
1
- /*---------------------------------------------------------------------------------------------
2
- * Copyright (c) Microsoft Corporation. All rights reserved.
3
- * Licensed under the MIT License. See License.txt in the project root for license information.
4
- *--------------------------------------------------------------------------------------------*/
5
- /*
6
- * Copyright (C) 2022 TypeFox and others.
7
- *
8
- * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License.
9
- * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0
10
- */
11
- import fs from 'node:fs';
12
- import path from 'node:path';
13
- export class LogDirectoryProvider {
14
- constructor(rootPath) {
15
- this.rootPath = rootPath;
16
- }
17
- getNewLogDirectory() {
18
- const root = this.logDirectory();
19
- if (root) {
20
- try {
21
- return fs.mkdtempSync(path.join(root, 'tsserver-log-'));
22
- }
23
- catch (e) {
24
- return undefined;
25
- }
26
- }
27
- return undefined;
28
- }
29
- logDirectory() {
30
- if (!this.rootPath) {
31
- return undefined;
32
- }
33
- try {
34
- if (!fs.existsSync(this.rootPath)) {
35
- fs.mkdirSync(this.rootPath);
36
- }
37
- return this.rootPath;
38
- }
39
- catch {
40
- return undefined;
41
- }
42
- }
43
- }
44
- export const noopLogDirectoryProvider = new class {
45
- getNewLogDirectory() {
46
- return undefined;
47
- }
48
- };
49
- //# sourceMappingURL=logDirectoryProvider.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"logDirectoryProvider.js","sourceRoot":"","sources":["../../src/tsServer/logDirectoryProvider.ts"],"names":[],"mappings":"AAAA;;;gGAGgG;AAChG;;;;;GAKG;AAEH,OAAO,EAAE,MAAM,SAAS,CAAC;AACzB,OAAO,IAAI,MAAM,WAAW,CAAC;AAM7B,MAAM,OAAO,oBAAoB;IAC7B,YACqB,QAAiB;QAAjB,aAAQ,GAAR,QAAQ,CAAS;IAClC,CAAC;IAEE,kBAAkB;QACrB,MAAM,IAAI,GAAG,IAAI,CAAC,YAAY,EAAE,CAAC;QACjC,IAAI,IAAI,EAAE;YACN,IAAI;gBACA,OAAO,EAAE,CAAC,WAAW,CAAC,IAAI,CAAC,IAAI,CAAC,IAAI,EAAE,eAAe,CAAC,CAAC,CAAC;aAC3D;YAAC,OAAO,CAAC,EAAE;gBACR,OAAO,SAAS,CAAC;aACpB;SACJ;QACD,OAAO,SAAS,CAAC;IACrB,CAAC;IAEO,YAAY;QAChB,IAAI,CAAC,IAAI,CAAC,QAAQ,EAAE;YAChB,OAAO,SAAS,CAAC;SACpB;QACD,IAAI;YACA,IAAI,CAAC,EAAE,CAAC,UAAU,CAAC,IAAI,CAAC,QAAQ,CAAC,EAAE;gBAC/B,EAAE,CAAC,SAAS,CAAC,IAAI,CAAC,QAAQ,CAAC,CAAC;aAC/B;YACD,OAAO,IAAI,CAAC,QAAQ,CAAC;SACxB;QAAC,MAAM;YACJ,OAAO,SAAS,CAAC;SACpB;IACL,CAAC;CACJ;AAED,MAAM,CAAC,MAAM,wBAAwB,GAAG,IAAI;IACjC,kBAAkB;QACrB,OAAO,SAAS,CAAC;IACrB,CAAC;CACJ,CAAC"}
@@ -1,34 +0,0 @@
1
- import type { tsp } from '../ts-protocol.js';
2
- export declare enum RequestQueueingType {
3
- /**
4
- * Normal request that is executed in order.
5
- */
6
- Normal = 1,
7
- /**
8
- * Request that normal requests jump in front of in the queue.
9
- */
10
- LowPriority = 2,
11
- /**
12
- * A fence that blocks request reordering.
13
- *
14
- * Fences are not reordered. Unlike a normal request, a fence will never jump in front of a low priority request
15
- * in the request queue.
16
- */
17
- Fence = 3
18
- }
19
- export interface RequestItem {
20
- readonly request: tsp.Request;
21
- readonly expectsResponse: boolean;
22
- readonly isAsync: boolean;
23
- readonly queueingType: RequestQueueingType;
24
- }
25
- export declare class RequestQueue {
26
- private readonly queue;
27
- private sequenceNumber;
28
- get length(): number;
29
- enqueue(item: RequestItem): void;
30
- dequeue(): RequestItem | undefined;
31
- tryDeletePendingRequest(seq: number): boolean;
32
- createRequest(command: string, args: any): tsp.Request;
33
- }
34
- //# sourceMappingURL=requestQueue.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"requestQueue.d.ts","sourceRoot":"","sources":["../../src/tsServer/requestQueue.ts"],"names":[],"mappings":"AAWA,OAAO,KAAK,EAAE,GAAG,EAAE,MAAM,mBAAmB,CAAC;AAE7C,oBAAY,mBAAmB;IAC3B;;OAEG;IACH,MAAM,IAAI;IAEV;;OAEG;IACH,WAAW,IAAI;IAEf;;;;;OAKG;IACH,KAAK,IAAI;CACZ;AAED,MAAM,WAAW,WAAW;IACxB,QAAQ,CAAC,OAAO,EAAE,GAAG,CAAC,OAAO,CAAC;IAC9B,QAAQ,CAAC,eAAe,EAAE,OAAO,CAAC;IAClC,QAAQ,CAAC,OAAO,EAAE,OAAO,CAAC;IAC1B,QAAQ,CAAC,YAAY,EAAE,mBAAmB,CAAC;CAC9C;AAED,qBAAa,YAAY;IACrB,OAAO,CAAC,QAAQ,CAAC,KAAK,CAAqB;IAC3C,OAAO,CAAC,cAAc,CAAK;IAE3B,IAAW,MAAM,IAAI,MAAM,CAE1B;IAEM,OAAO,CAAC,IAAI,EAAE,WAAW,GAAG,IAAI;IAgBhC,OAAO,IAAI,WAAW,GAAG,SAAS;IAIlC,uBAAuB,CAAC,GAAG,EAAE,MAAM,GAAG,OAAO;IAU7C,aAAa,CAAC,OAAO,EAAE,MAAM,EAAE,IAAI,EAAE,GAAG,GAAG,GAAG,CAAC,OAAO;CAQhE"}