@codingame/monaco-languageclient-wrapper 5.0.0-next.1 → 5.0.0-update-monaco.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 (200) hide show
  1. package/dist/_virtual/_commonjsHelpers.js +1 -28
  2. package/dist/_virtual/_rollupPluginBabelHelpers.js +29 -29
  3. package/dist/extensions/java/extension.js +1 -1
  4. package/dist/extensions/java/inlayHintsProvider.js +3 -4
  5. package/dist/extensions/java/protocol.js +15 -16
  6. package/dist/extensions/java/sourceAction.js +1 -1
  7. package/dist/index.d.ts +28 -9266
  8. package/dist/node_modules/delay/index.js +1 -2
  9. package/dist/node_modules/vscode-jsonrpc/lib/browser/main.js +1 -1
  10. package/dist/node_modules/vscode-jsonrpc/lib/common/api.js +1 -1
  11. package/dist/node_modules/vscode-jsonrpc/lib/common/cancellation.js +84 -86
  12. package/dist/node_modules/vscode-jsonrpc/lib/common/connection.js +20 -18
  13. package/dist/node_modules/vscode-jsonrpc/lib/common/disposable.js +11 -12
  14. package/dist/node_modules/vscode-jsonrpc/lib/common/events.js +112 -113
  15. package/dist/node_modules/vscode-jsonrpc/lib/common/is.js +1 -1
  16. package/dist/node_modules/vscode-jsonrpc/lib/common/linkedMap.js +378 -380
  17. package/dist/node_modules/vscode-jsonrpc/lib/common/messageBuffer.js +1 -1
  18. package/dist/node_modules/vscode-jsonrpc/lib/common/messageReader.js +186 -182
  19. package/dist/node_modules/vscode-jsonrpc/lib/common/messageWriter.js +110 -111
  20. package/dist/node_modules/vscode-jsonrpc/lib/common/messages.js +232 -233
  21. package/dist/src/createLanguageClient.js +43 -19
  22. package/dist/src/customRequests.js +4 -5
  23. package/dist/src/extensions/cobol.js +2 -3
  24. package/dist/src/extensions/csharp.js +2 -3
  25. package/dist/src/extensions/tools.js +5 -1
  26. package/dist/src/extensions.js +8 -12
  27. package/dist/src/infrastructure.js +18 -4
  28. package/dist/src/languageClient.js +17 -20
  29. package/dist/src/languageClientOptions.js +2 -3
  30. package/package.json +56 -52
  31. package/stats.html +32 -28
  32. package/dist/_virtual/_vscode.js +0 -4
  33. package/dist/_virtual/api2.js +0 -2
  34. package/dist/_virtual/api3.js +0 -2
  35. package/dist/_virtual/async.js +0 -2
  36. package/dist/_virtual/callHierarchy.js +0 -2
  37. package/dist/_virtual/client.js +0 -2
  38. package/dist/_virtual/codeAction.js +0 -2
  39. package/dist/_virtual/codeConverter.js +0 -2
  40. package/dist/_virtual/codeLens.js +0 -2
  41. package/dist/_virtual/colorProvider.js +0 -2
  42. package/dist/_virtual/completion.js +0 -2
  43. package/dist/_virtual/configuration.js +0 -2
  44. package/dist/_virtual/connection2.js +0 -2
  45. package/dist/_virtual/declaration.js +0 -2
  46. package/dist/_virtual/definition.js +0 -2
  47. package/dist/_virtual/diagnostic.js +0 -2
  48. package/dist/_virtual/documentHighlight.js +0 -2
  49. package/dist/_virtual/documentLink.js +0 -2
  50. package/dist/_virtual/documentSymbol.js +0 -2
  51. package/dist/_virtual/executeCommand.js +0 -2
  52. package/dist/_virtual/features.js +0 -2
  53. package/dist/_virtual/fileOperations.js +0 -2
  54. package/dist/_virtual/fileSystemWatcher.js +0 -2
  55. package/dist/_virtual/foldingRange.js +0 -2
  56. package/dist/_virtual/formatting.js +0 -2
  57. package/dist/_virtual/hover.js +0 -2
  58. package/dist/_virtual/implementation.js +0 -2
  59. package/dist/_virtual/inlayHint.js +0 -2
  60. package/dist/_virtual/inlineValue.js +0 -2
  61. package/dist/_virtual/is2.js +0 -2
  62. package/dist/_virtual/is3.js +0 -2
  63. package/dist/_virtual/linkedEditingRange.js +0 -2
  64. package/dist/_virtual/main2.js +0 -2
  65. package/dist/_virtual/main3.js +0 -2
  66. package/dist/_virtual/main4.js +0 -4
  67. package/dist/_virtual/messages2.js +0 -2
  68. package/dist/_virtual/notebook.js +0 -2
  69. package/dist/_virtual/path.js +0 -4
  70. package/dist/_virtual/progress.js +0 -2
  71. package/dist/_virtual/progressPart.js +0 -2
  72. package/dist/_virtual/protocol.callHierarchy.js +0 -2
  73. package/dist/_virtual/protocol.colorProvider.js +0 -2
  74. package/dist/_virtual/protocol.configuration.js +0 -2
  75. package/dist/_virtual/protocol.declaration.js +0 -2
  76. package/dist/_virtual/protocol.diagnostic.js +0 -2
  77. package/dist/_virtual/protocol.fileOperations.js +0 -2
  78. package/dist/_virtual/protocol.foldingRange.js +0 -2
  79. package/dist/_virtual/protocol.implementation.js +0 -2
  80. package/dist/_virtual/protocol.inlayHint.js +0 -2
  81. package/dist/_virtual/protocol.inlineValue.js +0 -2
  82. package/dist/_virtual/protocol.js +0 -2
  83. package/dist/_virtual/protocol.linkedEditingRange.js +0 -2
  84. package/dist/_virtual/protocol.moniker.js +0 -2
  85. package/dist/_virtual/protocol.notebook.js +0 -2
  86. package/dist/_virtual/protocol.progress.js +0 -2
  87. package/dist/_virtual/protocol.selectionRange.js +0 -2
  88. package/dist/_virtual/protocol.semanticTokens.js +0 -2
  89. package/dist/_virtual/protocol.showDocument.js +0 -2
  90. package/dist/_virtual/protocol.typeDefinition.js +0 -2
  91. package/dist/_virtual/protocol.typeHierarchy.js +0 -2
  92. package/dist/_virtual/protocol.workspaceFolder.js +0 -2
  93. package/dist/_virtual/protocolCallHierarchyItem.js +0 -2
  94. package/dist/_virtual/protocolCodeAction.js +0 -2
  95. package/dist/_virtual/protocolCodeLens.js +0 -2
  96. package/dist/_virtual/protocolCompletionItem.js +0 -2
  97. package/dist/_virtual/protocolConverter.js +0 -2
  98. package/dist/_virtual/protocolDiagnostic.js +0 -2
  99. package/dist/_virtual/protocolDocumentLink.js +0 -2
  100. package/dist/_virtual/protocolInlayHint.js +0 -2
  101. package/dist/_virtual/protocolTypeHierarchyItem.js +0 -2
  102. package/dist/_virtual/protocolWorkspaceSymbol.js +0 -2
  103. package/dist/_virtual/reference.js +0 -2
  104. package/dist/_virtual/rename.js +0 -2
  105. package/dist/_virtual/selectionRange.js +0 -2
  106. package/dist/_virtual/semanticTokens.js +0 -2
  107. package/dist/_virtual/signatureHelp.js +0 -2
  108. package/dist/_virtual/textSynchronization.js +0 -2
  109. package/dist/_virtual/typeDefinition.js +0 -2
  110. package/dist/_virtual/typeHierarchy.js +0 -2
  111. package/dist/_virtual/uuid.js +0 -2
  112. package/dist/_virtual/workspaceFolder.js +0 -2
  113. package/dist/_virtual/workspaceSymbol.js +0 -2
  114. package/dist/node_modules/balanced-match/index.js +0 -52
  115. package/dist/node_modules/monaco-languageclient/lib/monaco-language-client.js +0 -127
  116. package/dist/node_modules/vscode-jsonrpc/browser.js +0 -4
  117. package/dist/node_modules/vscode-languageclient/lib/browser/main.js +0 -49
  118. package/dist/node_modules/vscode-languageclient/lib/common/api.js +0 -51
  119. package/dist/node_modules/vscode-languageclient/lib/common/callHierarchy.js +0 -98
  120. package/dist/node_modules/vscode-languageclient/lib/common/client.js +0 -1527
  121. package/dist/node_modules/vscode-languageclient/lib/common/codeAction.js +0 -92
  122. package/dist/node_modules/vscode-languageclient/lib/common/codeConverter.js +0 -881
  123. package/dist/node_modules/vscode-languageclient/lib/common/codeLens.js +0 -84
  124. package/dist/node_modules/vscode-languageclient/lib/common/colorProvider.js +0 -77
  125. package/dist/node_modules/vscode-languageclient/lib/common/completion.js +0 -105
  126. package/dist/node_modules/vscode-languageclient/lib/common/configuration.js +0 -214
  127. package/dist/node_modules/vscode-languageclient/lib/common/declaration.js +0 -59
  128. package/dist/node_modules/vscode-languageclient/lib/common/definition.js +0 -62
  129. package/dist/node_modules/vscode-languageclient/lib/common/diagnostic.js +0 -839
  130. package/dist/node_modules/vscode-languageclient/lib/common/documentHighlight.js +0 -57
  131. package/dist/node_modules/vscode-languageclient/lib/common/documentLink.js +0 -74
  132. package/dist/node_modules/vscode-languageclient/lib/common/documentSymbol.js +0 -82
  133. package/dist/node_modules/vscode-languageclient/lib/common/executeCommand.js +0 -83
  134. package/dist/node_modules/vscode-languageclient/lib/common/features.js +0 -310
  135. package/dist/node_modules/vscode-languageclient/lib/common/fileOperations.js +0 -319
  136. package/dist/node_modules/vscode-languageclient/lib/common/fileSystemWatcher.js +0 -104
  137. package/dist/node_modules/vscode-languageclient/lib/common/foldingRange.js +0 -66
  138. package/dist/node_modules/vscode-languageclient/lib/common/formatting.js +0 -165
  139. package/dist/node_modules/vscode-languageclient/lib/common/hover.js +0 -62
  140. package/dist/node_modules/vscode-languageclient/lib/common/implementation.js +0 -59
  141. package/dist/node_modules/vscode-languageclient/lib/common/inlayHint.js +0 -94
  142. package/dist/node_modules/vscode-languageclient/lib/common/inlineValue.js +0 -73
  143. package/dist/node_modules/vscode-languageclient/lib/common/linkedEditingRange.js +0 -58
  144. package/dist/node_modules/vscode-languageclient/lib/common/notebook.js +0 -858
  145. package/dist/node_modules/vscode-languageclient/lib/common/progress.js +0 -51
  146. package/dist/node_modules/vscode-languageclient/lib/common/progressPart.js +0 -107
  147. package/dist/node_modules/vscode-languageclient/lib/common/protocolCallHierarchyItem.js +0 -15
  148. package/dist/node_modules/vscode-languageclient/lib/common/protocolCodeAction.js +0 -13
  149. package/dist/node_modules/vscode-languageclient/lib/common/protocolCodeLens.js +0 -12
  150. package/dist/node_modules/vscode-languageclient/lib/common/protocolCompletionItem.js +0 -12
  151. package/dist/node_modules/vscode-languageclient/lib/common/protocolConverter.js +0 -1129
  152. package/dist/node_modules/vscode-languageclient/lib/common/protocolDiagnostic.js +0 -27
  153. package/dist/node_modules/vscode-languageclient/lib/common/protocolDocumentLink.js +0 -12
  154. package/dist/node_modules/vscode-languageclient/lib/common/protocolInlayHint.js +0 -12
  155. package/dist/node_modules/vscode-languageclient/lib/common/protocolTypeHierarchyItem.js +0 -15
  156. package/dist/node_modules/vscode-languageclient/lib/common/protocolWorkspaceSymbol.js +0 -17
  157. package/dist/node_modules/vscode-languageclient/lib/common/reference.js +0 -60
  158. package/dist/node_modules/vscode-languageclient/lib/common/rename.js +0 -112
  159. package/dist/node_modules/vscode-languageclient/lib/common/selectionRange.js +0 -62
  160. package/dist/node_modules/vscode-languageclient/lib/common/semanticTokens.js +0 -144
  161. package/dist/node_modules/vscode-languageclient/lib/common/signatureHelp.js +0 -78
  162. package/dist/node_modules/vscode-languageclient/lib/common/textSynchronization.js +0 -422
  163. package/dist/node_modules/vscode-languageclient/lib/common/typeDefinition.js +0 -60
  164. package/dist/node_modules/vscode-languageclient/lib/common/typeHierarchy.js +0 -97
  165. package/dist/node_modules/vscode-languageclient/lib/common/utils/async.js +0 -269
  166. package/dist/node_modules/vscode-languageclient/lib/common/utils/is.js +0 -54
  167. package/dist/node_modules/vscode-languageclient/lib/common/utils/uuid.js +0 -51
  168. package/dist/node_modules/vscode-languageclient/lib/common/workspaceFolder.js +0 -154
  169. package/dist/node_modules/vscode-languageclient/lib/common/workspaceSymbol.js +0 -87
  170. package/dist/node_modules/vscode-languageclient/node_modules/brace-expansion/index.js +0 -160
  171. package/dist/node_modules/vscode-languageclient/node_modules/minimatch/lib/path.js +0 -2
  172. package/dist/node_modules/vscode-languageclient/node_modules/minimatch/minimatch.js +0 -567
  173. package/dist/node_modules/vscode-languageserver-protocol/browser.js +0 -4
  174. package/dist/node_modules/vscode-languageserver-protocol/lib/browser/main.js +0 -30
  175. package/dist/node_modules/vscode-languageserver-protocol/lib/common/api.js +0 -43
  176. package/dist/node_modules/vscode-languageserver-protocol/lib/common/connection.js +0 -14
  177. package/dist/node_modules/vscode-languageserver-protocol/lib/common/messages.js +0 -43
  178. package/dist/node_modules/vscode-languageserver-protocol/lib/common/protocol.callHierarchy.js +0 -23
  179. package/dist/node_modules/vscode-languageserver-protocol/lib/common/protocol.colorProvider.js +0 -18
  180. package/dist/node_modules/vscode-languageserver-protocol/lib/common/protocol.configuration.js +0 -13
  181. package/dist/node_modules/vscode-languageserver-protocol/lib/common/protocol.declaration.js +0 -13
  182. package/dist/node_modules/vscode-languageserver-protocol/lib/common/protocol.diagnostic.js +0 -42
  183. package/dist/node_modules/vscode-languageserver-protocol/lib/common/protocol.fileOperations.js +0 -42
  184. package/dist/node_modules/vscode-languageserver-protocol/lib/common/protocol.foldingRange.js +0 -13
  185. package/dist/node_modules/vscode-languageserver-protocol/lib/common/protocol.implementation.js +0 -13
  186. package/dist/node_modules/vscode-languageserver-protocol/lib/common/protocol.inlayHint.js +0 -23
  187. package/dist/node_modules/vscode-languageserver-protocol/lib/common/protocol.inlineValue.js +0 -18
  188. package/dist/node_modules/vscode-languageserver-protocol/lib/common/protocol.js +0 -494
  189. package/dist/node_modules/vscode-languageserver-protocol/lib/common/protocol.linkedEditingRange.js +0 -13
  190. package/dist/node_modules/vscode-languageserver-protocol/lib/common/protocol.moniker.js +0 -25
  191. package/dist/node_modules/vscode-languageserver-protocol/lib/common/protocol.notebook.js +0 -185
  192. package/dist/node_modules/vscode-languageserver-protocol/lib/common/protocol.progress.js +0 -28
  193. package/dist/node_modules/vscode-languageserver-protocol/lib/common/protocol.selectionRange.js +0 -13
  194. package/dist/node_modules/vscode-languageserver-protocol/lib/common/protocol.semanticTokens.js +0 -39
  195. package/dist/node_modules/vscode-languageserver-protocol/lib/common/protocol.showDocument.js +0 -13
  196. package/dist/node_modules/vscode-languageserver-protocol/lib/common/protocol.typeDefinition.js +0 -13
  197. package/dist/node_modules/vscode-languageserver-protocol/lib/common/protocol.typeHierarchy.js +0 -23
  198. package/dist/node_modules/vscode-languageserver-protocol/lib/common/protocol.workspaceFolder.js +0 -18
  199. package/dist/node_modules/vscode-languageserver-protocol/lib/common/utils/is.js +0 -40
  200. package/dist/node_modules/vscode-languageserver-types/lib/esm/main.js +0 -1583
