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