typescript-language-server 3.0.1 → 3.0.3

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 +19 -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
@@ -1,161 +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 { createRequire } from 'node:module';
13
- import path from 'node:path';
14
- import which from 'which';
15
- import { pkgUpSync } from 'pkg-up';
16
- import API from '../utils/api.js';
17
- import { findPathToModule } from '../utils/modules-resolver.js';
18
- export class TypeScriptVersion {
19
- constructor(source, path, logger) {
20
- this.source = source;
21
- this.path = path;
22
- this.logger = logger;
23
- this._api = null;
24
- }
25
- get tsServerPath() {
26
- return this.path;
27
- }
28
- get isValid() {
29
- return this.version !== null;
30
- }
31
- get version() {
32
- if (this._api) {
33
- return this._api;
34
- }
35
- this._api = this.getTypeScriptVersion(this.tsServerPath);
36
- return this._api;
37
- }
38
- get versionString() {
39
- const version = this.version;
40
- return version ? version.displayName : null;
41
- }
42
- getTypeScriptVersion(serverPath) {
43
- this.logger.log(`Resolving TypeScript version from path "${serverPath}"...`);
44
- if (!fs.existsSync(serverPath)) {
45
- this.logger.log('Server path does not exist on disk');
46
- return null;
47
- }
48
- const p = serverPath.split(path.sep);
49
- if (p.length <= 2) {
50
- this.logger.log('Server path is invalid (has less than two path components).');
51
- return null;
52
- }
53
- const p2 = p.slice(0, -2);
54
- const modulePath = p2.join(path.sep);
55
- let fileName = path.join(modulePath, 'package.json');
56
- if (!fs.existsSync(fileName)) {
57
- // Special case for ts dev versions
58
- if (path.basename(modulePath) === 'built') {
59
- fileName = path.join(modulePath, '..', 'package.json');
60
- }
61
- }
62
- if (!fs.existsSync(fileName)) {
63
- this.logger.log(`Failed to find package.json at path "${fileName}"`);
64
- return null;
65
- }
66
- this.logger.log(`Reading version from package.json at "${fileName}"`);
67
- const contents = fs.readFileSync(fileName).toString();
68
- let desc = null;
69
- try {
70
- desc = JSON.parse(contents);
71
- }
72
- catch (err) {
73
- this.logger.log('Failed parsing contents of package.json.');
74
- return null;
75
- }
76
- if (!desc?.version) {
77
- this.logger.log('Failed reading version number from package.json.');
78
- return null;
79
- }
80
- this.logger.log(`Resolved TypeScript version to "${desc.version}"`);
81
- return API.fromVersionString(desc.version);
82
- }
83
- }
84
- export const MODULE_FOLDERS = ['node_modules/typescript/lib', '.vscode/pnpify/typescript/lib', '.yarn/sdks/typescript/lib'];
85
- export class TypeScriptVersionProvider {
86
- constructor(userTsserverPath, logger) {
87
- this.userTsserverPath = userTsserverPath;
88
- this.logger = logger;
89
- }
90
- getUserSettingVersion() {
91
- if (!this.userTsserverPath) {
92
- return null;
93
- }
94
- this.logger.log(`Resolving user-provided tsserver path "${this.userTsserverPath}"...`);
95
- let resolvedPath = this.userTsserverPath;
96
- // Resolve full path to the binary if path is not absolute.
97
- if (!path.isAbsolute(resolvedPath)) {
98
- const binaryPath = which.sync(resolvedPath, { nothrow: true });
99
- if (binaryPath) {
100
- resolvedPath = binaryPath;
101
- }
102
- this.logger.log(`Non-absolute tsserver path resolved to "${binaryPath ? resolvedPath : '<failed>'}"`);
103
- }
104
- // Resolve symbolic link.
105
- let stat = fs.lstatSync(resolvedPath, { throwIfNoEntry: false });
106
- if (stat?.isSymbolicLink()) {
107
- resolvedPath = fs.realpathSync(resolvedPath);
108
- this.logger.log(`Symbolic link tsserver path resolved to "${resolvedPath}"`);
109
- }
110
- // Get directory path
111
- stat = fs.lstatSync(resolvedPath, { throwIfNoEntry: false });
112
- if (stat?.isFile()) {
113
- if (path.basename(resolvedPath) === 'tsserver.js') {
114
- this.logger.log(`Resolved tsserver location: ${resolvedPath}`);
115
- return new TypeScriptVersion("user-setting" /* TypeScriptVersionSource.UserSetting */, resolvedPath, this.logger);
116
- }
117
- resolvedPath = path.dirname(resolvedPath);
118
- this.logger.log(`Resolved directory path from a file path: ${resolvedPath}`);
119
- }
120
- // Resolve path to the "lib" dir.
121
- try {
122
- const packageJsonPath = pkgUpSync({ cwd: resolvedPath });
123
- this.logger.log(`Resolved package.json location: "${packageJsonPath}"`);
124
- if (packageJsonPath) {
125
- resolvedPath = path.join(path.dirname(packageJsonPath), 'lib', 'tsserver.js');
126
- this.logger.log(`Resolved tsserver location: "${resolvedPath}"`);
127
- }
128
- }
129
- catch {
130
- // ignore
131
- }
132
- return new TypeScriptVersion("user-setting" /* TypeScriptVersionSource.UserSetting */, resolvedPath, this.logger);
133
- }
134
- getWorkspaceVersion(workspaceFolders) {
135
- for (const p of workspaceFolders) {
136
- const libFolder = findPathToModule(p, MODULE_FOLDERS);
137
- if (libFolder) {
138
- const tsServerPath = path.join(libFolder, 'tsserver.js');
139
- const version = new TypeScriptVersion("workspace" /* TypeScriptVersionSource.Workspace */, tsServerPath, this.logger);
140
- if (version.isValid) {
141
- return version;
142
- }
143
- }
144
- }
145
- return null;
146
- }
147
- bundledVersion() {
148
- const require = createRequire(import.meta.url);
149
- try {
150
- const file = require.resolve('typescript');
151
- const tsServerPath = path.join(path.dirname(file), 'tsserver.js');
152
- const bundledVersion = new TypeScriptVersion("bundled" /* TypeScriptVersionSource.Bundled */, tsServerPath, this.logger);
153
- return bundledVersion;
154
- }
155
- catch (e) {
156
- // window.showMessage('Bundled typescript module not found', 'error');
157
- return null;
158
- }
159
- }
160
- }
161
- //# sourceMappingURL=versionProvider.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"versionProvider.js","sourceRoot":"","sources":["../../src/tsServer/versionProvider.ts"],"names":[],"mappings":"AAAA;;;gGAGgG;AAChG;;;;;GAKG;AAEH,OAAO,EAAE,MAAM,SAAS,CAAC;AACzB,OAAO,EAAE,aAAa,EAAE,MAAM,aAAa,CAAC;AAC5C,OAAO,IAAI,MAAM,WAAW,CAAC;AAC7B,OAAO,KAAK,MAAM,OAAO,CAAC;AAC1B,OAAO,EAAE,SAAS,EAAE,MAAM,QAAQ,CAAC;AACnC,OAAO,GAAG,MAAM,iBAAiB,CAAC;AAClC,OAAO,EAAE,gBAAgB,EAAE,MAAM,8BAA8B,CAAC;AAShE,MAAM,OAAO,iBAAiB;IAE1B,YACoB,MAA+B,EAC/B,IAAY,EACX,MAAc;QAFf,WAAM,GAAN,MAAM,CAAyB;QAC/B,SAAI,GAAJ,IAAI,CAAQ;QACX,WAAM,GAAN,MAAM,CAAQ;QAE/B,IAAI,CAAC,IAAI,GAAG,IAAI,CAAC;IACrB,CAAC;IAED,IAAW,YAAY;QACnB,OAAO,IAAI,CAAC,IAAI,CAAC;IACrB,CAAC;IAED,IAAW,OAAO;QACd,OAAO,IAAI,CAAC,OAAO,KAAK,IAAI,CAAC;IACjC,CAAC;IAED,IAAW,OAAO;QACd,IAAI,IAAI,CAAC,IAAI,EAAE;YACX,OAAO,IAAI,CAAC,IAAI,CAAC;SACpB;QACD,IAAI,CAAC,I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AAI,CAAC,IAAI,CAAC,IAAI,CAAC,OAAO,CAAC,IAAI,CAAC,EAAE,aAAa,CAAC,CAAC;YAClE,MAAM,cAAc,GAAG,IAAI,iBAAiB,kDAAkC,YAAY,EAAE,IAAI,CAAC,MAAM,CAAC,CAAC;YACzG,OAAO,cAAc,CAAC;SACzB;QAAC,OAAO,CAAC,EAAE;YACR,sEAAsE;YACtE,OAAO,IAAI,CAAC;SACf;IACL,CAAC;CACJ"}
@@ -1,53 +0,0 @@
1
- /// <reference types="node" resolution-mode="require"/>
2
- import type { CancellationToken } from 'vscode-jsonrpc';
3
- import { Logger } from './utils/logger.js';
4
- import API from './utils/api.js';
5
- import { tsp } from './ts-protocol.js';
6
- import type { ILogDirectoryProvider } from './tsServer/logDirectoryProvider.js';
7
- import { ExecConfig, ServerResponse, TypeScriptRequestTypes } from './tsServer/requests.js';
8
- import { Trace } from './tsServer/tracer.js';
9
- import type { TypeScriptVersion } from './tsServer/versionProvider.js';
10
- import type { LspClient } from './lsp-client.js';
11
- import type { TsServerLogLevel } from './utils/configuration.js';
12
- import CommandTypes = tsp.CommandTypes;
13
- export interface TspClientOptions {
14
- lspClient: LspClient;
15
- trace: Trace;
16
- typescriptVersion: TypeScriptVersion;
17
- logger: Logger;
18
- logVerbosity: TsServerLogLevel;
19
- logDirectoryProvider: ILogDirectoryProvider;
20
- disableAutomaticTypingAcquisition?: boolean;
21
- maxTsServerMemory?: number;
22
- npmLocation?: string;
23
- locale?: string;
24
- globalPlugins?: string[];
25
- pluginProbeLocations?: string[];
26
- onEvent?: (event: tsp.Event) => void;
27
- onExit?: (exitCode: number | null, signal: NodeJS.Signals | null) => void;
28
- }
29
- export declare class TspClient {
30
- private options;
31
- apiVersion: API;
32
- private primaryTsServer;
33
- private logger;
34
- private tsserverLogger;
35
- private loadingIndicator;
36
- private tracer;
37
- constructor(options: TspClientOptions);
38
- start(): boolean;
39
- private serviceExited;
40
- private dispatchEvent;
41
- shutdown(): void;
42
- notify(command: CommandTypes.Open, args: tsp.OpenRequestArgs): void;
43
- notify(command: CommandTypes.Close, args: tsp.FileRequestArgs): void;
44
- notify(command: CommandTypes.Change, args: tsp.ChangeRequestArgs): void;
45
- requestGeterr(args: tsp.GeterrRequestArgs, token: CancellationToken): Promise<any>;
46
- request<K extends keyof TypeScriptRequestTypes>(command: K, args: TypeScriptRequestTypes[K][0], token?: CancellationToken, config?: ExecConfig): Promise<TypeScriptRequestTypes[K][1]>;
47
- execute(command: keyof TypeScriptRequestTypes, args: any, token?: CancellationToken, config?: ExecConfig): Promise<ServerResponse.Response<tsp.Response>>;
48
- executeWithoutWaitingForResponse(command: keyof TypeScriptRequestTypes, args: any): void;
49
- executeAsync(command: keyof TypeScriptRequestTypes, args: tsp.GeterrRequestArgs, token: CancellationToken): Promise<ServerResponse.Response<tsp.Response>>;
50
- private executeImpl;
51
- private fatalError;
52
- }
53
- //# sourceMappingURL=tsp-client.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"tsp-client.d.ts","sourceRoot":"","sources":["../src/tsp-client.ts"],"names":[],"mappings":";AAYA,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,gBAAgB,CAAC;AACxD,OAAO,EAAE,MAAM,EAAmB,MAAM,mBAAmB,CAAC;AAC5D,OAAO,GAAG,MAAM,gBAAgB,CAAC;AACjC,OAAO,EAAE,GAAG,EAAc,MAAM,kBAAkB,CAAC;AACnD,OAAO,KAAK,EAAE,qBAAqB,EAAE,MAAM,oCAAoC,CAAC;AAChF,OAAO,EAAE,UAAU,EAAE,cAAc,EAAE,sBAAsB,EAAE,MAAM,wBAAwB,CAAC;AAI5F,OAAe,EAAE,KAAK,EAAE,MAAM,sBAAsB,CAAC;AACrD,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,+BAA+B,CAAC;AACvE,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,iBAAiB,CAAC;AACjD,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,0BAA0B,CAAC;AAE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,IAAI,EAAE,GAAG,CAAC,eAAe,GAAG,IAAI;IACpE,MAAM,CAAC,OAAO,EAAE,YAAY,CAAC,MAAM,EAAE,IAAI,EAAE,GAAG,CAAC,iBAAiB,GAAG,IAAI;IAKvE,aAAa,CAAC,IAAI,EAAE,GAAG,CAAC,iBAAiB,EAAE,KAAK,EAAE,iBAAiB,GAAG,OAAO,CAAC,GAAG,CAAC;IAIlF,OAAO,CAAC,CAAC,SAAS,MAAM,sBAAsB,EACjD,OAAO,EAAE,CAAC,EACV,IAAI,EAAE,sBAAsB,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,EAClC,KAAK,CAAC,EAAE,iBAAiB,EACzB,MAAM,CAAC,EAAE,UAAU,GACpB,OAAO,CAAC,sBAAsB,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC;IAMjC,OAAO,CAAC,OAAO,EAAE,MAAM,sBAAsB,EAAE,IAAI,EAAE,GAAG,EAAE,KAAK,CAAC,EAAE,iBAAiB,EAAE,MAAM,CAAC,EAAE,UAAU,GAAG,OAAO,CAAC,cAAc,CAAC,QAAQ,CAAC,GAAG,CAAC,QAAQ,CAAC,CAAC;IAkDzJ,gCAAgC,CAAC,OAAO,EAAE,MAAM,sBAAsB,EAAE,IAAI,EAAE,GAAG,GAAG,IAAI;IAQxF,YAAY,CAAC,OAAO,EAAE,MAAM,sBAAsB,EAAE,IAAI,EAAE,GAAG,CAAC,iBAAiB,EAAE,KAAK,EAAE,iBAAiB,GAAG,OAAO,CAAC,cAAc,CAAC,QAAQ,CAAC,GAAG,CAAC,QAAQ,CAAC,CAAC;IAQjK,OAAO,CAAC,WAAW;IAQnB,OAAO,CAAC,UAAU;CAcrB"}
package/lib/tsp-client.js DELETED
@@ -1,228 +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) 2017, 2018 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 { PrefixingLogger } from './utils/logger.js';
12
- import API from './utils/api.js';
13
- import { tsp } from './ts-protocol.js';
14
- import { ServerResponse } from './tsServer/requests.js';
15
- import { TypeScriptServerError } from './tsServer/serverError.js';
16
- import { TypeScriptServerSpawner } from './tsServer/spawner.js';
17
- import Tracer from './tsServer/tracer.js';
18
- var CommandTypes = tsp.CommandTypes;
19
- class ServerInitializingIndicator {
20
- constructor(lspClient) {
21
- this.lspClient = lspClient;
22
- }
23
- reset() {
24
- if (this._loadingProjectName) {
25
- this._loadingProjectName = undefined;
26
- if (this._task) {
27
- const task = this._task;
28
- this._task = undefined;
29
- task.then(reporter => reporter.done());
30
- }
31
- }
32
- }
33
- startedLoadingProject(projectName) {
34
- // TS projects are loaded sequentially. Cancel existing task because it should always be resolved before
35
- // the incoming project loading task is.
36
- this.reset();
37
- this._loadingProjectName = projectName;
38
- this._task = this.lspClient.createProgressReporter();
39
- this._task.then(reporter => reporter.begin('Initializing JS/TS language features…'));
40
- }
41
- finishedLoadingProject(projectName) {
42
- if (this._loadingProjectName === projectName) {
43
- this.reset();
44
- }
45
- }
46
- }
47
- export class TspClient {
48
- constructor(options) {
49
- this.options = options;
50
- this.primaryTsServer = null;
51
- this.apiVersion = options.typescriptVersion.version || API.defaultVersion;
52
- this.logger = new PrefixingLogger(options.logger, '[tsclient]');
53
- this.tsserverLogger = new PrefixingLogger(options.logger, '[tsserver]');
54
- this.loadingIndicator = new ServerInitializingIndicator(options.lspClient);
55
- this.tracer = new Tracer(this.tsserverLogger, options.trace);
56
- }
57
- start() {
58
- const tsServerSpawner = new TypeScriptServerSpawner(this.apiVersion, this.options.logDirectoryProvider, this.logger, this.tracer);
59
- const tsServer = tsServerSpawner.spawn(this.options.typescriptVersion, this.options);
60
- tsServer.onExit((data) => {
61
- this.primaryTsServer = null;
62
- this.shutdown();
63
- this.tsserverLogger.error(`Exited. Code: ${data.code}. Signal: ${data.signal}`);
64
- if (this.options.onExit) {
65
- this.options.onExit(data.code, data.signal);
66
- }
67
- });
68
- tsServer.onStdErr((error) => {
69
- if (error) {
70
- this.logger.error(error);
71
- }
72
- });
73
- tsServer.onError((err) => {
74
- if (err) {
75
- this.tsserverLogger.error('Exited with error. Error message is: {0}', err.message || err.name);
76
- }
77
- this.serviceExited();
78
- });
79
- tsServer.onEvent(event => this.dispatchEvent(event));
80
- this.primaryTsServer = tsServer;
81
- return true;
82
- }
83
- serviceExited() {
84
- this.primaryTsServer = null;
85
- this.loadingIndicator.reset();
86
- }
87
- dispatchEvent(event) {
88
- switch (event.event) {
89
- case "syntaxDiag" /* EventTypes.SyntaxDiag */:
90
- case "semanticDiag" /* EventTypes.SementicDiag */:
91
- case "suggestionDiag" /* EventTypes.SuggestionDiag */: {
92
- // This event also roughly signals that projects have been loaded successfully (since the TS server is synchronous)
93
- this.loadingIndicator.reset();
94
- this.options.onEvent?.(event);
95
- break;
96
- }
97
- // case EventTypes.ConfigFileDiag:
98
- // this._onConfigDiagnosticsReceived.fire(event as tsp.ConfigFileDiagnosticEvent);
99
- // break;
100
- // case EventTypes.projectLanguageServiceState: {
101
- // const body = (event as tsp.ProjectLanguageServiceStateEvent).body!;
102
- // if (this.serverState.type === ServerState.Type.Running) {
103
- // this.serverState.updateLanguageServiceEnabled(body.languageServiceEnabled);
104
- // }
105
- // this._onProjectLanguageServiceStateChanged.fire(body);
106
- // break;
107
- // }
108
- // case EventTypes.projectsUpdatedInBackground: {
109
- // this.loadingIndicator.reset();
110
- // const body = (event as tsp.ProjectsUpdatedInBackgroundEvent).body;
111
- // const resources = body.openFiles.map(file => this.toResource(file));
112
- // this.bufferSyncSupport.getErr(resources);
113
- // break;
114
- // }
115
- // case EventTypes.beginInstallTypes:
116
- // this._onDidBeginInstallTypings.fire((event as tsp.BeginInstallTypesEvent).body);
117
- // break;
118
- // case EventTypes.endInstallTypes:
119
- // this._onDidEndInstallTypings.fire((event as tsp.EndInstallTypesEvent).body);
120
- // break;
121
- // case EventTypes.typesInstallerInitializationFailed:
122
- // this._onTypesInstallerInitializationFailed.fire((event as tsp.TypesInstallerInitializationFailedEvent).body);
123
- // break;
124
- case "projectLoadingStart" /* EventTypes.ProjectLoadingStart */:
125
- this.loadingIndicator.startedLoadingProject(event.body.projectName);
126
- break;
127
- case "projectLoadingFinish" /* EventTypes.ProjectLoadingFinish */:
128
- this.loadingIndicator.finishedLoadingProject(event.body.projectName);
129
- break;
130
- }
131
- }
132
- shutdown() {
133
- if (this.loadingIndicator) {
134
- this.loadingIndicator.reset();
135
- }
136
- if (this.primaryTsServer) {
137
- this.primaryTsServer.kill();
138
- }
139
- }
140
- notify(command, args) {
141
- this.executeWithoutWaitingForResponse(command, args);
142
- }
143
- requestGeterr(args, token) {
144
- return this.executeAsync(CommandTypes.Geterr, args, token);
145
- }
146
- request(command, args, token, config) {
147
- return this.execute(command, args, token, config);
148
- }
149
- // Low-level API.
150
- execute(command, args, token, config) {
151
- let executions;
152
- // if (config?.cancelOnResourceChange) {
153
- // if (this.primaryTsServer) {
154
- // const source = new CancellationTokenSource();
155
- // token.onCancellationRequested(() => source.cancel());
156
- // const inFlight: ToCancelOnResourceChanged = {
157
- // resource: config.cancelOnResourceChange,
158
- // cancel: () => source.cancel(),
159
- // };
160
- // runningServerState.toCancelOnResourceChange.add(inFlight);
161
- // executions = this.executeImpl(command, args, {
162
- // isAsync: false,
163
- // token: source.token,
164
- // expectsResult: true,
165
- // ...config,
166
- // });
167
- // executions[0]!.finally(() => {
168
- // runningServerState.toCancelOnResourceChange.delete(inFlight);
169
- // source.dispose();
170
- // });
171
- // }
172
- // }
173
- if (!executions) {
174
- executions = this.executeImpl(command, args, {
175
- isAsync: false,
176
- token,
177
- expectsResult: true,
178
- ...config,
179
- });
180
- }
181
- if (config?.nonRecoverable) {
182
- executions[0].catch(err => this.fatalError(command, err));
183
- }
184
- if (command === CommandTypes.UpdateOpen) {
185
- // If update open has completed, consider that the project has loaded
186
- Promise.all(executions).then(() => {
187
- this.loadingIndicator.reset();
188
- });
189
- }
190
- return executions[0];
191
- }
192
- executeWithoutWaitingForResponse(command, args) {
193
- this.executeImpl(command, args, {
194
- isAsync: false,
195
- token: undefined,
196
- expectsResult: false,
197
- });
198
- }
199
- executeAsync(command, args, token) {
200
- return this.executeImpl(command, args, {
201
- isAsync: true,
202
- token,
203
- expectsResult: true,
204
- })[0];
205
- }
206
- executeImpl(command, args, executeInfo) {
207
- if (this.primaryTsServer) {
208
- return this.primaryTsServer.executeImpl(command, args, executeInfo);
209
- }
210
- else {
211
- return [Promise.resolve(ServerResponse.NoServer)];
212
- }
213
- }
214
- fatalError(command, error) {
215
- this.tsserverLogger.error(`A non-recoverable error occurred while executing command: ${command}`);
216
- if (error instanceof TypeScriptServerError && error.serverErrorText) {
217
- this.tsserverLogger.error(error.serverErrorText);
218
- }
219
- if (this.primaryTsServer) {
220
- this.logger.info('Killing TS Server');
221
- this.primaryTsServer.kill();
222
- if (error instanceof TypeScriptServerError) {
223
- this.primaryTsServer = null;
224
- }
225
- }
226
- }
227
- }
228
- //# sourceMappingURL=tsp-client.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"tsp-client.js","sourceRoot":"","sources":["../src/tsp-client.ts"],"names":[],"mappings":"AAAA;;;gGAGgG;AAChG;;;;;GAKG;AAIH,OAAO,EAAU,eAAe,EAAE,MAAM,mBAAmB,CAAC;AAC5D,OAAO,GAAG,MAAM,gBAAgB,CAAC;AACjC,OAAO,EAAE,GAAG,EAAc,MAAM,kBAAkB,CAAC;AAEnD,OAAO,EAAc,cAAc,EAA0B,MAAM,wBAAwB,CAAC;AAE5F,OAAO,EAAE,qBAAqB,EAAE,MAAM,2BAA2B,CAAC;AAClE,OAAO,EAAE,uBAAuB,EAAE,MAAM,uBAAuB,CAAC;AAChE,OAAO,MAAiB,MAAM,sBA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CAAC,OAAO,CAAC,cAAc,CAAC,QAAQ,CAAC,CAAC,CAAC;SACrD;IACL,CAAC;IAEO,UAAU,CAAC,OAAe,EAAE,KAAc;QAC9C,IAAI,CAAC,cAAc,CAAC,KAAK,CAAC,6DAA6D,OAAO,EAAE,CAAC,CAAC;QAClG,IAAI,KAAK,YAAY,qBAAqB,IAAI,KAAK,CAAC,eAAe,EAAE;YACjE,IAAI,CAAC,cAAc,CAAC,KAAK,CAAC,KAAK,CAAC,eAAe,CAAC,CAAC;SACpD;QAED,IAAI,IAAI,CAAC,eAAe,EAAE;YACtB,IAAI,CAAC,MAAM,CAAC,IAAI,CAAC,mBAAmB,CAAC,CAAC;YACtC,IAAI,CAAC,eAAe,CAAC,IAAI,EAAE,CAAC;YAC5B,IAAI,KAAK,YAAY,qBAAqB,EAAE;gBACxC,IAAI,CAAC,eAAe,GAAG,IAAI,CAAC;aAC/B;SACJ;IACL,CAAC;CACJ"}
@@ -1,2 +0,0 @@
1
- export {};
2
- //# sourceMappingURL=tsp-client.spec.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"tsp-client.spec.d.ts","sourceRoot":"","sources":["../src/tsp-client.spec.ts"],"names":[],"mappings":""}
@@ -1,113 +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 * as chai from 'chai';
8
- import { TspClient } from './tsp-client.js';
9
- import { ConsoleLogger } from './utils/logger.js';
10
- import { filePath, readContents, TestLspClient, uri } from './test-utils.js';
11
- import { tsp } from './ts-protocol.js';
12
- import { Trace } from './tsServer/tracer.js';
13
- import { TypeScriptVersionProvider } from './tsServer/versionProvider.js';
14
- import { TsServerLogLevel } from './utils/configuration.js';
15
- import { noopLogDirectoryProvider } from './tsServer/logDirectoryProvider.js';
16
- var CommandTypes = tsp.CommandTypes;
17
- const assert = chai.assert;
18
- const logger = new ConsoleLogger();
19
- const lspClientOptions = {
20
- rootUri: uri(),
21
- publishDiagnostics: () => { },
22
- };
23
- const lspClient = new TestLspClient(lspClientOptions, logger);
24
- const configuration = {
25
- logger,
26
- lspClient,
27
- tsserverLogVerbosity: TsServerLogLevel.Off,
28
- };
29
- const typescriptVersionProvider = new TypeScriptVersionProvider(configuration.tsserverPath, logger);
30
- const bundled = typescriptVersionProvider.bundledVersion();
31
- let server;
32
- before(() => {
33
- server = new TspClient({
34
- ...configuration,
35
- logDirectoryProvider: noopLogDirectoryProvider,
36
- logVerbosity: configuration.tsserverLogVerbosity,
37
- trace: Trace.Off,
38
- typescriptVersion: bundled,
39
- });
40
- });
41
- after(() => {
42
- server.shutdown();
43
- });
44
- describe('ts server client', () => {
45
- before(() => {
46
- server.start();
47
- });
48
- it('completion', async () => {
49
- const f = filePath('module2.ts');
50
- server.notify(CommandTypes.Open, {
51
- file: f,
52
- fileContent: readContents(f),
53
- });
54
- const completions = await server.request(CommandTypes.CompletionInfo, {
55
- file: f,
56
- line: 1,
57
- offset: 0,
58
- prefix: 'im',
59
- });
60
- assert.isDefined(completions.body);
61
- assert.equal(completions.body.entries[1].name, 'ImageBitmap');
62
- });
63
- it('references', async () => {
64
- const f = filePath('module2.ts');
65
- server.notify(CommandTypes.Open, {
66
- file: f,
67
- fileContent: readContents(f),
68
- });
69
- const references = await server.request(CommandTypes.References, {
70
- file: f,
71
- line: 8,
72
- offset: 16,
73
- });
74
- assert.isDefined(references.body);
75
- assert.equal(references.body.symbolName, 'doStuff');
76
- });
77
- it('inlayHints', async () => {
78
- const f = filePath('module2.ts');
79
- server.notify(CommandTypes.Open, {
80
- file: f,
81
- fileContent: readContents(f),
82
- });
83
- await server.request(CommandTypes.Configure, {
84
- preferences: {
85
- includeInlayFunctionLikeReturnTypeHints: true,
86
- },
87
- });
88
- const inlayHints = await server.request(CommandTypes.ProvideInlayHints, {
89
- file: f,
90
- start: 0,
91
- length: 1000,
92
- });
93
- assert.isDefined(inlayHints.body);
94
- assert.equal(inlayHints.body[0].text, ': boolean');
95
- });
96
- it('documentHighlight', async () => {
97
- const f = filePath('module2.ts');
98
- server.notify(CommandTypes.Open, {
99
- file: f,
100
- fileContent: readContents(f),
101
- });
102
- const response = await server.request(CommandTypes.DocumentHighlights, {
103
- file: f,
104
- line: 8,
105
- offset: 16,
106
- filesToSearch: [f],
107
- });
108
- assert.isDefined(response.body);
109
- assert.isTrue(response.body.some(({ file }) => file.endsWith('module2.ts')), JSON.stringify(response.body, undefined, 2));
110
- assert.isFalse(response.body.some(({ file: file_1 }) => file_1.endsWith('module1.ts')), JSON.stringify(response.body, undefined, 2));
111
- });
112
- });
113
- //# sourceMappingURL=tsp-client.spec.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"tsp-client.spec.js","sourceRoot":"","sources":["../src/tsp-client.spec.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAEH,OAAO,KAAK,IAAI,MAAM,MAAM,CAAC;AAC7B,OAAO,EAAE,SAAS,EAAE,MAAM,iBAAiB,CAAC;AAC5C,OAAO,EAAE,aAAa,EAAE,MAAM,mBAAmB,CAAC;AAClD,OAAO,EAAE,QAAQ,EAAE,YAAY,EAAE,aAAa,EAAE,GAAG,EAAE,MAAM,iBAAiB,CAAC;AAC7E,OAAO,EAAE,GAAG,EAAE,MAAM,kBAAkB,CAAC;AACvC,OAAO,EAAE,KAAK,EAAE,MAAM,sBAAsB,CAAC;AAC7C,OAAO,EAAE,yBAAyB,EAAE,MAAM,+BAA+B,CAAC;AAC1E,OAAO,EAAE,gBAAgB,EAAkC,MAAM,0BAA0B,CAAC;AAC5F,OAAO,EAAE,wBAAwB,EAAE,MAAM,oCAAoC,CAAC;AAE9E,IAAO,YAAY,GAAG,GAAG,CAAC,YAAY,CAAC;AAEvC,MAAM,MAAM,GAAG,IAAI,CAAC,MAAM,CAAC;AAC3B,MAAM,MAAM,GAAG,IAAI,aAAa,EAAE,CAAC;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EAAE,IAAI,EAAE,MAAM,EAAE,EAAE,EAAE,CAAC,MAAM,CAAC,QAAQ,CAAC,YAAY,CAAC,CAAC,EAAE,IAAI,CAAC,SAAS,CAAC,QAAQ,CAAC,IAAI,EAAE,SAAS,EAAE,CAAC,CAAC,CAAC,CAAC;IAC1I,CAAC,CAAC,CAAC;AACP,CAAC,CAAC,CAAC"}
@@ -1,15 +0,0 @@
1
- import type * as lsp from 'vscode-languageserver/node.js';
2
- export declare const enum MarkdownStringTextNewlineStyle {
3
- Paragraph = 0,
4
- Break = 1
5
- }
6
- export declare class MarkdownString {
7
- value: string;
8
- constructor(value?: string);
9
- appendText(value: string, newlineStyle?: MarkdownStringTextNewlineStyle): MarkdownString;
10
- appendMarkdown(value: string): MarkdownString;
11
- appendCodeblock(langId: string, code: string): MarkdownString;
12
- toMarkupContent(): lsp.MarkupContent;
13
- }
14
- export declare function escapeMarkdownSyntaxTokens(text: string): string;
15
- //# sourceMappingURL=MarkdownString.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"MarkdownString.d.ts","sourceRoot":"","sources":["../../src/utils/MarkdownString.ts"],"names":[],"mappings":"AAWA,OAAO,KAAK,KAAK,GAAG,MAAM,+BAA+B,CAAC;AAE1D,0BAAkB,8BAA8B;IAC5C,SAAS,IAAI;IACb,KAAK,IAAI;CACZ;AAED,qBAAa,cAAc;IACJ,KAAK;gBAAL,KAAK,SAAK;IAE7B,UAAU,CAAC,KAAK,EAAE,MAAM,EAAE,YAAY,GAAE,8BAAyE,GAAG,cAAc;IASlI,cAAc,CAAC,KAAK,EAAE,MAAM,GAAG,cAAc;IAK7C,eAAe,CAAC,MAAM,EAAE,MAAM,EAAE,IAAI,EAAE,MAAM,GAAG,cAAc;IAS7D,eAAe,IAAI,GAAG,CAAC,aAAa;CAMvC;AAED,wBAAgB,0BAA0B,CAAC,IAAI,EAAE,MAAM,GAAG,MAAM,CAG/D"}