@@ -1,1583 +0,0 @@
1
- var DocumentUri;
2
- (function (DocumentUri) {
3
- function is(value) {
4
- return typeof value === 'string';
5
- }
6
- DocumentUri.is = is;
7
- })(DocumentUri || (DocumentUri = {}));
8
- var URI;
9
- (function (URI) {
10
- function is(value) {
11
- return typeof value === 'string';
12
- }
13
- URI.is = is;
14
- })(URI || (URI = {}));
15
- var integer;
16
- (function (integer) {
17
- integer.MIN_VALUE = -2147483648;
18
- integer.MAX_VALUE = 2147483647;
19
- function is(value) {
20
- return typeof value === 'number' && integer.MIN_VALUE <= value && value <= integer.MAX_VALUE;
21
- }
22
- integer.is = is;
23
- })(integer || (integer = {}));
24
- var uinteger;
25
- (function (uinteger) {
26
- uinteger.MIN_VALUE = 0;
27
- uinteger.MAX_VALUE = 2147483647;
28
- function is(value) {
29
- return typeof value === 'number' && uinteger.MIN_VALUE <= value && value <= uinteger.MAX_VALUE;
30
- }
31
- uinteger.is = is;
32
- })(uinteger || (uinteger = {}));
33
- var Position;
34
- (function (Position) {
35
- function create(line, character) {
36
- if (line === Number.MAX_VALUE) {
37
- line = uinteger.MAX_VALUE;
38
- }
39
- if (character === Number.MAX_VALUE) {
40
- character = uinteger.MAX_VALUE;
41
- }
42
- return {
43
- line: line,
44
- character: character
45
- };
46
- }
47
- Position.create = create;
48
- function is(value) {
49
- var candidate = value;
50
- return Is.objectLiteral(candidate) && Is.uinteger(candidate.line) && Is.uinteger(candidate.character);
51
- }
52
- Position.is = is;
53
- })(Position || (Position = {}));
54
- var Range;
55
- (function (Range) {
56
- function create(one, two, three, four) {
57
- if (Is.uinteger(one) && Is.uinteger(two) && Is.uinteger(three) && Is.uinteger(four)) {
58
- return {
59
- start: Position.create(one, two),
60
- end: Position.create(three, four)
61
- };
62
- } else if (Position.is(one) && Position.is(two)) {
63
- return {
64
- start: one,
65
- end: two
66
- };
67
- } else {
68
- throw new Error("Range#create called with invalid arguments[".concat(one, ", ").concat(two, ", ").concat(three, ", ").concat(four, "]"));
69
- }
70
- }
71
- Range.create = create;
72
- function is(value) {
73
- var candidate = value;
74
- return Is.objectLiteral(candidate) && Position.is(candidate.start) && Position.is(candidate.end);
75
- }
76
- Range.is = is;
77
- })(Range || (Range = {}));
78
- var Location;
79
- (function (Location) {
80
- function create(uri, range) {
81
- return {
82
- uri: uri,
83
- range: range
84
- };
85
- }
86
- Location.create = create;
87
- function is(value) {
88
- var candidate = value;
89
- return Is.objectLiteral(candidate) && Range.is(candidate.range) && (Is.string(candidate.uri) || Is.undefined(candidate.uri));
90
- }
91
- Location.is = is;
92
- })(Location || (Location = {}));
93
- var LocationLink;
94
- (function (LocationLink) {
95
- function create(targetUri, targetRange, targetSelectionRange, originSelectionRange) {
96
- return {
97
- targetUri: targetUri,
98
- targetRange: targetRange,
99
- targetSelectionRange: targetSelectionRange,
100
- originSelectionRange: originSelectionRange
101
- };
102
- }
103
- LocationLink.create = create;
104
- function is(value) {
105
- var candidate = value;
106
- return Is.objectLiteral(candidate) && Range.is(candidate.targetRange) && Is.string(candidate.targetUri) && Range.is(candidate.targetSelectionRange) && (Range.is(candidate.originSelectionRange) || Is.undefined(candidate.originSelectionRange));
107
- }
108
- LocationLink.is = is;
109
- })(LocationLink || (LocationLink = {}));
110
- var Color;
111
- (function (Color) {
112
- function create(red, green, blue, alpha) {
113
- return {
114
- red: red,
115
- green: green,
116
- blue: blue,
117
- alpha: alpha
118
- };
119
- }
120
- Color.create = create;
121
- function is(value) {
122
- var candidate = value;
123
- return Is.objectLiteral(candidate) && Is.numberRange(candidate.red, 0, 1) && Is.numberRange(candidate.green, 0, 1) && Is.numberRange(candidate.blue, 0, 1) && Is.numberRange(candidate.alpha, 0, 1);
124
- }
125
- Color.is = is;
126
- })(Color || (Color = {}));
127
- var ColorInformation;
128
- (function (ColorInformation) {
129
- function create(range, color) {
130
- return {
131
- range: range,
132
- color: color
133
- };
134
- }
135
- ColorInformation.create = create;
136
- function is(value) {
137
- var candidate = value;
138
- return Is.objectLiteral(candidate) && Range.is(candidate.range) && Color.is(candidate.color);
139
- }
140
- ColorInformation.is = is;
141
- })(ColorInformation || (ColorInformation = {}));
142
- var ColorPresentation;
143
- (function (ColorPresentation) {
144
- function create(label, textEdit, additionalTextEdits) {
145
- return {
146
- label: label,
147
- textEdit: textEdit,
148
- additionalTextEdits: additionalTextEdits
149
- };
150
- }
151
- ColorPresentation.create = create;
152
- function is(value) {
153
- var candidate = value;
154
- return Is.objectLiteral(candidate) && Is.string(candidate.label) && (Is.undefined(candidate.textEdit) || TextEdit.is(candidate)) && (Is.undefined(candidate.additionalTextEdits) || Is.typedArray(candidate.additionalTextEdits, TextEdit.is));
155
- }
156
- ColorPresentation.is = is;
157
- })(ColorPresentation || (ColorPresentation = {}));
158
- var FoldingRangeKind;
159
- (function (FoldingRangeKind) {
160
- FoldingRangeKind.Comment = 'comment';
161
- FoldingRangeKind.Imports = 'imports';
162
- FoldingRangeKind.Region = 'region';
163
- })(FoldingRangeKind || (FoldingRangeKind = {}));
164
- var FoldingRange;
165
- (function (FoldingRange) {
166
- function create(startLine, endLine, startCharacter, endCharacter, kind, collapsedText) {
167
- var result = {
168
- startLine: startLine,
169
- endLine: endLine
170
- };
171
- if (Is.defined(startCharacter)) {
172
- result.startCharacter = startCharacter;
173
- }
174
- if (Is.defined(endCharacter)) {
175
- result.endCharacter = endCharacter;
176
- }
177
- if (Is.defined(kind)) {
178
- result.kind = kind;
179
- }
180
- if (Is.defined(collapsedText)) {
181
- result.collapsedText = collapsedText;
182
- }
183
- return result;
184
- }
185
- FoldingRange.create = create;
186
- function is(value) {
187
- var candidate = value;
188
- return Is.objectLiteral(candidate) && Is.uinteger(candidate.startLine) && Is.uinteger(candidate.startLine) && (Is.undefined(candidate.startCharacter) || Is.uinteger(candidate.startCharacter)) && (Is.undefined(candidate.endCharacter) || Is.uinteger(candidate.endCharacter)) && (Is.undefined(candidate.kind) || Is.string(candidate.kind));
189
- }
190
- FoldingRange.is = is;
191
- })(FoldingRange || (FoldingRange = {}));
192
- var DiagnosticRelatedInformation;
193
- (function (DiagnosticRelatedInformation) {
194
- function create(location, message) {
195
- return {
196
- location: location,
197
- message: message
198
- };
199
- }
200
- DiagnosticRelatedInformation.create = create;
201
- function is(value) {
202
- var candidate = value;
203
- return Is.defined(candidate) && Location.is(candidate.location) && Is.string(candidate.message);
204
- }
205
- DiagnosticRelatedInformation.is = is;
206
- })(DiagnosticRelatedInformation || (DiagnosticRelatedInformation = {}));
207
- var DiagnosticSeverity;
208
- (function (DiagnosticSeverity) {
209
- DiagnosticSeverity.Error = 1;
210
- DiagnosticSeverity.Warning = 2;
211
- DiagnosticSeverity.Information = 3;
212
- DiagnosticSeverity.Hint = 4;
213
- })(DiagnosticSeverity || (DiagnosticSeverity = {}));
214
- var DiagnosticTag;
215
- (function (DiagnosticTag) {
216
- DiagnosticTag.Unnecessary = 1;
217
- DiagnosticTag.Deprecated = 2;
218
- })(DiagnosticTag || (DiagnosticTag = {}));
219
- var CodeDescription;
220
- (function (CodeDescription) {
221
- function is(value) {
222
- var candidate = value;
223
- return Is.objectLiteral(candidate) && Is.string(candidate.href);
224
- }
225
- CodeDescription.is = is;
226
- })(CodeDescription || (CodeDescription = {}));
227
- var Diagnostic;
228
- (function (Diagnostic) {
229
- function create(range, message, severity, code, source, relatedInformation) {
230
- var result = {
231
- range: range,
232
- message: message
233
- };
234
- if (Is.defined(severity)) {
235
- result.severity = severity;
236
- }
237
- if (Is.defined(code)) {
238
- result.code = code;
239
- }
240
- if (Is.defined(source)) {
241
- result.source = source;
242
- }
243
- if (Is.defined(relatedInformation)) {
244
- result.relatedInformation = relatedInformation;
245
- }
246
- return result;
247
- }
248
- Diagnostic.create = create;
249
- function is(value) {
250
- var _a;
251
- var candidate = value;
252
- return Is.defined(candidate) && Range.is(candidate.range) && Is.string(candidate.message) && (Is.number(candidate.severity) || Is.undefined(candidate.severity)) && (Is.integer(candidate.code) || Is.string(candidate.code) || Is.undefined(candidate.code)) && (Is.undefined(candidate.codeDescription) || Is.string((_a = candidate.codeDescription) === null || _a === void 0 ? void 0 : _a.href)) && (Is.string(candidate.source) || Is.undefined(candidate.source)) && (Is.undefined(candidate.relatedInformation) || Is.typedArray(candidate.relatedInformation, DiagnosticRelatedInformation.is));
253
- }
254
- Diagnostic.is = is;
255
- })(Diagnostic || (Diagnostic = {}));
256
- var Command;
257
- (function (Command) {
258
- function create(title, command) {
259
- var args = [];
260
- for (var _i = 2; _i < arguments.length; _i++) {
261
- args[_i - 2] = arguments[_i];
262
- }
263
- var result = {
264
- title: title,
265
- command: command
266
- };
267
- if (Is.defined(args) && args.length > 0) {
268
- result.arguments = args;
269
- }
270
- return result;
271
- }
272
- Command.create = create;
273
- function is(value) {
274
- var candidate = value;
275
- return Is.defined(candidate) && Is.string(candidate.title) && Is.string(candidate.command);
276
- }
277
- Command.is = is;
278
- })(Command || (Command = {}));
279
- var TextEdit;
280
- (function (TextEdit) {
281
- function replace(range, newText) {
282
- return {
283
- range: range,
284
- newText: newText
285
- };
286
- }
287
- TextEdit.replace = replace;
288
- function insert(position, newText) {
289
- return {
290
- range: {
291
- start: position,
292
- end: position
293
- },
294
- newText: newText
295
- };
296
- }
297
- TextEdit.insert = insert;
298
- function del(range) {
299
- return {
300
- range: range,
301
- newText: ''
302
- };
303
- }
304
- TextEdit.del = del;
305
- function is(value) {
306
- var candidate = value;
307
- return Is.objectLiteral(candidate) && Is.string(candidate.newText) && Range.is(candidate.range);
308
- }
309
- TextEdit.is = is;
310
- })(TextEdit || (TextEdit = {}));
311
- var ChangeAnnotation;
312
- (function (ChangeAnnotation) {
313
- function create(label, needsConfirmation, description) {
314
- var result = {
315
- label: label
316
- };
317
- if (needsConfirmation !== undefined) {
318
- result.needsConfirmation = needsConfirmation;
319
- }
320
- if (description !== undefined) {
321
- result.description = description;
322
- }
323
- return result;
324
- }
325
- ChangeAnnotation.create = create;
326
- function is(value) {
327
- var candidate = value;
328
- return Is.objectLiteral(candidate) && Is.string(candidate.label) && (Is.boolean(candidate.needsConfirmation) || candidate.needsConfirmation === undefined) && (Is.string(candidate.description) || candidate.description === undefined);
329
- }
330
- ChangeAnnotation.is = is;
331
- })(ChangeAnnotation || (ChangeAnnotation = {}));
332
- var ChangeAnnotationIdentifier;
333
- (function (ChangeAnnotationIdentifier) {
334
- function is(value) {
335
- var candidate = value;
336
- return Is.string(candidate);
337
- }
338
- ChangeAnnotationIdentifier.is = is;
339
- })(ChangeAnnotationIdentifier || (ChangeAnnotationIdentifier = {}));
340
- var AnnotatedTextEdit;
341
- (function (AnnotatedTextEdit) {
342
- function replace(range, newText, annotation) {
343
- return {
344
- range: range,
345
- newText: newText,
346
- annotationId: annotation
347
- };
348
- }
349
- AnnotatedTextEdit.replace = replace;
350
- function insert(position, newText, annotation) {
351
- return {
352
- range: {
353
- start: position,
354
- end: position
355
- },
356
- newText: newText,
357
- annotationId: annotation
358
- };
359
- }
360
- AnnotatedTextEdit.insert = insert;
361
- function del(range, annotation) {
362
- return {
363
- range: range,
364
- newText: '',
365
- annotationId: annotation
366
- };
367
- }
368
- AnnotatedTextEdit.del = del;
369
- function is(value) {
370
- var candidate = value;
371
- return TextEdit.is(candidate) && (ChangeAnnotation.is(candidate.annotationId) || ChangeAnnotationIdentifier.is(candidate.annotationId));
372
- }
373
- AnnotatedTextEdit.is = is;
374
- })(AnnotatedTextEdit || (AnnotatedTextEdit = {}));
375
- var TextDocumentEdit;
376
- (function (TextDocumentEdit) {
377
- function create(textDocument, edits) {
378
- return {
379
- textDocument: textDocument,
380
- edits: edits
381
- };
382
- }
383
- TextDocumentEdit.create = create;
384
- function is(value) {
385
- var candidate = value;
386
- return Is.defined(candidate) && OptionalVersionedTextDocumentIdentifier.is(candidate.textDocument) && Array.isArray(candidate.edits);
387
- }
388
- TextDocumentEdit.is = is;
389
- })(TextDocumentEdit || (TextDocumentEdit = {}));
390
- var CreateFile;
391
- (function (CreateFile) {
392
- function create(uri, options, annotation) {
393
- var result = {
394
- kind: 'create',
395
- uri: uri
396
- };
397
- if (options !== undefined && (options.overwrite !== undefined || options.ignoreIfExists !== undefined)) {
398
- result.options = options;
399
- }
400
- if (annotation !== undefined) {
401
- result.annotationId = annotation;
402
- }
403
- return result;
404
- }
405
- CreateFile.create = create;
406
- function is(value) {
407
- var candidate = value;
408
- return candidate && candidate.kind === 'create' && Is.string(candidate.uri) && (candidate.options === undefined || (candidate.options.overwrite === undefined || Is.boolean(candidate.options.overwrite)) && (candidate.options.ignoreIfExists === undefined || Is.boolean(candidate.options.ignoreIfExists))) && (candidate.annotationId === undefined || ChangeAnnotationIdentifier.is(candidate.annotationId));
409
- }
410
- CreateFile.is = is;
411
- })(CreateFile || (CreateFile = {}));
412
- var RenameFile;
413
- (function (RenameFile) {
414
- function create(oldUri, newUri, options, annotation) {
415
- var result = {
416
- kind: 'rename',
417
- oldUri: oldUri,
418
- newUri: newUri
419
- };
420
- if (options !== undefined && (options.overwrite !== undefined || options.ignoreIfExists !== undefined)) {
421
- result.options = options;
422
- }
423
- if (annotation !== undefined) {
424
- result.annotationId = annotation;
425
- }
426
- return result;
427
- }
428
- RenameFile.create = create;
429
- function is(value) {
430
- var candidate = value;
431
- return candidate && candidate.kind === 'rename' && Is.string(candidate.oldUri) && Is.string(candidate.newUri) && (candidate.options === undefined || (candidate.options.overwrite === undefined || Is.boolean(candidate.options.overwrite)) && (candidate.options.ignoreIfExists === undefined || Is.boolean(candidate.options.ignoreIfExists))) && (candidate.annotationId === undefined || ChangeAnnotationIdentifier.is(candidate.annotationId));
432
- }
433
- RenameFile.is = is;
434
- })(RenameFile || (RenameFile = {}));
435
- var DeleteFile;
436
- (function (DeleteFile) {
437
- function create(uri, options, annotation) {
438
- var result = {
439
- kind: 'delete',
440
- uri: uri
441
- };
442
- if (options !== undefined && (options.recursive !== undefined || options.ignoreIfNotExists !== undefined)) {
443
- result.options = options;
444
- }
445
- if (annotation !== undefined) {
446
- result.annotationId = annotation;
447
- }
448
- return result;
449
- }
450
- DeleteFile.create = create;
451
- function is(value) {
452
- var candidate = value;
453
- return candidate && candidate.kind === 'delete' && Is.string(candidate.uri) && (candidate.options === undefined || (candidate.options.recursive === undefined || Is.boolean(candidate.options.recursive)) && (candidate.options.ignoreIfNotExists === undefined || Is.boolean(candidate.options.ignoreIfNotExists))) && (candidate.annotationId === undefined || ChangeAnnotationIdentifier.is(candidate.annotationId));
454
- }
455
- DeleteFile.is = is;
456
- })(DeleteFile || (DeleteFile = {}));
457
- var WorkspaceEdit;
458
- (function (WorkspaceEdit) {
459
- function is(value) {
460
- var candidate = value;
461
- return candidate && (candidate.changes !== undefined || candidate.documentChanges !== undefined) && (candidate.documentChanges === undefined || candidate.documentChanges.every(function (change) {
462
- if (Is.string(change.kind)) {
463
- return CreateFile.is(change) || RenameFile.is(change) || DeleteFile.is(change);
464
- } else {
465
- return TextDocumentEdit.is(change);
466
- }
467
- }));
468
- }
469
- WorkspaceEdit.is = is;
470
- })(WorkspaceEdit || (WorkspaceEdit = {}));
471
- var TextEditChangeImpl = function () {
472
- function TextEditChangeImpl(edits, changeAnnotations) {
473
- this.edits = edits;
474
- this.changeAnnotations = changeAnnotations;
475
- }
476
- TextEditChangeImpl.prototype.insert = function (position, newText, annotation) {
477
- var edit;
478
- var id;
479
- if (annotation === undefined) {
480
- edit = TextEdit.insert(position, newText);
481
- } else if (ChangeAnnotationIdentifier.is(annotation)) {
482
- id = annotation;
483
- edit = AnnotatedTextEdit.insert(position, newText, annotation);
484
- } else {
485
- this.assertChangeAnnotations(this.changeAnnotations);
486
- id = this.changeAnnotations.manage(annotation);
487
- edit = AnnotatedTextEdit.insert(position, newText, id);
488
- }
489
- this.edits.push(edit);
490
- if (id !== undefined) {
491
- return id;
492
- }
493
- };
494
- TextEditChangeImpl.prototype.replace = function (range, newText, annotation) {
495
- var edit;
496
- var id;
497
- if (annotation === undefined) {
498
- edit = TextEdit.replace(range, newText);
499
- } else if (ChangeAnnotationIdentifier.is(annotation)) {
500
- id = annotation;
501
- edit = AnnotatedTextEdit.replace(range, newText, annotation);
502
- } else {
503
- this.assertChangeAnnotations(this.changeAnnotations);
504
- id = this.changeAnnotations.manage(annotation);
505
- edit = AnnotatedTextEdit.replace(range, newText, id);
506
- }
507
- this.edits.push(edit);
508
- if (id !== undefined) {
509
- return id;
510
- }
511
- };
512
- TextEditChangeImpl.prototype.delete = function (range, annotation) {
513
- var edit;
514
- var id;
515
- if (annotation === undefined) {
516
- edit = TextEdit.del(range);
517
- } else if (ChangeAnnotationIdentifier.is(annotation)) {
518
- id = annotation;
519
- edit = AnnotatedTextEdit.del(range, annotation);
520
- } else {
521
- this.assertChangeAnnotations(this.changeAnnotations);
522
- id = this.changeAnnotations.manage(annotation);
523
- edit = AnnotatedTextEdit.del(range, id);
524
- }
525
- this.edits.push(edit);
526
- if (id !== undefined) {
527
- return id;
528
- }
529
- };
530
- TextEditChangeImpl.prototype.add = function (edit) {
531
- this.edits.push(edit);
532
- };
533
- TextEditChangeImpl.prototype.all = function () {
534
- return this.edits;
535
- };
536
- TextEditChangeImpl.prototype.clear = function () {
537
- this.edits.splice(0, this.edits.length);
538
- };
539
- TextEditChangeImpl.prototype.assertChangeAnnotations = function (value) {
540
- if (value === undefined) {
541
- throw new Error("Text edit change is not configured to manage change annotations.");
542
- }
543
- };
544
- return TextEditChangeImpl;
545
- }();
546
- var ChangeAnnotations = function () {
547
- function ChangeAnnotations(annotations) {
548
- this._annotations = annotations === undefined ? Object.create(null) : annotations;
549
- this._counter = 0;
550
- this._size = 0;
551
- }
552
- ChangeAnnotations.prototype.all = function () {
553
- return this._annotations;
554
- };
555
- Object.defineProperty(ChangeAnnotations.prototype, "size", {
556
- get: function () {
557
- return this._size;
558
- },
559
- enumerable: false,
560
- configurable: true
561
- });
562
- ChangeAnnotations.prototype.manage = function (idOrAnnotation, annotation) {
563
- var id;
564
- if (ChangeAnnotationIdentifier.is(idOrAnnotation)) {
565
- id = idOrAnnotation;
566
- } else {
567
- id = this.nextId();
568
- annotation = idOrAnnotation;
569
- }
570
- if (this._annotations[id] !== undefined) {
571
- throw new Error("Id ".concat(id, " is already in use."));
572
- }
573
- if (annotation === undefined) {
574
- throw new Error("No annotation provided for id ".concat(id));
575
- }
576
- this._annotations[id] = annotation;
577
- this._size++;
578
- return id;
579
- };
580
- ChangeAnnotations.prototype.nextId = function () {
581
- this._counter++;
582
- return this._counter.toString();
583
- };
584
- return ChangeAnnotations;
585
- }();
586
- var WorkspaceChange = function () {
587
- function WorkspaceChange(workspaceEdit) {
588
- var _this = this;
589
- this._textEditChanges = Object.create(null);
590
- if (workspaceEdit !== undefined) {
591
- this._workspaceEdit = workspaceEdit;
592
- if (workspaceEdit.documentChanges) {
593
- this._changeAnnotations = new ChangeAnnotations(workspaceEdit.changeAnnotations);
594
- workspaceEdit.changeAnnotations = this._changeAnnotations.all();
595
- workspaceEdit.documentChanges.forEach(function (change) {
596
- if (TextDocumentEdit.is(change)) {
597
- var textEditChange = new TextEditChangeImpl(change.edits, _this._changeAnnotations);
598
- _this._textEditChanges[change.textDocument.uri] = textEditChange;
599
- }
600
- });
601
- } else if (workspaceEdit.changes) {
602
- Object.keys(workspaceEdit.changes).forEach(function (key) {
603
- var textEditChange = new TextEditChangeImpl(workspaceEdit.changes[key]);
604
- _this._textEditChanges[key] = textEditChange;
605
- });
606
- }
607
- } else {
608
- this._workspaceEdit = {};
609
- }
610
- }
611
- Object.defineProperty(WorkspaceChange.prototype, "edit", {
612
- get: function () {
613
- this.initDocumentChanges();
614
- if (this._changeAnnotations !== undefined) {
615
- if (this._changeAnnotations.size === 0) {
616
- this._workspaceEdit.changeAnnotations = undefined;
617
- } else {
618
- this._workspaceEdit.changeAnnotations = this._changeAnnotations.all();
619
- }
620
- }
621
- return this._workspaceEdit;
622
- },
623
- enumerable: false,
624
- configurable: true
625
- });
626
- WorkspaceChange.prototype.getTextEditChange = function (key) {
627
- if (OptionalVersionedTextDocumentIdentifier.is(key)) {
628
- this.initDocumentChanges();
629
- if (this._workspaceEdit.documentChanges === undefined) {
630
- throw new Error('Workspace edit is not configured for document changes.');
631
- }
632
- var textDocument = {
633
- uri: key.uri,
634
- version: key.version
635
- };
636
- var result = this._textEditChanges[textDocument.uri];
637
- if (!result) {
638
- var edits = [];
639
- var textDocumentEdit = {
640
- textDocument: textDocument,
641
- edits: edits
642
- };
643
- this._workspaceEdit.documentChanges.push(textDocumentEdit);
644
- result = new TextEditChangeImpl(edits, this._changeAnnotations);
645
- this._textEditChanges[textDocument.uri] = result;
646
- }
647
- return result;
648
- } else {
649
- this.initChanges();
650
- if (this._workspaceEdit.changes === undefined) {
651
- throw new Error('Workspace edit is not configured for normal text edit changes.');
652
- }
653
- var result = this._textEditChanges[key];
654
- if (!result) {
655
- var edits = [];
656
- this._workspaceEdit.changes[key] = edits;
657
- result = new TextEditChangeImpl(edits);
658
- this._textEditChanges[key] = result;
659
- }
660
- return result;
661
- }
662
- };
663
- WorkspaceChange.prototype.initDocumentChanges = function () {
664
- if (this._workspaceEdit.documentChanges === undefined && this._workspaceEdit.changes === undefined) {
665
- this._changeAnnotations = new ChangeAnnotations();
666
- this._workspaceEdit.documentChanges = [];
667
- this._workspaceEdit.changeAnnotations = this._changeAnnotations.all();
668
- }
669
- };
670
- WorkspaceChange.prototype.initChanges = function () {
671
- if (this._workspaceEdit.documentChanges === undefined && this._workspaceEdit.changes === undefined) {
672
- this._workspaceEdit.changes = Object.create(null);
673
- }
674
- };
675
- WorkspaceChange.prototype.createFile = function (uri, optionsOrAnnotation, options) {
676
- this.initDocumentChanges();
677
- if (this._workspaceEdit.documentChanges === undefined) {
678
- throw new Error('Workspace edit is not configured for document changes.');
679
- }
680
- var annotation;
681
- if (ChangeAnnotation.is(optionsOrAnnotation) || ChangeAnnotationIdentifier.is(optionsOrAnnotation)) {
682
- annotation = optionsOrAnnotation;
683
- } else {
684
- options = optionsOrAnnotation;
685
- }
686
- var operation;
687
- var id;
688
- if (annotation === undefined) {
689
- operation = CreateFile.create(uri, options);
690
- } else {
691
- id = ChangeAnnotationIdentifier.is(annotation) ? annotation : this._changeAnnotations.manage(annotation);
692
- operation = CreateFile.create(uri, options, id);
693
- }
694
- this._workspaceEdit.documentChanges.push(operation);
695
- if (id !== undefined) {
696
- return id;
697
- }
698
- };
699
- WorkspaceChange.prototype.renameFile = function (oldUri, newUri, optionsOrAnnotation, options) {
700
- this.initDocumentChanges();
701
- if (this._workspaceEdit.documentChanges === undefined) {
702
- throw new Error('Workspace edit is not configured for document changes.');
703
- }
704
- var annotation;
705
- if (ChangeAnnotation.is(optionsOrAnnotation) || ChangeAnnotationIdentifier.is(optionsOrAnnotation)) {
706
- annotation = optionsOrAnnotation;
707
- } else {
708
- options = optionsOrAnnotation;
709
- }
710
- var operation;
711
- var id;
712
- if (annotation === undefined) {
713
- operation = RenameFile.create(oldUri, newUri, options);
714
- } else {
715
- id = ChangeAnnotationIdentifier.is(annotation) ? annotation : this._changeAnnotations.manage(annotation);
716
- operation = RenameFile.create(oldUri, newUri, options, id);
717
- }
718
- this._workspaceEdit.documentChanges.push(operation);
719
- if (id !== undefined) {
720
- return id;
721
- }
722
- };
723
- WorkspaceChange.prototype.deleteFile = function (uri, optionsOrAnnotation, options) {
724
- this.initDocumentChanges();
725
- if (this._workspaceEdit.documentChanges === undefined) {
726
- throw new Error('Workspace edit is not configured for document changes.');
727
- }
728
- var annotation;
729
- if (ChangeAnnotation.is(optionsOrAnnotation) || ChangeAnnotationIdentifier.is(optionsOrAnnotation)) {
730
- annotation = optionsOrAnnotation;
731
- } else {
732
- options = optionsOrAnnotation;
733
- }
734
- var operation;
735
- var id;
736
- if (annotation === undefined) {
737
- operation = DeleteFile.create(uri, options);
738
- } else {
739
- id = ChangeAnnotationIdentifier.is(annotation) ? annotation : this._changeAnnotations.manage(annotation);
740
- operation = DeleteFile.create(uri, options, id);
741
- }
742
- this._workspaceEdit.documentChanges.push(operation);
743
- if (id !== undefined) {
744
- return id;
745
- }
746
- };
747
- return WorkspaceChange;
748
- }();
749
- var TextDocumentIdentifier;
750
- (function (TextDocumentIdentifier) {
751
- function create(uri) {
752
- return {
753
- uri: uri
754
- };
755
- }
756
- TextDocumentIdentifier.create = create;
757
- function is(value) {
758
- var candidate = value;
759
- return Is.defined(candidate) && Is.string(candidate.uri);
760
- }
761
- TextDocumentIdentifier.is = is;
762
- })(TextDocumentIdentifier || (TextDocumentIdentifier = {}));
763
- var VersionedTextDocumentIdentifier;
764
- (function (VersionedTextDocumentIdentifier) {
765
- function create(uri, version) {
766
- return {
767
- uri: uri,
768
- version: version
769
- };
770
- }
771
- VersionedTextDocumentIdentifier.create = create;
772
- function is(value) {
773
- var candidate = value;
774
- return Is.defined(candidate) && Is.string(candidate.uri) && Is.integer(candidate.version);
775
- }
776
- VersionedTextDocumentIdentifier.is = is;
777
- })(VersionedTextDocumentIdentifier || (VersionedTextDocumentIdentifier = {}));
778
- var OptionalVersionedTextDocumentIdentifier;
779
- (function (OptionalVersionedTextDocumentIdentifier) {
780
- function create(uri, version) {
781
- return {
782
- uri: uri,
783
- version: version
784
- };
785
- }
786
- OptionalVersionedTextDocumentIdentifier.create = create;
787
- function is(value) {
788
- var candidate = value;
789
- return Is.defined(candidate) && Is.string(candidate.uri) && (candidate.version === null || Is.integer(candidate.version));
790
- }
791
- OptionalVersionedTextDocumentIdentifier.is = is;
792
- })(OptionalVersionedTextDocumentIdentifier || (OptionalVersionedTextDocumentIdentifier = {}));
793
- var TextDocumentItem;
794
- (function (TextDocumentItem) {
795
- function create(uri, languageId, version, text) {
796
- return {
797
- uri: uri,
798
- languageId: languageId,
799
- version: version,
800
- text: text
801
- };
802
- }
803
- TextDocumentItem.create = create;
804
- function is(value) {
805
- var candidate = value;
806
- return Is.defined(candidate) && Is.string(candidate.uri) && Is.string(candidate.languageId) && Is.integer(candidate.version) && Is.string(candidate.text);
807
- }
808
- TextDocumentItem.is = is;
809
- })(TextDocumentItem || (TextDocumentItem = {}));
810
- var MarkupKind;
811
- (function (MarkupKind) {
812
- MarkupKind.PlainText = 'plaintext';
813
- MarkupKind.Markdown = 'markdown';
814
- function is(value) {
815
- var candidate = value;
816
- return candidate === MarkupKind.PlainText || candidate === MarkupKind.Markdown;
817
- }
818
- MarkupKind.is = is;
819
- })(MarkupKind || (MarkupKind = {}));
820
- var MarkupContent;
821
- (function (MarkupContent) {
822
- function is(value) {
823
- var candidate = value;
824
- return Is.objectLiteral(value) && MarkupKind.is(candidate.kind) && Is.string(candidate.value);
825
- }
826
- MarkupContent.is = is;
827
- })(MarkupContent || (MarkupContent = {}));
828
- var CompletionItemKind;
829
- (function (CompletionItemKind) {
830
- CompletionItemKind.Text = 1;
831
- CompletionItemKind.Method = 2;
832
- CompletionItemKind.Function = 3;
833
- CompletionItemKind.Constructor = 4;
834
- CompletionItemKind.Field = 5;
835
- CompletionItemKind.Variable = 6;
836
- CompletionItemKind.Class = 7;
837
- CompletionItemKind.Interface = 8;
838
- CompletionItemKind.Module = 9;
839
- CompletionItemKind.Property = 10;
840
- CompletionItemKind.Unit = 11;
841
- CompletionItemKind.Value = 12;
842
- CompletionItemKind.Enum = 13;
843
- CompletionItemKind.Keyword = 14;
844
- CompletionItemKind.Snippet = 15;
845
- CompletionItemKind.Color = 16;
846
- CompletionItemKind.File = 17;
847
- CompletionItemKind.Reference = 18;
848
- CompletionItemKind.Folder = 19;
849
- CompletionItemKind.EnumMember = 20;
850
- CompletionItemKind.Constant = 21;
851
- CompletionItemKind.Struct = 22;
852
- CompletionItemKind.Event = 23;
853
- CompletionItemKind.Operator = 24;
854
- CompletionItemKind.TypeParameter = 25;
855
- })(CompletionItemKind || (CompletionItemKind = {}));
856
- var InsertTextFormat;
857
- (function (InsertTextFormat) {
858
- InsertTextFormat.PlainText = 1;
859
- InsertTextFormat.Snippet = 2;
860
- })(InsertTextFormat || (InsertTextFormat = {}));
861
- var CompletionItemTag;
862
- (function (CompletionItemTag) {
863
- CompletionItemTag.Deprecated = 1;
864
- })(CompletionItemTag || (CompletionItemTag = {}));
865
- var InsertReplaceEdit;
866
- (function (InsertReplaceEdit) {
867
- function create(newText, insert, replace) {
868
- return {
869
- newText: newText,
870
- insert: insert,
871
- replace: replace
872
- };
873
- }
874
- InsertReplaceEdit.create = create;
875
- function is(value) {
876
- var candidate = value;
877
- return candidate && Is.string(candidate.newText) && Range.is(candidate.insert) && Range.is(candidate.replace);
878
- }
879
- InsertReplaceEdit.is = is;
880
- })(InsertReplaceEdit || (InsertReplaceEdit = {}));
881
- var InsertTextMode;
882
- (function (InsertTextMode) {
883
- InsertTextMode.asIs = 1;
884
- InsertTextMode.adjustIndentation = 2;
885
- })(InsertTextMode || (InsertTextMode = {}));
886
- var CompletionItemLabelDetails;
887
- (function (CompletionItemLabelDetails) {
888
- function is(value) {
889
- var candidate = value;
890
- return candidate && (Is.string(candidate.detail) || candidate.detail === undefined) && (Is.string(candidate.description) || candidate.description === undefined);
891
- }
892
- CompletionItemLabelDetails.is = is;
893
- })(CompletionItemLabelDetails || (CompletionItemLabelDetails = {}));
894
- var CompletionItem;
895
- (function (CompletionItem) {
896
- function create(label) {
897
- return {
898
- label: label
899
- };
900
- }
901
- CompletionItem.create = create;
902
- })(CompletionItem || (CompletionItem = {}));
903
- var CompletionList;
904
- (function (CompletionList) {
905
- function create(items, isIncomplete) {
906
- return {
907
- items: items ? items : [],
908
- isIncomplete: !!isIncomplete
909
- };
910
- }
911
- CompletionList.create = create;
912
- })(CompletionList || (CompletionList = {}));
913
- var MarkedString;
914
- (function (MarkedString) {
915
- function fromPlainText(plainText) {
916
- return plainText.replace(/[\\`*_{}[\]()#+\-.!]/g, '\\$&');
917
- }
918
- MarkedString.fromPlainText = fromPlainText;
919
- function is(value) {
920
- var candidate = value;
921
- return Is.string(candidate) || Is.objectLiteral(candidate) && Is.string(candidate.language) && Is.string(candidate.value);
922
- }
923
- MarkedString.is = is;
924
- })(MarkedString || (MarkedString = {}));
925
- var Hover;
926
- (function (Hover) {
927
- function is(value) {
928
- var candidate = value;
929
- return !!candidate && Is.objectLiteral(candidate) && (MarkupContent.is(candidate.contents) || MarkedString.is(candidate.contents) || Is.typedArray(candidate.contents, MarkedString.is)) && (value.range === undefined || Range.is(value.range));
930
- }
931
- Hover.is = is;
932
- })(Hover || (Hover = {}));
933
- var ParameterInformation;
934
- (function (ParameterInformation) {
935
- function create(label, documentation) {
936
- return documentation ? {
937
- label: label,
938
- documentation: documentation
939
- } : {
940
- label: label
941
- };
942
- }
943
- ParameterInformation.create = create;
944
- })(ParameterInformation || (ParameterInformation = {}));
945
- var SignatureInformation;
946
- (function (SignatureInformation) {
947
- function create(label, documentation) {
948
- var parameters = [];
949
- for (var _i = 2; _i < arguments.length; _i++) {
950
- parameters[_i - 2] = arguments[_i];
951
- }
952
- var result = {
953
- label: label
954
- };
955
- if (Is.defined(documentation)) {
956
- result.documentation = documentation;
957
- }
958
- if (Is.defined(parameters)) {
959
- result.parameters = parameters;
960
- } else {
961
- result.parameters = [];
962
- }
963
- return result;
964
- }
965
- SignatureInformation.create = create;
966
- })(SignatureInformation || (SignatureInformation = {}));
967
- var DocumentHighlightKind;
968
- (function (DocumentHighlightKind) {
969
- DocumentHighlightKind.Text = 1;
970
- DocumentHighlightKind.Read = 2;
971
- DocumentHighlightKind.Write = 3;
972
- })(DocumentHighlightKind || (DocumentHighlightKind = {}));
973
- var DocumentHighlight;
974
- (function (DocumentHighlight) {
975
- function create(range, kind) {
976
- var result = {
977
- range: range
978
- };
979
- if (Is.number(kind)) {
980
- result.kind = kind;
981
- }
982
- return result;
983
- }
984
- DocumentHighlight.create = create;
985
- })(DocumentHighlight || (DocumentHighlight = {}));
986
- var SymbolKind;
987
- (function (SymbolKind) {
988
- SymbolKind.File = 1;
989
- SymbolKind.Module = 2;
990
- SymbolKind.Namespace = 3;
991
- SymbolKind.Package = 4;
992
- SymbolKind.Class = 5;
993
- SymbolKind.Method = 6;
994
- SymbolKind.Property = 7;
995
- SymbolKind.Field = 8;
996
- SymbolKind.Constructor = 9;
997
- SymbolKind.Enum = 10;
998
- SymbolKind.Interface = 11;
999
- SymbolKind.Function = 12;
1000
- SymbolKind.Variable = 13;
1001
- SymbolKind.Constant = 14;
1002
- SymbolKind.String = 15;
1003
- SymbolKind.Number = 16;
1004
- SymbolKind.Boolean = 17;
1005
- SymbolKind.Array = 18;
1006
- SymbolKind.Object = 19;
1007
- SymbolKind.Key = 20;
1008
- SymbolKind.Null = 21;
1009
- SymbolKind.EnumMember = 22;
1010
- SymbolKind.Struct = 23;
1011
- SymbolKind.Event = 24;
1012
- SymbolKind.Operator = 25;
1013
- SymbolKind.TypeParameter = 26;
1014
- })(SymbolKind || (SymbolKind = {}));
1015
- var SymbolTag;
1016
- (function (SymbolTag) {
1017
- SymbolTag.Deprecated = 1;
1018
- })(SymbolTag || (SymbolTag = {}));
1019
- var SymbolInformation;
1020
- (function (SymbolInformation) {
1021
- function create(name, kind, range, uri, containerName) {
1022
- var result = {
1023
- name: name,
1024
- kind: kind,
1025
- location: {
1026
- uri: uri,
1027
- range: range
1028
- }
1029
- };
1030
- if (containerName) {
1031
- result.containerName = containerName;
1032
- }
1033
- return result;
1034
- }
1035
- SymbolInformation.create = create;
1036
- })(SymbolInformation || (SymbolInformation = {}));
1037
- var WorkspaceSymbol;
1038
- (function (WorkspaceSymbol) {
1039
- function create(name, kind, uri, range) {
1040
- return range !== undefined ? {
1041
- name: name,
1042
- kind: kind,
1043
- location: {
1044
- uri: uri,
1045
- range: range
1046
- }
1047
- } : {
1048
- name: name,
1049
- kind: kind,
1050
- location: {
1051
- uri: uri
1052
- }
1053
- };
1054
- }
1055
- WorkspaceSymbol.create = create;
1056
- })(WorkspaceSymbol || (WorkspaceSymbol = {}));
1057
- var DocumentSymbol;
1058
- (function (DocumentSymbol) {
1059
- function create(name, detail, kind, range, selectionRange, children) {
1060
- var result = {
1061
- name: name,
1062
- detail: detail,
1063
- kind: kind,
1064
- range: range,
1065
- selectionRange: selectionRange
1066
- };
1067
- if (children !== undefined) {
1068
- result.children = children;
1069
- }
1070
- return result;
1071
- }
1072
- DocumentSymbol.create = create;
1073
- function is(value) {
1074
- var candidate = value;
1075
- return candidate && Is.string(candidate.name) && Is.number(candidate.kind) && Range.is(candidate.range) && Range.is(candidate.selectionRange) && (candidate.detail === undefined || Is.string(candidate.detail)) && (candidate.deprecated === undefined || Is.boolean(candidate.deprecated)) && (candidate.children === undefined || Array.isArray(candidate.children)) && (candidate.tags === undefined || Array.isArray(candidate.tags));
1076
- }
1077
- DocumentSymbol.is = is;
1078
- })(DocumentSymbol || (DocumentSymbol = {}));
1079
- var CodeActionKind;
1080
- (function (CodeActionKind) {
1081
- CodeActionKind.Empty = '';
1082
- CodeActionKind.QuickFix = 'quickfix';
1083
- CodeActionKind.Refactor = 'refactor';
1084
- CodeActionKind.RefactorExtract = 'refactor.extract';
1085
- CodeActionKind.RefactorInline = 'refactor.inline';
1086
- CodeActionKind.RefactorRewrite = 'refactor.rewrite';
1087
- CodeActionKind.Source = 'source';
1088
- CodeActionKind.SourceOrganizeImports = 'source.organizeImports';
1089
- CodeActionKind.SourceFixAll = 'source.fixAll';
1090
- })(CodeActionKind || (CodeActionKind = {}));
1091
- var CodeActionTriggerKind;
1092
- (function (CodeActionTriggerKind) {
1093
- CodeActionTriggerKind.Invoked = 1;
1094
- CodeActionTriggerKind.Automatic = 2;
1095
- })(CodeActionTriggerKind || (CodeActionTriggerKind = {}));
1096
- var CodeActionContext;
1097
- (function (CodeActionContext) {
1098
- function create(diagnostics, only, triggerKind) {
1099
- var result = {
1100
- diagnostics: diagnostics
1101
- };
1102
- if (only !== undefined && only !== null) {
1103
- result.only = only;
1104
- }
1105
- if (triggerKind !== undefined && triggerKind !== null) {
1106
- result.triggerKind = triggerKind;
1107
- }
1108
- return result;
1109
- }
1110
- CodeActionContext.create = create;
1111
- function is(value) {
1112
- var candidate = value;
1113
- return Is.defined(candidate) && Is.typedArray(candidate.diagnostics, Diagnostic.is) && (candidate.only === undefined || Is.typedArray(candidate.only, Is.string)) && (candidate.triggerKind === undefined || candidate.triggerKind === CodeActionTriggerKind.Invoked || candidate.triggerKind === CodeActionTriggerKind.Automatic);
1114
- }
1115
- CodeActionContext.is = is;
1116
- })(CodeActionContext || (CodeActionContext = {}));
1117
- var CodeAction;
1118
- (function (CodeAction) {
1119
- function create(title, kindOrCommandOrEdit, kind) {
1120
- var result = {
1121
- title: title
1122
- };
1123
- var checkKind = true;
1124
- if (typeof kindOrCommandOrEdit === 'string') {
1125
- checkKind = false;
1126
- result.kind = kindOrCommandOrEdit;
1127
- } else if (Command.is(kindOrCommandOrEdit)) {
1128
- result.command = kindOrCommandOrEdit;
1129
- } else {
1130
- result.edit = kindOrCommandOrEdit;
1131
- }
1132
- if (checkKind && kind !== undefined) {
1133
- result.kind = kind;
1134
- }
1135
- return result;
1136
- }
1137
- CodeAction.create = create;
1138
- function is(value) {
1139
- var candidate = value;
1140
- return candidate && Is.string(candidate.title) && (candidate.diagnostics === undefined || Is.typedArray(candidate.diagnostics, Diagnostic.is)) && (candidate.kind === undefined || Is.string(candidate.kind)) && (candidate.edit !== undefined || candidate.command !== undefined) && (candidate.command === undefined || Command.is(candidate.command)) && (candidate.isPreferred === undefined || Is.boolean(candidate.isPreferred)) && (candidate.edit === undefined || WorkspaceEdit.is(candidate.edit));
1141
- }
1142
- CodeAction.is = is;
1143
- })(CodeAction || (CodeAction = {}));
1144
- var CodeLens;
1145
- (function (CodeLens) {
1146
- function create(range, data) {
1147
- var result = {
1148
- range: range
1149
- };
1150
- if (Is.defined(data)) {
1151
- result.data = data;
1152
- }
1153
- return result;
1154
- }
1155
- CodeLens.create = create;
1156
- function is(value) {
1157
- var candidate = value;
1158
- return Is.defined(candidate) && Range.is(candidate.range) && (Is.undefined(candidate.command) || Command.is(candidate.command));
1159
- }
1160
- CodeLens.is = is;
1161
- })(CodeLens || (CodeLens = {}));
1162
- var FormattingOptions;
1163
- (function (FormattingOptions) {
1164
- function create(tabSize, insertSpaces) {
1165
- return {
1166
- tabSize: tabSize,
1167
- insertSpaces: insertSpaces
1168
- };
1169
- }
1170
- FormattingOptions.create = create;
1171
- function is(value) {
1172
- var candidate = value;
1173
- return Is.defined(candidate) && Is.uinteger(candidate.tabSize) && Is.boolean(candidate.insertSpaces);
1174
- }
1175
- FormattingOptions.is = is;
1176
- })(FormattingOptions || (FormattingOptions = {}));
1177
- var DocumentLink;
1178
- (function (DocumentLink) {
1179
- function create(range, target, data) {
1180
- return {
1181
- range: range,
1182
- target: target,
1183
- data: data
1184
- };
1185
- }
1186
- DocumentLink.create = create;
1187
- function is(value) {
1188
- var candidate = value;
1189
- return Is.defined(candidate) && Range.is(candidate.range) && (Is.undefined(candidate.target) || Is.string(candidate.target));
1190
- }
1191
- DocumentLink.is = is;
1192
- })(DocumentLink || (DocumentLink = {}));
1193
- var SelectionRange;
1194
- (function (SelectionRange) {
1195
- function create(range, parent) {
1196
- return {
1197
- range: range,
1198
- parent: parent
1199
- };
1200
- }
1201
- SelectionRange.create = create;
1202
- function is(value) {
1203
- var candidate = value;
1204
- return Is.objectLiteral(candidate) && Range.is(candidate.range) && (candidate.parent === undefined || SelectionRange.is(candidate.parent));
1205
- }
1206
- SelectionRange.is = is;
1207
- })(SelectionRange || (SelectionRange = {}));
1208
- var SemanticTokenTypes;
1209
- (function (SemanticTokenTypes) {
1210
- SemanticTokenTypes["namespace"] = "namespace";
1211
- SemanticTokenTypes["type"] = "type";
1212
- SemanticTokenTypes["class"] = "class";
1213
- SemanticTokenTypes["enum"] = "enum";
1214
- SemanticTokenTypes["interface"] = "interface";
1215
- SemanticTokenTypes["struct"] = "struct";
1216
- SemanticTokenTypes["typeParameter"] = "typeParameter";
1217
- SemanticTokenTypes["parameter"] = "parameter";
1218
- SemanticTokenTypes["variable"] = "variable";
1219
- SemanticTokenTypes["property"] = "property";
1220
- SemanticTokenTypes["enumMember"] = "enumMember";
1221
- SemanticTokenTypes["event"] = "event";
1222
- SemanticTokenTypes["function"] = "function";
1223
- SemanticTokenTypes["method"] = "method";
1224
- SemanticTokenTypes["macro"] = "macro";
1225
- SemanticTokenTypes["keyword"] = "keyword";
1226
- SemanticTokenTypes["modifier"] = "modifier";
1227
- SemanticTokenTypes["comment"] = "comment";
1228
- SemanticTokenTypes["string"] = "string";
1229
- SemanticTokenTypes["number"] = "number";
1230
- SemanticTokenTypes["regexp"] = "regexp";
1231
- SemanticTokenTypes["operator"] = "operator";
1232
- SemanticTokenTypes["decorator"] = "decorator";
1233
- })(SemanticTokenTypes || (SemanticTokenTypes = {}));
1234
- var SemanticTokenModifiers;
1235
- (function (SemanticTokenModifiers) {
1236
- SemanticTokenModifiers["declaration"] = "declaration";
1237
- SemanticTokenModifiers["definition"] = "definition";
1238
- SemanticTokenModifiers["readonly"] = "readonly";
1239
- SemanticTokenModifiers["static"] = "static";
1240
- SemanticTokenModifiers["deprecated"] = "deprecated";
1241
- SemanticTokenModifiers["abstract"] = "abstract";
1242
- SemanticTokenModifiers["async"] = "async";
1243
- SemanticTokenModifiers["modification"] = "modification";
1244
- SemanticTokenModifiers["documentation"] = "documentation";
1245
- SemanticTokenModifiers["defaultLibrary"] = "defaultLibrary";
1246
- })(SemanticTokenModifiers || (SemanticTokenModifiers = {}));
1247
- var SemanticTokens;
1248
- (function (SemanticTokens) {
1249
- function is(value) {
1250
- var candidate = value;
1251
- return Is.objectLiteral(candidate) && (candidate.resultId === undefined || typeof candidate.resultId === 'string') && Array.isArray(candidate.data) && (candidate.data.length === 0 || typeof candidate.data[0] === 'number');
1252
- }
1253
- SemanticTokens.is = is;
1254
- })(SemanticTokens || (SemanticTokens = {}));
1255
- var InlineValueText;
1256
- (function (InlineValueText) {
1257
- function create(range, text) {
1258
- return {
1259
- range: range,
1260
- text: text
1261
- };
1262
- }
1263
- InlineValueText.create = create;
1264
- function is(value) {
1265
- var candidate = value;
1266
- return candidate !== undefined && candidate !== null && Range.is(candidate.range) && Is.string(candidate.text);
1267
- }
1268
- InlineValueText.is = is;
1269
- })(InlineValueText || (InlineValueText = {}));
1270
- var InlineValueVariableLookup;
1271
- (function (InlineValueVariableLookup) {
1272
- function create(range, variableName, caseSensitiveLookup) {
1273
- return {
1274
- range: range,
1275
- variableName: variableName,
1276
- caseSensitiveLookup: caseSensitiveLookup
1277
- };
1278
- }
1279
- InlineValueVariableLookup.create = create;
1280
- function is(value) {
1281
- var candidate = value;
1282
- return candidate !== undefined && candidate !== null && Range.is(candidate.range) && Is.boolean(candidate.caseSensitiveLookup) && (Is.string(candidate.variableName) || candidate.variableName === undefined);
1283
- }
1284
- InlineValueVariableLookup.is = is;
1285
- })(InlineValueVariableLookup || (InlineValueVariableLookup = {}));
1286
- var InlineValueEvaluatableExpression;
1287
- (function (InlineValueEvaluatableExpression) {
1288
- function create(range, expression) {
1289
- return {
1290
- range: range,
1291
- expression: expression
1292
- };
1293
- }
1294
- InlineValueEvaluatableExpression.create = create;
1295
- function is(value) {
1296
- var candidate = value;
1297
- return candidate !== undefined && candidate !== null && Range.is(candidate.range) && (Is.string(candidate.expression) || candidate.expression === undefined);
1298
- }
1299
- InlineValueEvaluatableExpression.is = is;
1300
- })(InlineValueEvaluatableExpression || (InlineValueEvaluatableExpression = {}));
1301
- var InlineValueContext;
1302
- (function (InlineValueContext) {
1303
- function create(frameId, stoppedLocation) {
1304
- return {
1305
- frameId: frameId,
1306
- stoppedLocation: stoppedLocation
1307
- };
1308
- }
1309
- InlineValueContext.create = create;
1310
- function is(value) {
1311
- var candidate = value;
1312
- return Is.defined(candidate) && Range.is(value.stoppedLocation);
1313
- }
1314
- InlineValueContext.is = is;
1315
- })(InlineValueContext || (InlineValueContext = {}));
1316
- var InlayHintKind;
1317
- (function (InlayHintKind) {
1318
- InlayHintKind.Type = 1;
1319
- InlayHintKind.Parameter = 2;
1320
- function is(value) {
1321
- return value === 1 || value === 2;
1322
- }
1323
- InlayHintKind.is = is;
1324
- })(InlayHintKind || (InlayHintKind = {}));
1325
- var InlayHintLabelPart;
1326
- (function (InlayHintLabelPart) {
1327
- function create(value) {
1328
- return {
1329
- value: value
1330
- };
1331
- }
1332
- InlayHintLabelPart.create = create;
1333
- function is(value) {
1334
- var candidate = value;
1335
- return Is.objectLiteral(candidate) && (candidate.tooltip === undefined || Is.string(candidate.tooltip) || MarkupContent.is(candidate.tooltip)) && (candidate.location === undefined || Location.is(candidate.location)) && (candidate.command === undefined || Command.is(candidate.command));
1336
- }
1337
- InlayHintLabelPart.is = is;
1338
- })(InlayHintLabelPart || (InlayHintLabelPart = {}));
1339
- var InlayHint;
1340
- (function (InlayHint) {
1341
- function create(position, label, kind) {
1342
- var result = {
1343
- position: position,
1344
- label: label
1345
- };
1346
- if (kind !== undefined) {
1347
- result.kind = kind;
1348
- }
1349
- return result;
1350
- }
1351
- InlayHint.create = create;
1352
- function is(value) {
1353
- var candidate = value;
1354
- return Is.objectLiteral(candidate) && Position.is(candidate.position) && (Is.string(candidate.label) || Is.typedArray(candidate.label, InlayHintLabelPart.is)) && (candidate.kind === undefined || InlayHintKind.is(candidate.kind)) && candidate.textEdits === undefined || Is.typedArray(candidate.textEdits, TextEdit.is) && (candidate.tooltip === undefined || Is.string(candidate.tooltip) || MarkupContent.is(candidate.tooltip)) && (candidate.paddingLeft === undefined || Is.boolean(candidate.paddingLeft)) && (candidate.paddingRight === undefined || Is.boolean(candidate.paddingRight));
1355
- }
1356
- InlayHint.is = is;
1357
- })(InlayHint || (InlayHint = {}));
1358
- var WorkspaceFolder;
1359
- (function (WorkspaceFolder) {
1360
- function is(value) {
1361
- var candidate = value;
1362
- return Is.objectLiteral(candidate) && URI.is(candidate.uri) && Is.string(candidate.name);
1363
- }
1364
- WorkspaceFolder.is = is;
1365
- })(WorkspaceFolder || (WorkspaceFolder = {}));
1366
- var EOL = ['\n', '\r\n', '\r'];
1367
- var TextDocument;
1368
- (function (TextDocument) {
1369
- function create(uri, languageId, version, content) {
1370
- return new FullTextDocument(uri, languageId, version, content);
1371
- }
1372
- TextDocument.create = create;
1373
- function is(value) {
1374
- var candidate = value;
1375
- return Is.defined(candidate) && Is.string(candidate.uri) && (Is.undefined(candidate.languageId) || Is.string(candidate.languageId)) && Is.uinteger(candidate.lineCount) && Is.func(candidate.getText) && Is.func(candidate.positionAt) && Is.func(candidate.offsetAt) ? true : false;
1376
- }
1377
- TextDocument.is = is;
1378
- function applyEdits(document, edits) {
1379
- var text = document.getText();
1380
- var sortedEdits = mergeSort(edits, function (a, b) {
1381
- var diff = a.range.start.line - b.range.start.line;
1382
- if (diff === 0) {
1383
- return a.range.start.character - b.range.start.character;
1384
- }
1385
- return diff;
1386
- });
1387
- var lastModifiedOffset = text.length;
1388
- for (var i = sortedEdits.length - 1; i >= 0; i--) {
1389
- var e = sortedEdits[i];
1390
- var startOffset = document.offsetAt(e.range.start);
1391
- var endOffset = document.offsetAt(e.range.end);
1392
- if (endOffset <= lastModifiedOffset) {
1393
- text = text.substring(0, startOffset) + e.newText + text.substring(endOffset, text.length);
1394
- } else {
1395
- throw new Error('Overlapping edit');
1396
- }
1397
- lastModifiedOffset = startOffset;
1398
- }
1399
- return text;
1400
- }
1401
- TextDocument.applyEdits = applyEdits;
1402
- function mergeSort(data, compare) {
1403
- if (data.length <= 1) {
1404
- return data;
1405
- }
1406
- var p = data.length / 2 | 0;
1407
- var left = data.slice(0, p);
1408
- var right = data.slice(p);
1409
- mergeSort(left, compare);
1410
- mergeSort(right, compare);
1411
- var leftIdx = 0;
1412
- var rightIdx = 0;
1413
- var i = 0;
1414
- while (leftIdx < left.length && rightIdx < right.length) {
1415
- var ret = compare(left[leftIdx], right[rightIdx]);
1416
- if (ret <= 0) {
1417
- data[i++] = left[leftIdx++];
1418
- } else {
1419
- data[i++] = right[rightIdx++];
1420
- }
1421
- }
1422
- while (leftIdx < left.length) {
1423
- data[i++] = left[leftIdx++];
1424
- }
1425
- while (rightIdx < right.length) {
1426
- data[i++] = right[rightIdx++];
1427
- }
1428
- return data;
1429
- }
1430
- })(TextDocument || (TextDocument = {}));
1431
- var FullTextDocument = function () {
1432
- function FullTextDocument(uri, languageId, version, content) {
1433
- this._uri = uri;
1434
- this._languageId = languageId;
1435
- this._version = version;
1436
- this._content = content;
1437
- this._lineOffsets = undefined;
1438
- }
1439
- Object.defineProperty(FullTextDocument.prototype, "uri", {
1440
- get: function () {
1441
- return this._uri;
1442
- },
1443
- enumerable: false,
1444
- configurable: true
1445
- });
1446
- Object.defineProperty(FullTextDocument.prototype, "languageId", {
1447
- get: function () {
1448
- return this._languageId;
1449
- },
1450
- enumerable: false,
1451
- configurable: true
1452
- });
1453
- Object.defineProperty(FullTextDocument.prototype, "version", {
1454
- get: function () {
1455
- return this._version;
1456
- },
1457
- enumerable: false,
1458
- configurable: true
1459
- });
1460
- FullTextDocument.prototype.getText = function (range) {
1461
- if (range) {
1462
- var start = this.offsetAt(range.start);
1463
- var end = this.offsetAt(range.end);
1464
- return this._content.substring(start, end);
1465
- }
1466
- return this._content;
1467
- };
1468
- FullTextDocument.prototype.update = function (event, version) {
1469
- this._content = event.text;
1470
- this._version = version;
1471
- this._lineOffsets = undefined;
1472
- };
1473
- FullTextDocument.prototype.getLineOffsets = function () {
1474
- if (this._lineOffsets === undefined) {
1475
- var lineOffsets = [];
1476
- var text = this._content;
1477
- var isLineStart = true;
1478
- for (var i = 0; i < text.length; i++) {
1479
- if (isLineStart) {
1480
- lineOffsets.push(i);
1481
- isLineStart = false;
1482
- }
1483
- var ch = text.charAt(i);
1484
- isLineStart = ch === '\r' || ch === '\n';
1485
- if (ch === '\r' && i + 1 < text.length && text.charAt(i + 1) === '\n') {
1486
- i++;
1487
- }
1488
- }
1489
- if (isLineStart && text.length > 0) {
1490
- lineOffsets.push(text.length);
1491
- }
1492
- this._lineOffsets = lineOffsets;
1493
- }
1494
- return this._lineOffsets;
1495
- };
1496
- FullTextDocument.prototype.positionAt = function (offset) {
1497
- offset = Math.max(Math.min(offset, this._content.length), 0);
1498
- var lineOffsets = this.getLineOffsets();
1499
- var low = 0,
1500
- high = lineOffsets.length;
1501
- if (high === 0) {
1502
- return Position.create(0, offset);
1503
- }
1504
- while (low < high) {
1505
- var mid = Math.floor((low + high) / 2);
1506
- if (lineOffsets[mid] > offset) {
1507
- high = mid;
1508
- } else {
1509
- low = mid + 1;
1510
- }
1511
- }
1512
- var line = low - 1;
1513
- return Position.create(line, offset - lineOffsets[line]);
1514
- };
1515
- FullTextDocument.prototype.offsetAt = function (position) {
1516
- var lineOffsets = this.getLineOffsets();
1517
- if (position.line >= lineOffsets.length) {
1518
- return this._content.length;
1519
- } else if (position.line < 0) {
1520
- return 0;
1521
- }
1522
- var lineOffset = lineOffsets[position.line];
1523
- var nextLineOffset = position.line + 1 < lineOffsets.length ? lineOffsets[position.line + 1] : this._content.length;
1524
- return Math.max(Math.min(lineOffset + position.character, nextLineOffset), lineOffset);
1525
- };
1526
- Object.defineProperty(FullTextDocument.prototype, "lineCount", {
1527
- get: function () {
1528
- return this.getLineOffsets().length;
1529
- },
1530
- enumerable: false,
1531
- configurable: true
1532
- });
1533
- return FullTextDocument;
1534
- }();
1535
- var Is;
1536
- (function (Is) {
1537
- var toString = Object.prototype.toString;
1538
- function defined(value) {
1539
- return typeof value !== 'undefined';
1540
- }
1541
- Is.defined = defined;
1542
- function undefined$1(value) {
1543
- return typeof value === 'undefined';
1544
- }
1545
- Is.undefined = undefined$1;
1546
- function boolean(value) {
1547
- return value === true || value === false;
1548
- }
1549
- Is.boolean = boolean;
1550
- function string(value) {
1551
- return toString.call(value) === '[object String]';
1552
- }
1553
- Is.string = string;
1554
- function number(value) {
1555
- return toString.call(value) === '[object Number]';
1556
- }
1557
- Is.number = number;
1558
- function numberRange(value, min, max) {
1559
- return toString.call(value) === '[object Number]' && min <= value && value <= max;
1560
- }
1561
- Is.numberRange = numberRange;
1562
- function integer(value) {
1563
- return toString.call(value) === '[object Number]' && -2147483648 <= value && value <= 2147483647;
1564
- }
1565
- Is.integer = integer;
1566
- function uinteger(value) {
1567
- return toString.call(value) === '[object Number]' && 0 <= value && value <= 2147483647;
1568
- }
1569
- Is.uinteger = uinteger;
1570
- function func(value) {
1571
- return toString.call(value) === '[object Function]';
1572
- }
1573
- Is.func = func;
1574
- function objectLiteral(value) {
1575
- return value !== null && typeof value === 'object';
1576
- }
1577
- Is.objectLiteral = objectLiteral;
1578
- function typedArray(value, check) {
1579
- return Array.isArray(value) && value.every(check);
1580
- }
1581
- Is.typedArray = typedArray;
1582
- })(Is || (Is = {}));
1583
- export { AnnotatedTextEdit, ChangeAnnotation, ChangeAnnotationIdentifier, CodeAction, CodeActionContext, CodeActionKind, CodeActionTriggerKind, CodeDescription, CodeLens, Color, ColorInformation, ColorPresentation, Command, CompletionItem, CompletionItemKind, CompletionItemLabelDetails, CompletionItemTag, CompletionList, CreateFile, DeleteFile, Diagnostic, DiagnosticRelatedInformation, DiagnosticSeverity, DiagnosticTag, DocumentHighlight, DocumentHighlightKind, DocumentLink, DocumentSymbol, DocumentUri, EOL, FoldingRange, FoldingRangeKind, FormattingOptions, Hover, InlayHint, InlayHintKind, InlayHintLabelPart, InlineValueContext, InlineValueEvaluatableExpression, InlineValueText, InlineValueVariableLookup, InsertReplaceEdit, InsertTextFormat, InsertTextMode, Location, LocationLink, MarkedString, MarkupContent, MarkupKind, OptionalVersionedTextDocumentIdentifier, ParameterInformation, Position, Range, RenameFile, SelectionRange, SemanticTokenModifiers, SemanticTokenTypes, SemanticTokens, SignatureInformation, SymbolInformation, SymbolKind, SymbolTag, TextDocument, TextDocumentEdit, TextDocumentIdentifier, TextDocumentItem, TextEdit, URI, VersionedTextDocumentIdentifier, WorkspaceChange, WorkspaceEdit, WorkspaceFolder, WorkspaceSymbol, integer, uinteger };