@tsrx/language-server 0.6.0 → 0.6.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/README.md +87 -15
- package/dist/language-server.js +1 -1
- package/dist/{server-Dn5OWBDY.js → server-BnzVhVsF.js} +2304 -2243
- package/dist/server-BnzVhVsF.js.map +1 -0
- package/dist/server.js +2 -1
- package/package.json +8 -3
- package/types/server.d.ts +6 -0
- package/dist/server-Dn5OWBDY.js.map +0 -1
|
@@ -296,8 +296,8 @@ var require_source_map = /* @__PURE__ */ __commonJSMin(((exports) => {
|
|
|
296
296
|
if (k2 === void 0) k2 = k;
|
|
297
297
|
o[k2] = m[k];
|
|
298
298
|
}));
|
|
299
|
-
var __exportStar = exports && exports.__exportStar || function(m, exports$
|
|
300
|
-
for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports$
|
|
299
|
+
var __exportStar = exports && exports.__exportStar || function(m, exports$12) {
|
|
300
|
+
for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports$12, p)) __createBinding(exports$12, m, p);
|
|
301
301
|
};
|
|
302
302
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
303
303
|
__exportStar(require_sourceMap(), exports);
|
|
@@ -543,8 +543,8 @@ var require_language_core = /* @__PURE__ */ __commonJSMin(((exports) => {
|
|
|
543
543
|
if (k2 === void 0) k2 = k;
|
|
544
544
|
o[k2] = m[k];
|
|
545
545
|
}));
|
|
546
|
-
var __exportStar = exports && exports.__exportStar || function(m, exports$
|
|
547
|
-
for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports$
|
|
546
|
+
var __exportStar = exports && exports.__exportStar || function(m, exports$11) {
|
|
547
|
+
for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports$11, p)) __createBinding(exports$11, m, p);
|
|
548
548
|
};
|
|
549
549
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
550
550
|
exports.defaultMapperFactory = exports.SourceMap = void 0;
|
|
@@ -6111,7 +6111,7 @@ var require_ril = /* @__PURE__ */ __commonJSMin(((exports) => {
|
|
|
6111
6111
|
|
|
6112
6112
|
//#endregion
|
|
6113
6113
|
//#region ../../node_modules/.pnpm/vscode-jsonrpc@8.2.0/node_modules/vscode-jsonrpc/lib/node/main.js
|
|
6114
|
-
var require_main$
|
|
6114
|
+
var require_main$3 = /* @__PURE__ */ __commonJSMin(((exports) => {
|
|
6115
6115
|
var __createBinding = exports && exports.__createBinding || (Object.create ? (function(o, m, k, k2) {
|
|
6116
6116
|
if (k2 === void 0) k2 = k;
|
|
6117
6117
|
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
@@ -6126,14 +6126,14 @@ var require_main$4 = /* @__PURE__ */ __commonJSMin(((exports) => {
|
|
|
6126
6126
|
if (k2 === void 0) k2 = k;
|
|
6127
6127
|
o[k2] = m[k];
|
|
6128
6128
|
}));
|
|
6129
|
-
var __exportStar = exports && exports.__exportStar || function(m, exports$
|
|
6130
|
-
for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports$
|
|
6129
|
+
var __exportStar = exports && exports.__exportStar || function(m, exports$10) {
|
|
6130
|
+
for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports$10, p)) __createBinding(exports$10, m, p);
|
|
6131
6131
|
};
|
|
6132
6132
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6133
6133
|
exports.createMessageConnection = exports.createServerSocketTransport = exports.createClientSocketTransport = exports.createServerPipeTransport = exports.createClientPipeTransport = exports.generateRandomPipeName = exports.StreamMessageWriter = exports.StreamMessageReader = exports.SocketMessageWriter = exports.SocketMessageReader = exports.PortMessageWriter = exports.PortMessageReader = exports.IPCMessageWriter = exports.IPCMessageReader = void 0;
|
|
6134
6134
|
const ril_1 = require_ril();
|
|
6135
6135
|
ril_1.default.install();
|
|
6136
|
-
const path$
|
|
6136
|
+
const path$8 = require("path");
|
|
6137
6137
|
const os = require("os");
|
|
6138
6138
|
const crypto_1 = require("crypto");
|
|
6139
6139
|
const net_1 = require("net");
|
|
@@ -6257,8 +6257,8 @@ var require_main$4 = /* @__PURE__ */ __commonJSMin(((exports) => {
|
|
|
6257
6257
|
const randomSuffix = (0, crypto_1.randomBytes)(21).toString("hex");
|
|
6258
6258
|
if (process.platform === "win32") return `\\\\.\\pipe\\vscode-jsonrpc-${randomSuffix}-sock`;
|
|
6259
6259
|
let result;
|
|
6260
|
-
if (XDG_RUNTIME_DIR) result = path$
|
|
6261
|
-
else result = path$
|
|
6260
|
+
if (XDG_RUNTIME_DIR) result = path$8.join(XDG_RUNTIME_DIR, `vscode-ipc-${randomSuffix}.sock`);
|
|
6261
|
+
else result = path$8.join(os.tmpdir(), `vscode-${randomSuffix}.sock`);
|
|
6262
6262
|
const limit = safeIpcPathLengths.get(process.platform);
|
|
6263
6263
|
if (limit !== void 0 && result.length > limit) (0, ril_1.default)().console.warn(`WARNING: IPC handle "${result}" is longer than ${limit} characters.`);
|
|
6264
6264
|
return result;
|
|
@@ -6335,2158 +6335,2136 @@ var require_main$4 = /* @__PURE__ */ __commonJSMin(((exports) => {
|
|
|
6335
6335
|
//#endregion
|
|
6336
6336
|
//#region ../../node_modules/.pnpm/vscode-jsonrpc@8.2.0/node_modules/vscode-jsonrpc/node.js
|
|
6337
6337
|
var require_node$4 = /* @__PURE__ */ __commonJSMin(((exports, module) => {
|
|
6338
|
-
module.exports = require_main$
|
|
6338
|
+
module.exports = require_main$3();
|
|
6339
6339
|
}));
|
|
6340
6340
|
|
|
6341
6341
|
//#endregion
|
|
6342
|
-
//#region ../../node_modules/.pnpm/vscode-languageserver-types@3.
|
|
6343
|
-
var
|
|
6344
|
-
(
|
|
6345
|
-
|
|
6346
|
-
|
|
6347
|
-
|
|
6348
|
-
|
|
6349
|
-
|
|
6350
|
-
|
|
6351
|
-
|
|
6352
|
-
|
|
6353
|
-
|
|
6354
|
-
|
|
6355
|
-
|
|
6356
|
-
|
|
6357
|
-
|
|
6358
|
-
|
|
6359
|
-
|
|
6360
|
-
|
|
6361
|
-
|
|
6362
|
-
|
|
6363
|
-
|
|
6364
|
-
|
|
6365
|
-
|
|
6366
|
-
|
|
6367
|
-
|
|
6368
|
-
|
|
6369
|
-
|
|
6370
|
-
|
|
6371
|
-
|
|
6372
|
-
|
|
6373
|
-
|
|
6374
|
-
|
|
6375
|
-
|
|
6376
|
-
|
|
6377
|
-
|
|
6378
|
-
|
|
6379
|
-
|
|
6380
|
-
|
|
6381
|
-
|
|
6382
|
-
|
|
6383
|
-
|
|
6384
|
-
|
|
6342
|
+
//#region ../../node_modules/.pnpm/vscode-languageserver-types@3.18.4/node_modules/vscode-languageserver-types/lib/esm/main.js
|
|
6343
|
+
var main_exports$1 = /* @__PURE__ */ __exportAll({
|
|
6344
|
+
AnnotatedTextEdit: () => AnnotatedTextEdit,
|
|
6345
|
+
ApplyKind: () => ApplyKind,
|
|
6346
|
+
ChangeAnnotation: () => ChangeAnnotation,
|
|
6347
|
+
ChangeAnnotationIdentifier: () => ChangeAnnotationIdentifier,
|
|
6348
|
+
CodeAction: () => CodeAction,
|
|
6349
|
+
CodeActionContext: () => CodeActionContext,
|
|
6350
|
+
CodeActionKind: () => CodeActionKind,
|
|
6351
|
+
CodeActionTag: () => CodeActionTag,
|
|
6352
|
+
CodeActionTriggerKind: () => CodeActionTriggerKind,
|
|
6353
|
+
CodeDescription: () => CodeDescription,
|
|
6354
|
+
CodeLens: () => CodeLens,
|
|
6355
|
+
Color: () => Color,
|
|
6356
|
+
ColorInformation: () => ColorInformation,
|
|
6357
|
+
ColorPresentation: () => ColorPresentation,
|
|
6358
|
+
Command: () => Command,
|
|
6359
|
+
CompletionItem: () => CompletionItem,
|
|
6360
|
+
CompletionItemKind: () => CompletionItemKind$1,
|
|
6361
|
+
CompletionItemLabelDetails: () => CompletionItemLabelDetails,
|
|
6362
|
+
CompletionItemTag: () => CompletionItemTag,
|
|
6363
|
+
CompletionList: () => CompletionList,
|
|
6364
|
+
CreateFile: () => CreateFile,
|
|
6365
|
+
DeleteFile: () => DeleteFile,
|
|
6366
|
+
Diagnostic: () => Diagnostic,
|
|
6367
|
+
DiagnosticRelatedInformation: () => DiagnosticRelatedInformation,
|
|
6368
|
+
DiagnosticSeverity: () => DiagnosticSeverity$1,
|
|
6369
|
+
DiagnosticTag: () => DiagnosticTag,
|
|
6370
|
+
DocumentHighlight: () => DocumentHighlight,
|
|
6371
|
+
DocumentHighlightKind: () => DocumentHighlightKind,
|
|
6372
|
+
DocumentLink: () => DocumentLink,
|
|
6373
|
+
DocumentSymbol: () => DocumentSymbol,
|
|
6374
|
+
DocumentUri: () => DocumentUri,
|
|
6375
|
+
EOL: () => EOL,
|
|
6376
|
+
FoldingRange: () => FoldingRange,
|
|
6377
|
+
FoldingRangeKind: () => FoldingRangeKind,
|
|
6378
|
+
FormattingOptions: () => FormattingOptions,
|
|
6379
|
+
Hover: () => Hover,
|
|
6380
|
+
InlayHint: () => InlayHint,
|
|
6381
|
+
InlayHintKind: () => InlayHintKind,
|
|
6382
|
+
InlayHintLabelPart: () => InlayHintLabelPart,
|
|
6383
|
+
InlineCompletionContext: () => InlineCompletionContext,
|
|
6384
|
+
InlineCompletionItem: () => InlineCompletionItem,
|
|
6385
|
+
InlineCompletionList: () => InlineCompletionList,
|
|
6386
|
+
InlineCompletionTriggerKind: () => InlineCompletionTriggerKind,
|
|
6387
|
+
InlineValueContext: () => InlineValueContext,
|
|
6388
|
+
InlineValueEvaluatableExpression: () => InlineValueEvaluatableExpression,
|
|
6389
|
+
InlineValueText: () => InlineValueText,
|
|
6390
|
+
InlineValueVariableLookup: () => InlineValueVariableLookup,
|
|
6391
|
+
InsertReplaceEdit: () => InsertReplaceEdit,
|
|
6392
|
+
InsertTextFormat: () => InsertTextFormat$1,
|
|
6393
|
+
InsertTextMode: () => InsertTextMode,
|
|
6394
|
+
LanguageKind: () => LanguageKind,
|
|
6395
|
+
Location: () => Location,
|
|
6396
|
+
LocationLink: () => LocationLink,
|
|
6397
|
+
MarkedString: () => MarkedString,
|
|
6398
|
+
MarkupContent: () => MarkupContent,
|
|
6399
|
+
MarkupKind: () => MarkupKind,
|
|
6400
|
+
OptionalVersionedTextDocumentIdentifier: () => OptionalVersionedTextDocumentIdentifier,
|
|
6401
|
+
ParameterInformation: () => ParameterInformation,
|
|
6402
|
+
Position: () => Position,
|
|
6403
|
+
Range: () => Range,
|
|
6404
|
+
RenameFile: () => RenameFile,
|
|
6405
|
+
SelectedCompletionInfo: () => SelectedCompletionInfo,
|
|
6406
|
+
SelectionRange: () => SelectionRange,
|
|
6407
|
+
SemanticTokenModifiers: () => SemanticTokenModifiers,
|
|
6408
|
+
SemanticTokenTypes: () => SemanticTokenTypes,
|
|
6409
|
+
SemanticTokens: () => SemanticTokens,
|
|
6410
|
+
SignatureInformation: () => SignatureInformation,
|
|
6411
|
+
SnippetTextEdit: () => SnippetTextEdit,
|
|
6412
|
+
StringValue: () => StringValue,
|
|
6413
|
+
SymbolInformation: () => SymbolInformation,
|
|
6414
|
+
SymbolKind: () => SymbolKind$1,
|
|
6415
|
+
SymbolTag: () => SymbolTag,
|
|
6416
|
+
TextDocument: () => TextDocument$1,
|
|
6417
|
+
TextDocumentEdit: () => TextDocumentEdit,
|
|
6418
|
+
TextDocumentIdentifier: () => TextDocumentIdentifier,
|
|
6419
|
+
TextDocumentItem: () => TextDocumentItem,
|
|
6420
|
+
TextEdit: () => TextEdit,
|
|
6421
|
+
URI: () => URI$3,
|
|
6422
|
+
VersionedTextDocumentIdentifier: () => VersionedTextDocumentIdentifier,
|
|
6423
|
+
WorkspaceChange: () => WorkspaceChange,
|
|
6424
|
+
WorkspaceEdit: () => WorkspaceEdit,
|
|
6425
|
+
WorkspaceFolder: () => WorkspaceFolder,
|
|
6426
|
+
WorkspaceSymbol: () => WorkspaceSymbol,
|
|
6427
|
+
integer: () => integer,
|
|
6428
|
+
uinteger: () => uinteger
|
|
6429
|
+
});
|
|
6430
|
+
var DocumentUri, URI$3, integer, uinteger, Position, Range, Location, LocationLink, Color, ColorInformation, ColorPresentation, FoldingRangeKind, FoldingRange, DiagnosticRelatedInformation, DiagnosticSeverity$1, DiagnosticTag, CodeDescription, Diagnostic, Command, TextEdit, ChangeAnnotation, ChangeAnnotationIdentifier, AnnotatedTextEdit, TextDocumentEdit, CreateFile, RenameFile, DeleteFile, WorkspaceEdit, TextEditChangeImpl, SnippetTextEdit, ChangeAnnotations, WorkspaceChange, TextDocumentIdentifier, VersionedTextDocumentIdentifier, OptionalVersionedTextDocumentIdentifier, LanguageKind, TextDocumentItem, MarkupKind, MarkupContent, CompletionItemKind$1, InsertTextFormat$1, CompletionItemTag, InsertReplaceEdit, InsertTextMode, ApplyKind, CompletionItemLabelDetails, CompletionItem, CompletionList, MarkedString, Hover, ParameterInformation, SignatureInformation, DocumentHighlightKind, DocumentHighlight, SymbolKind$1, SymbolTag, SymbolInformation, WorkspaceSymbol, DocumentSymbol, CodeActionKind, CodeActionTriggerKind, CodeActionContext, CodeActionTag, CodeAction, CodeLens, FormattingOptions, DocumentLink, SelectionRange, SemanticTokenTypes, SemanticTokenModifiers, SemanticTokens, InlineValueText, InlineValueVariableLookup, InlineValueEvaluatableExpression, InlineValueContext, InlayHintKind, InlayHintLabelPart, InlayHint, StringValue, InlineCompletionItem, InlineCompletionList, InlineCompletionTriggerKind, SelectedCompletionInfo, InlineCompletionContext, WorkspaceFolder, EOL, TextDocument$1, FullTextDocument$1, Is;
|
|
6431
|
+
var init_main$1 = __esmMin((() => {
|
|
6432
|
+
;
|
|
6433
|
+
(function(DocumentUri) {
|
|
6434
|
+
function is(value) {
|
|
6435
|
+
return typeof value === "string";
|
|
6436
|
+
}
|
|
6437
|
+
DocumentUri.is = is;
|
|
6438
|
+
})(DocumentUri || (DocumentUri = {}));
|
|
6439
|
+
;
|
|
6440
|
+
(function(URI) {
|
|
6441
|
+
function is(value) {
|
|
6442
|
+
return typeof value === "string";
|
|
6443
|
+
}
|
|
6444
|
+
URI.is = is;
|
|
6445
|
+
})(URI$3 || (URI$3 = {}));
|
|
6446
|
+
;
|
|
6447
|
+
(function(integer) {
|
|
6448
|
+
integer.MIN_VALUE = -2147483648;
|
|
6449
|
+
integer.MAX_VALUE = 2147483647;
|
|
6450
|
+
function is(value) {
|
|
6451
|
+
return typeof value === "number" && integer.MIN_VALUE <= value && value <= integer.MAX_VALUE;
|
|
6452
|
+
}
|
|
6453
|
+
integer.is = is;
|
|
6454
|
+
})(integer || (integer = {}));
|
|
6455
|
+
;
|
|
6456
|
+
(function(uinteger) {
|
|
6457
|
+
uinteger.MIN_VALUE = 0;
|
|
6458
|
+
uinteger.MAX_VALUE = 2147483647;
|
|
6459
|
+
function is(value) {
|
|
6460
|
+
return typeof value === "number" && uinteger.MIN_VALUE <= value && value <= uinteger.MAX_VALUE;
|
|
6461
|
+
}
|
|
6462
|
+
uinteger.is = is;
|
|
6463
|
+
})(uinteger || (uinteger = {}));
|
|
6464
|
+
;
|
|
6465
|
+
(function(Position) {
|
|
6385
6466
|
/**
|
|
6386
|
-
*
|
|
6387
|
-
*
|
|
6467
|
+
* Creates a new Position literal from the given line and character.
|
|
6468
|
+
* @param line The position's line.
|
|
6469
|
+
* @param character The position's character.
|
|
6388
6470
|
*/
|
|
6389
|
-
|
|
6390
|
-
|
|
6391
|
-
|
|
6392
|
-
|
|
6393
|
-
|
|
6394
|
-
|
|
6395
|
-
|
|
6396
|
-
|
|
6397
|
-
|
|
6398
|
-
if (character === Number.MAX_VALUE) character = uinteger.MAX_VALUE;
|
|
6399
|
-
return {
|
|
6400
|
-
line,
|
|
6401
|
-
character
|
|
6402
|
-
};
|
|
6403
|
-
}
|
|
6404
|
-
Position.create = create;
|
|
6405
|
-
/**
|
|
6406
|
-
* Checks whether the given literal conforms to the {@link Position} interface.
|
|
6407
|
-
*/
|
|
6408
|
-
function is(value) {
|
|
6409
|
-
var candidate = value;
|
|
6410
|
-
return Is.objectLiteral(candidate) && Is.uinteger(candidate.line) && Is.uinteger(candidate.character);
|
|
6411
|
-
}
|
|
6412
|
-
Position.is = is;
|
|
6413
|
-
})(Position || (exports$10.Position = Position = {}));
|
|
6471
|
+
function create(line, character) {
|
|
6472
|
+
if (line === Number.MAX_VALUE) line = uinteger.MAX_VALUE;
|
|
6473
|
+
if (character === Number.MAX_VALUE) character = uinteger.MAX_VALUE;
|
|
6474
|
+
return {
|
|
6475
|
+
line,
|
|
6476
|
+
character
|
|
6477
|
+
};
|
|
6478
|
+
}
|
|
6479
|
+
Position.create = create;
|
|
6414
6480
|
/**
|
|
6415
|
-
*
|
|
6416
|
-
* {@link Range} literals.
|
|
6481
|
+
* Checks whether the given literal conforms to the {@link Position} interface.
|
|
6417
6482
|
*/
|
|
6418
|
-
|
|
6419
|
-
|
|
6420
|
-
|
|
6421
|
-
|
|
6422
|
-
|
|
6423
|
-
|
|
6424
|
-
|
|
6425
|
-
|
|
6426
|
-
|
|
6427
|
-
|
|
6428
|
-
|
|
6429
|
-
|
|
6430
|
-
}
|
|
6431
|
-
|
|
6432
|
-
|
|
6433
|
-
|
|
6434
|
-
|
|
6435
|
-
|
|
6436
|
-
|
|
6437
|
-
|
|
6438
|
-
}
|
|
6439
|
-
Range.is = is;
|
|
6440
|
-
})(Range || (exports$10.Range = Range = {}));
|
|
6483
|
+
function is(value) {
|
|
6484
|
+
const candidate = value;
|
|
6485
|
+
return Is.objectLiteral(candidate) && Is.uinteger(candidate.line) && Is.uinteger(candidate.character);
|
|
6486
|
+
}
|
|
6487
|
+
Position.is = is;
|
|
6488
|
+
})(Position || (Position = {}));
|
|
6489
|
+
;
|
|
6490
|
+
(function(Range) {
|
|
6491
|
+
function create(one, two, three, four) {
|
|
6492
|
+
if (Is.uinteger(one) && Is.uinteger(two) && Is.uinteger(three) && Is.uinteger(four)) return {
|
|
6493
|
+
start: Position.create(one, two),
|
|
6494
|
+
end: Position.create(three, four)
|
|
6495
|
+
};
|
|
6496
|
+
else if (Position.is(one) && Position.is(two)) return {
|
|
6497
|
+
start: one,
|
|
6498
|
+
end: two
|
|
6499
|
+
};
|
|
6500
|
+
else throw new Error(`Range#create called with invalid arguments[${one}, ${two}, ${three}, ${four}]`);
|
|
6501
|
+
}
|
|
6502
|
+
Range.create = create;
|
|
6441
6503
|
/**
|
|
6442
|
-
*
|
|
6443
|
-
* {@link Location} literals.
|
|
6504
|
+
* Checks whether the given literal conforms to the {@link Range} interface.
|
|
6444
6505
|
*/
|
|
6445
|
-
|
|
6446
|
-
|
|
6447
|
-
|
|
6448
|
-
|
|
6449
|
-
|
|
6450
|
-
|
|
6451
|
-
|
|
6452
|
-
|
|
6453
|
-
return {
|
|
6454
|
-
uri,
|
|
6455
|
-
range
|
|
6456
|
-
};
|
|
6457
|
-
}
|
|
6458
|
-
Location.create = create;
|
|
6459
|
-
/**
|
|
6460
|
-
* Checks whether the given literal conforms to the {@link Location} interface.
|
|
6461
|
-
*/
|
|
6462
|
-
function is(value) {
|
|
6463
|
-
var candidate = value;
|
|
6464
|
-
return Is.objectLiteral(candidate) && Range.is(candidate.range) && (Is.string(candidate.uri) || Is.undefined(candidate.uri));
|
|
6465
|
-
}
|
|
6466
|
-
Location.is = is;
|
|
6467
|
-
})(Location || (exports$10.Location = Location = {}));
|
|
6506
|
+
function is(value) {
|
|
6507
|
+
const candidate = value;
|
|
6508
|
+
return Is.objectLiteral(candidate) && Position.is(candidate.start) && Position.is(candidate.end);
|
|
6509
|
+
}
|
|
6510
|
+
Range.is = is;
|
|
6511
|
+
})(Range || (Range = {}));
|
|
6512
|
+
;
|
|
6513
|
+
(function(Location) {
|
|
6468
6514
|
/**
|
|
6469
|
-
*
|
|
6470
|
-
*
|
|
6515
|
+
* Creates a Location literal.
|
|
6516
|
+
* @param uri The location's uri.
|
|
6517
|
+
* @param range The location's range.
|
|
6471
6518
|
*/
|
|
6472
|
-
|
|
6473
|
-
|
|
6474
|
-
|
|
6475
|
-
|
|
6476
|
-
|
|
6477
|
-
|
|
6478
|
-
|
|
6479
|
-
* @param originSelectionRange The span of the symbol being defined in the originating source file.
|
|
6480
|
-
*/
|
|
6481
|
-
function create(targetUri, targetRange, targetSelectionRange, originSelectionRange) {
|
|
6482
|
-
return {
|
|
6483
|
-
targetUri,
|
|
6484
|
-
targetRange,
|
|
6485
|
-
targetSelectionRange,
|
|
6486
|
-
originSelectionRange
|
|
6487
|
-
};
|
|
6488
|
-
}
|
|
6489
|
-
LocationLink.create = create;
|
|
6490
|
-
/**
|
|
6491
|
-
* Checks whether the given literal conforms to the {@link LocationLink} interface.
|
|
6492
|
-
*/
|
|
6493
|
-
function is(value) {
|
|
6494
|
-
var candidate = value;
|
|
6495
|
-
return Is.objectLiteral(candidate) && Range.is(candidate.targetRange) && Is.string(candidate.targetUri) && Range.is(candidate.targetSelectionRange) && (Range.is(candidate.originSelectionRange) || Is.undefined(candidate.originSelectionRange));
|
|
6496
|
-
}
|
|
6497
|
-
LocationLink.is = is;
|
|
6498
|
-
})(LocationLink || (exports$10.LocationLink = LocationLink = {}));
|
|
6519
|
+
function create(uri, range) {
|
|
6520
|
+
return {
|
|
6521
|
+
uri,
|
|
6522
|
+
range
|
|
6523
|
+
};
|
|
6524
|
+
}
|
|
6525
|
+
Location.create = create;
|
|
6499
6526
|
/**
|
|
6500
|
-
*
|
|
6501
|
-
* {@link Color} literals.
|
|
6527
|
+
* Checks whether the given literal conforms to the {@link Location} interface.
|
|
6502
6528
|
*/
|
|
6503
|
-
|
|
6504
|
-
|
|
6505
|
-
|
|
6506
|
-
|
|
6507
|
-
|
|
6508
|
-
|
|
6509
|
-
|
|
6510
|
-
|
|
6511
|
-
green,
|
|
6512
|
-
blue,
|
|
6513
|
-
alpha
|
|
6514
|
-
};
|
|
6515
|
-
}
|
|
6516
|
-
Color.create = create;
|
|
6517
|
-
/**
|
|
6518
|
-
* Checks whether the given literal conforms to the {@link Color} interface.
|
|
6519
|
-
*/
|
|
6520
|
-
function is(value) {
|
|
6521
|
-
var candidate = value;
|
|
6522
|
-
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);
|
|
6523
|
-
}
|
|
6524
|
-
Color.is = is;
|
|
6525
|
-
})(Color || (exports$10.Color = Color = {}));
|
|
6529
|
+
function is(value) {
|
|
6530
|
+
const candidate = value;
|
|
6531
|
+
return Is.objectLiteral(candidate) && Range.is(candidate.range) && (Is.string(candidate.uri) || Is.undefined(candidate.uri));
|
|
6532
|
+
}
|
|
6533
|
+
Location.is = is;
|
|
6534
|
+
})(Location || (Location = {}));
|
|
6535
|
+
;
|
|
6536
|
+
(function(LocationLink) {
|
|
6526
6537
|
/**
|
|
6527
|
-
*
|
|
6528
|
-
*
|
|
6538
|
+
* Creates a LocationLink literal.
|
|
6539
|
+
* @param targetUri The definition's uri.
|
|
6540
|
+
* @param targetRange The full range of the definition.
|
|
6541
|
+
* @param targetSelectionRange The span of the symbol definition at the target.
|
|
6542
|
+
* @param originSelectionRange The span of the symbol being defined in the originating source file.
|
|
6529
6543
|
*/
|
|
6530
|
-
|
|
6531
|
-
|
|
6532
|
-
|
|
6533
|
-
|
|
6534
|
-
|
|
6535
|
-
|
|
6536
|
-
|
|
6537
|
-
|
|
6538
|
-
|
|
6539
|
-
};
|
|
6540
|
-
}
|
|
6541
|
-
ColorInformation.create = create;
|
|
6542
|
-
/**
|
|
6543
|
-
* Checks whether the given literal conforms to the {@link ColorInformation} interface.
|
|
6544
|
-
*/
|
|
6545
|
-
function is(value) {
|
|
6546
|
-
var candidate = value;
|
|
6547
|
-
return Is.objectLiteral(candidate) && Range.is(candidate.range) && Color.is(candidate.color);
|
|
6548
|
-
}
|
|
6549
|
-
ColorInformation.is = is;
|
|
6550
|
-
})(ColorInformation || (exports$10.ColorInformation = ColorInformation = {}));
|
|
6544
|
+
function create(targetUri, targetRange, targetSelectionRange, originSelectionRange) {
|
|
6545
|
+
return {
|
|
6546
|
+
targetUri,
|
|
6547
|
+
targetRange,
|
|
6548
|
+
targetSelectionRange,
|
|
6549
|
+
originSelectionRange
|
|
6550
|
+
};
|
|
6551
|
+
}
|
|
6552
|
+
LocationLink.create = create;
|
|
6551
6553
|
/**
|
|
6552
|
-
*
|
|
6553
|
-
* {@link ColorPresentation} literals.
|
|
6554
|
+
* Checks whether the given literal conforms to the {@link LocationLink} interface.
|
|
6554
6555
|
*/
|
|
6555
|
-
|
|
6556
|
-
|
|
6557
|
-
|
|
6558
|
-
|
|
6559
|
-
|
|
6560
|
-
|
|
6561
|
-
|
|
6562
|
-
|
|
6563
|
-
textEdit,
|
|
6564
|
-
additionalTextEdits
|
|
6565
|
-
};
|
|
6566
|
-
}
|
|
6567
|
-
ColorPresentation.create = create;
|
|
6568
|
-
/**
|
|
6569
|
-
* Checks whether the given literal conforms to the {@link ColorInformation} interface.
|
|
6570
|
-
*/
|
|
6571
|
-
function is(value) {
|
|
6572
|
-
var candidate = value;
|
|
6573
|
-
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));
|
|
6574
|
-
}
|
|
6575
|
-
ColorPresentation.is = is;
|
|
6576
|
-
})(ColorPresentation || (exports$10.ColorPresentation = ColorPresentation = {}));
|
|
6556
|
+
function is(value) {
|
|
6557
|
+
const candidate = value;
|
|
6558
|
+
return Is.objectLiteral(candidate) && Range.is(candidate.targetRange) && Is.string(candidate.targetUri) && Range.is(candidate.targetSelectionRange) && (Range.is(candidate.originSelectionRange) || Is.undefined(candidate.originSelectionRange));
|
|
6559
|
+
}
|
|
6560
|
+
LocationLink.is = is;
|
|
6561
|
+
})(LocationLink || (LocationLink = {}));
|
|
6562
|
+
;
|
|
6563
|
+
(function(Color) {
|
|
6577
6564
|
/**
|
|
6578
|
-
*
|
|
6565
|
+
* Creates a new Color literal.
|
|
6579
6566
|
*/
|
|
6580
|
-
|
|
6581
|
-
|
|
6582
|
-
|
|
6583
|
-
|
|
6584
|
-
|
|
6585
|
-
|
|
6586
|
-
|
|
6587
|
-
|
|
6588
|
-
|
|
6589
|
-
FoldingRangeKind.Imports = "imports";
|
|
6590
|
-
/**
|
|
6591
|
-
* Folding range for a region (e.g. `#region`)
|
|
6592
|
-
*/
|
|
6593
|
-
FoldingRangeKind.Region = "region";
|
|
6594
|
-
})(FoldingRangeKind || (exports$10.FoldingRangeKind = FoldingRangeKind = {}));
|
|
6567
|
+
function create(red, green, blue, alpha) {
|
|
6568
|
+
return {
|
|
6569
|
+
red,
|
|
6570
|
+
green,
|
|
6571
|
+
blue,
|
|
6572
|
+
alpha
|
|
6573
|
+
};
|
|
6574
|
+
}
|
|
6575
|
+
Color.create = create;
|
|
6595
6576
|
/**
|
|
6596
|
-
*
|
|
6597
|
-
* {@link FoldingRange} literals.
|
|
6577
|
+
* Checks whether the given literal conforms to the {@link Color} interface.
|
|
6598
6578
|
*/
|
|
6599
|
-
|
|
6600
|
-
|
|
6601
|
-
|
|
6602
|
-
|
|
6603
|
-
|
|
6604
|
-
|
|
6605
|
-
|
|
6606
|
-
|
|
6607
|
-
endLine
|
|
6608
|
-
};
|
|
6609
|
-
if (Is.defined(startCharacter)) result.startCharacter = startCharacter;
|
|
6610
|
-
if (Is.defined(endCharacter)) result.endCharacter = endCharacter;
|
|
6611
|
-
if (Is.defined(kind)) result.kind = kind;
|
|
6612
|
-
if (Is.defined(collapsedText)) result.collapsedText = collapsedText;
|
|
6613
|
-
return result;
|
|
6614
|
-
}
|
|
6615
|
-
FoldingRange.create = create;
|
|
6616
|
-
/**
|
|
6617
|
-
* Checks whether the given literal conforms to the {@link FoldingRange} interface.
|
|
6618
|
-
*/
|
|
6619
|
-
function is(value) {
|
|
6620
|
-
var candidate = value;
|
|
6621
|
-
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));
|
|
6622
|
-
}
|
|
6623
|
-
FoldingRange.is = is;
|
|
6624
|
-
})(FoldingRange || (exports$10.FoldingRange = FoldingRange = {}));
|
|
6579
|
+
function is(value) {
|
|
6580
|
+
const candidate = value;
|
|
6581
|
+
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);
|
|
6582
|
+
}
|
|
6583
|
+
Color.is = is;
|
|
6584
|
+
})(Color || (Color = {}));
|
|
6585
|
+
;
|
|
6586
|
+
(function(ColorInformation) {
|
|
6625
6587
|
/**
|
|
6626
|
-
*
|
|
6627
|
-
* {@link DiagnosticRelatedInformation} literals.
|
|
6588
|
+
* Creates a new ColorInformation literal.
|
|
6628
6589
|
*/
|
|
6629
|
-
|
|
6630
|
-
|
|
6631
|
-
|
|
6632
|
-
|
|
6633
|
-
|
|
6634
|
-
|
|
6635
|
-
|
|
6636
|
-
location,
|
|
6637
|
-
message
|
|
6638
|
-
};
|
|
6639
|
-
}
|
|
6640
|
-
DiagnosticRelatedInformation.create = create;
|
|
6641
|
-
/**
|
|
6642
|
-
* Checks whether the given literal conforms to the {@link DiagnosticRelatedInformation} interface.
|
|
6643
|
-
*/
|
|
6644
|
-
function is(value) {
|
|
6645
|
-
var candidate = value;
|
|
6646
|
-
return Is.defined(candidate) && Location.is(candidate.location) && Is.string(candidate.message);
|
|
6647
|
-
}
|
|
6648
|
-
DiagnosticRelatedInformation.is = is;
|
|
6649
|
-
})(DiagnosticRelatedInformation || (exports$10.DiagnosticRelatedInformation = DiagnosticRelatedInformation = {}));
|
|
6590
|
+
function create(range, color) {
|
|
6591
|
+
return {
|
|
6592
|
+
range,
|
|
6593
|
+
color
|
|
6594
|
+
};
|
|
6595
|
+
}
|
|
6596
|
+
ColorInformation.create = create;
|
|
6650
6597
|
/**
|
|
6651
|
-
*
|
|
6598
|
+
* Checks whether the given literal conforms to the {@link ColorInformation} interface.
|
|
6652
6599
|
*/
|
|
6653
|
-
|
|
6654
|
-
|
|
6655
|
-
|
|
6656
|
-
|
|
6657
|
-
|
|
6658
|
-
|
|
6659
|
-
|
|
6660
|
-
|
|
6661
|
-
*/
|
|
6662
|
-
DiagnosticSeverity.Warning = 2;
|
|
6663
|
-
/**
|
|
6664
|
-
* Reports an information.
|
|
6665
|
-
*/
|
|
6666
|
-
DiagnosticSeverity.Information = 3;
|
|
6667
|
-
/**
|
|
6668
|
-
* Reports a hint.
|
|
6669
|
-
*/
|
|
6670
|
-
DiagnosticSeverity.Hint = 4;
|
|
6671
|
-
})(DiagnosticSeverity || (exports$10.DiagnosticSeverity = DiagnosticSeverity = {}));
|
|
6600
|
+
function is(value) {
|
|
6601
|
+
const candidate = value;
|
|
6602
|
+
return Is.objectLiteral(candidate) && Range.is(candidate.range) && Color.is(candidate.color);
|
|
6603
|
+
}
|
|
6604
|
+
ColorInformation.is = is;
|
|
6605
|
+
})(ColorInformation || (ColorInformation = {}));
|
|
6606
|
+
;
|
|
6607
|
+
(function(ColorPresentation) {
|
|
6672
6608
|
/**
|
|
6673
|
-
*
|
|
6674
|
-
*
|
|
6675
|
-
* @since 3.15.0
|
|
6609
|
+
* Creates a new ColorInformation literal.
|
|
6676
6610
|
*/
|
|
6677
|
-
|
|
6678
|
-
|
|
6679
|
-
|
|
6680
|
-
|
|
6681
|
-
|
|
6682
|
-
|
|
6683
|
-
|
|
6684
|
-
|
|
6685
|
-
DiagnosticTag.Unnecessary = 1;
|
|
6686
|
-
/**
|
|
6687
|
-
* Deprecated or obsolete code.
|
|
6688
|
-
*
|
|
6689
|
-
* Clients are allowed to rendered diagnostics with this tag strike through.
|
|
6690
|
-
*/
|
|
6691
|
-
DiagnosticTag.Deprecated = 2;
|
|
6692
|
-
})(DiagnosticTag || (exports$10.DiagnosticTag = DiagnosticTag = {}));
|
|
6611
|
+
function create(label, textEdit, additionalTextEdits) {
|
|
6612
|
+
return {
|
|
6613
|
+
label,
|
|
6614
|
+
textEdit,
|
|
6615
|
+
additionalTextEdits
|
|
6616
|
+
};
|
|
6617
|
+
}
|
|
6618
|
+
ColorPresentation.create = create;
|
|
6693
6619
|
/**
|
|
6694
|
-
*
|
|
6695
|
-
*
|
|
6696
|
-
* @since 3.16.0
|
|
6620
|
+
* Checks whether the given literal conforms to the {@link ColorInformation} interface.
|
|
6697
6621
|
*/
|
|
6698
|
-
|
|
6699
|
-
|
|
6700
|
-
|
|
6701
|
-
|
|
6702
|
-
|
|
6703
|
-
|
|
6704
|
-
|
|
6705
|
-
|
|
6622
|
+
function is(value) {
|
|
6623
|
+
const candidate = value;
|
|
6624
|
+
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));
|
|
6625
|
+
}
|
|
6626
|
+
ColorPresentation.is = is;
|
|
6627
|
+
})(ColorPresentation || (ColorPresentation = {}));
|
|
6628
|
+
;
|
|
6629
|
+
(function(FoldingRangeKind) {
|
|
6706
6630
|
/**
|
|
6707
|
-
*
|
|
6708
|
-
* {@link Diagnostic} literals.
|
|
6631
|
+
* Folding range for a comment
|
|
6709
6632
|
*/
|
|
6710
|
-
|
|
6711
|
-
(function(Diagnostic) {
|
|
6712
|
-
/**
|
|
6713
|
-
* Creates a new Diagnostic literal.
|
|
6714
|
-
*/
|
|
6715
|
-
function create(range, message, severity, code, source, relatedInformation) {
|
|
6716
|
-
var result = {
|
|
6717
|
-
range,
|
|
6718
|
-
message
|
|
6719
|
-
};
|
|
6720
|
-
if (Is.defined(severity)) result.severity = severity;
|
|
6721
|
-
if (Is.defined(code)) result.code = code;
|
|
6722
|
-
if (Is.defined(source)) result.source = source;
|
|
6723
|
-
if (Is.defined(relatedInformation)) result.relatedInformation = relatedInformation;
|
|
6724
|
-
return result;
|
|
6725
|
-
}
|
|
6726
|
-
Diagnostic.create = create;
|
|
6727
|
-
/**
|
|
6728
|
-
* Checks whether the given literal conforms to the {@link Diagnostic} interface.
|
|
6729
|
-
*/
|
|
6730
|
-
function is(value) {
|
|
6731
|
-
var _a;
|
|
6732
|
-
var candidate = value;
|
|
6733
|
-
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));
|
|
6734
|
-
}
|
|
6735
|
-
Diagnostic.is = is;
|
|
6736
|
-
})(Diagnostic || (exports$10.Diagnostic = Diagnostic = {}));
|
|
6633
|
+
FoldingRangeKind.Comment = "comment";
|
|
6737
6634
|
/**
|
|
6738
|
-
*
|
|
6739
|
-
* {@link Command} literals.
|
|
6635
|
+
* Folding range for an import or include
|
|
6740
6636
|
*/
|
|
6741
|
-
|
|
6742
|
-
(function(Command) {
|
|
6743
|
-
/**
|
|
6744
|
-
* Creates a new Command literal.
|
|
6745
|
-
*/
|
|
6746
|
-
function create(title, command) {
|
|
6747
|
-
var args = [];
|
|
6748
|
-
for (var _i = 2; _i < arguments.length; _i++) args[_i - 2] = arguments[_i];
|
|
6749
|
-
var result = {
|
|
6750
|
-
title,
|
|
6751
|
-
command
|
|
6752
|
-
};
|
|
6753
|
-
if (Is.defined(args) && args.length > 0) result.arguments = args;
|
|
6754
|
-
return result;
|
|
6755
|
-
}
|
|
6756
|
-
Command.create = create;
|
|
6757
|
-
/**
|
|
6758
|
-
* Checks whether the given literal conforms to the {@link Command} interface.
|
|
6759
|
-
*/
|
|
6760
|
-
function is(value) {
|
|
6761
|
-
var candidate = value;
|
|
6762
|
-
return Is.defined(candidate) && Is.string(candidate.title) && Is.string(candidate.command);
|
|
6763
|
-
}
|
|
6764
|
-
Command.is = is;
|
|
6765
|
-
})(Command || (exports$10.Command = Command = {}));
|
|
6637
|
+
FoldingRangeKind.Imports = "imports";
|
|
6766
6638
|
/**
|
|
6767
|
-
*
|
|
6768
|
-
* insert and delete edits more easily.
|
|
6639
|
+
* Folding range for a region (e.g. `#region`)
|
|
6769
6640
|
*/
|
|
6770
|
-
|
|
6771
|
-
|
|
6772
|
-
|
|
6773
|
-
|
|
6774
|
-
* @param range The range of text to be replaced.
|
|
6775
|
-
* @param newText The new text.
|
|
6776
|
-
*/
|
|
6777
|
-
function replace(range, newText) {
|
|
6778
|
-
return {
|
|
6779
|
-
range,
|
|
6780
|
-
newText
|
|
6781
|
-
};
|
|
6782
|
-
}
|
|
6783
|
-
TextEdit.replace = replace;
|
|
6784
|
-
/**
|
|
6785
|
-
* Creates an insert text edit.
|
|
6786
|
-
* @param position The position to insert the text at.
|
|
6787
|
-
* @param newText The text to be inserted.
|
|
6788
|
-
*/
|
|
6789
|
-
function insert(position, newText) {
|
|
6790
|
-
return {
|
|
6791
|
-
range: {
|
|
6792
|
-
start: position,
|
|
6793
|
-
end: position
|
|
6794
|
-
},
|
|
6795
|
-
newText
|
|
6796
|
-
};
|
|
6797
|
-
}
|
|
6798
|
-
TextEdit.insert = insert;
|
|
6799
|
-
/**
|
|
6800
|
-
* Creates a delete text edit.
|
|
6801
|
-
* @param range The range of text to be deleted.
|
|
6802
|
-
*/
|
|
6803
|
-
function del(range) {
|
|
6804
|
-
return {
|
|
6805
|
-
range,
|
|
6806
|
-
newText: ""
|
|
6807
|
-
};
|
|
6808
|
-
}
|
|
6809
|
-
TextEdit.del = del;
|
|
6810
|
-
function is(value) {
|
|
6811
|
-
var candidate = value;
|
|
6812
|
-
return Is.objectLiteral(candidate) && Is.string(candidate.newText) && Range.is(candidate.range);
|
|
6813
|
-
}
|
|
6814
|
-
TextEdit.is = is;
|
|
6815
|
-
})(TextEdit || (exports$10.TextEdit = TextEdit = {}));
|
|
6816
|
-
var ChangeAnnotation;
|
|
6817
|
-
(function(ChangeAnnotation) {
|
|
6818
|
-
function create(label, needsConfirmation, description) {
|
|
6819
|
-
var result = { label };
|
|
6820
|
-
if (needsConfirmation !== void 0) result.needsConfirmation = needsConfirmation;
|
|
6821
|
-
if (description !== void 0) result.description = description;
|
|
6822
|
-
return result;
|
|
6823
|
-
}
|
|
6824
|
-
ChangeAnnotation.create = create;
|
|
6825
|
-
function is(value) {
|
|
6826
|
-
var candidate = value;
|
|
6827
|
-
return Is.objectLiteral(candidate) && Is.string(candidate.label) && (Is.boolean(candidate.needsConfirmation) || candidate.needsConfirmation === void 0) && (Is.string(candidate.description) || candidate.description === void 0);
|
|
6828
|
-
}
|
|
6829
|
-
ChangeAnnotation.is = is;
|
|
6830
|
-
})(ChangeAnnotation || (exports$10.ChangeAnnotation = ChangeAnnotation = {}));
|
|
6831
|
-
var ChangeAnnotationIdentifier;
|
|
6832
|
-
(function(ChangeAnnotationIdentifier) {
|
|
6833
|
-
function is(value) {
|
|
6834
|
-
var candidate = value;
|
|
6835
|
-
return Is.string(candidate);
|
|
6836
|
-
}
|
|
6837
|
-
ChangeAnnotationIdentifier.is = is;
|
|
6838
|
-
})(ChangeAnnotationIdentifier || (exports$10.ChangeAnnotationIdentifier = ChangeAnnotationIdentifier = {}));
|
|
6839
|
-
var AnnotatedTextEdit;
|
|
6840
|
-
(function(AnnotatedTextEdit) {
|
|
6841
|
-
/**
|
|
6842
|
-
* Creates an annotated replace text edit.
|
|
6843
|
-
*
|
|
6844
|
-
* @param range The range of text to be replaced.
|
|
6845
|
-
* @param newText The new text.
|
|
6846
|
-
* @param annotation The annotation.
|
|
6847
|
-
*/
|
|
6848
|
-
function replace(range, newText, annotation) {
|
|
6849
|
-
return {
|
|
6850
|
-
range,
|
|
6851
|
-
newText,
|
|
6852
|
-
annotationId: annotation
|
|
6853
|
-
};
|
|
6854
|
-
}
|
|
6855
|
-
AnnotatedTextEdit.replace = replace;
|
|
6856
|
-
/**
|
|
6857
|
-
* Creates an annotated insert text edit.
|
|
6858
|
-
*
|
|
6859
|
-
* @param position The position to insert the text at.
|
|
6860
|
-
* @param newText The text to be inserted.
|
|
6861
|
-
* @param annotation The annotation.
|
|
6862
|
-
*/
|
|
6863
|
-
function insert(position, newText, annotation) {
|
|
6864
|
-
return {
|
|
6865
|
-
range: {
|
|
6866
|
-
start: position,
|
|
6867
|
-
end: position
|
|
6868
|
-
},
|
|
6869
|
-
newText,
|
|
6870
|
-
annotationId: annotation
|
|
6871
|
-
};
|
|
6872
|
-
}
|
|
6873
|
-
AnnotatedTextEdit.insert = insert;
|
|
6874
|
-
/**
|
|
6875
|
-
* Creates an annotated delete text edit.
|
|
6876
|
-
*
|
|
6877
|
-
* @param range The range of text to be deleted.
|
|
6878
|
-
* @param annotation The annotation.
|
|
6879
|
-
*/
|
|
6880
|
-
function del(range, annotation) {
|
|
6881
|
-
return {
|
|
6882
|
-
range,
|
|
6883
|
-
newText: "",
|
|
6884
|
-
annotationId: annotation
|
|
6885
|
-
};
|
|
6886
|
-
}
|
|
6887
|
-
AnnotatedTextEdit.del = del;
|
|
6888
|
-
function is(value) {
|
|
6889
|
-
var candidate = value;
|
|
6890
|
-
return TextEdit.is(candidate) && (ChangeAnnotation.is(candidate.annotationId) || ChangeAnnotationIdentifier.is(candidate.annotationId));
|
|
6891
|
-
}
|
|
6892
|
-
AnnotatedTextEdit.is = is;
|
|
6893
|
-
})(AnnotatedTextEdit || (exports$10.AnnotatedTextEdit = AnnotatedTextEdit = {}));
|
|
6641
|
+
FoldingRangeKind.Region = "region";
|
|
6642
|
+
})(FoldingRangeKind || (FoldingRangeKind = {}));
|
|
6643
|
+
;
|
|
6644
|
+
(function(FoldingRange) {
|
|
6894
6645
|
/**
|
|
6895
|
-
*
|
|
6896
|
-
* an edit that manipulates a text document.
|
|
6646
|
+
* Creates a new FoldingRange literal.
|
|
6897
6647
|
*/
|
|
6898
|
-
|
|
6899
|
-
|
|
6900
|
-
|
|
6901
|
-
|
|
6902
|
-
*/
|
|
6903
|
-
function create(textDocument, edits) {
|
|
6904
|
-
return {
|
|
6905
|
-
textDocument,
|
|
6906
|
-
edits
|
|
6907
|
-
};
|
|
6908
|
-
}
|
|
6909
|
-
TextDocumentEdit.create = create;
|
|
6910
|
-
function is(value) {
|
|
6911
|
-
var candidate = value;
|
|
6912
|
-
return Is.defined(candidate) && OptionalVersionedTextDocumentIdentifier.is(candidate.textDocument) && Array.isArray(candidate.edits);
|
|
6913
|
-
}
|
|
6914
|
-
TextDocumentEdit.is = is;
|
|
6915
|
-
})(TextDocumentEdit || (exports$10.TextDocumentEdit = TextDocumentEdit = {}));
|
|
6916
|
-
var CreateFile;
|
|
6917
|
-
(function(CreateFile) {
|
|
6918
|
-
function create(uri, options, annotation) {
|
|
6919
|
-
var result = {
|
|
6920
|
-
kind: "create",
|
|
6921
|
-
uri
|
|
6922
|
-
};
|
|
6923
|
-
if (options !== void 0 && (options.overwrite !== void 0 || options.ignoreIfExists !== void 0)) result.options = options;
|
|
6924
|
-
if (annotation !== void 0) result.annotationId = annotation;
|
|
6925
|
-
return result;
|
|
6926
|
-
}
|
|
6927
|
-
CreateFile.create = create;
|
|
6928
|
-
function is(value) {
|
|
6929
|
-
var candidate = value;
|
|
6930
|
-
return candidate && candidate.kind === "create" && Is.string(candidate.uri) && (candidate.options === void 0 || (candidate.options.overwrite === void 0 || Is.boolean(candidate.options.overwrite)) && (candidate.options.ignoreIfExists === void 0 || Is.boolean(candidate.options.ignoreIfExists))) && (candidate.annotationId === void 0 || ChangeAnnotationIdentifier.is(candidate.annotationId));
|
|
6931
|
-
}
|
|
6932
|
-
CreateFile.is = is;
|
|
6933
|
-
})(CreateFile || (exports$10.CreateFile = CreateFile = {}));
|
|
6934
|
-
var RenameFile;
|
|
6935
|
-
(function(RenameFile) {
|
|
6936
|
-
function create(oldUri, newUri, options, annotation) {
|
|
6937
|
-
var result = {
|
|
6938
|
-
kind: "rename",
|
|
6939
|
-
oldUri,
|
|
6940
|
-
newUri
|
|
6941
|
-
};
|
|
6942
|
-
if (options !== void 0 && (options.overwrite !== void 0 || options.ignoreIfExists !== void 0)) result.options = options;
|
|
6943
|
-
if (annotation !== void 0) result.annotationId = annotation;
|
|
6944
|
-
return result;
|
|
6945
|
-
}
|
|
6946
|
-
RenameFile.create = create;
|
|
6947
|
-
function is(value) {
|
|
6948
|
-
var candidate = value;
|
|
6949
|
-
return candidate && candidate.kind === "rename" && Is.string(candidate.oldUri) && Is.string(candidate.newUri) && (candidate.options === void 0 || (candidate.options.overwrite === void 0 || Is.boolean(candidate.options.overwrite)) && (candidate.options.ignoreIfExists === void 0 || Is.boolean(candidate.options.ignoreIfExists))) && (candidate.annotationId === void 0 || ChangeAnnotationIdentifier.is(candidate.annotationId));
|
|
6950
|
-
}
|
|
6951
|
-
RenameFile.is = is;
|
|
6952
|
-
})(RenameFile || (exports$10.RenameFile = RenameFile = {}));
|
|
6953
|
-
var DeleteFile;
|
|
6954
|
-
(function(DeleteFile) {
|
|
6955
|
-
function create(uri, options, annotation) {
|
|
6956
|
-
var result = {
|
|
6957
|
-
kind: "delete",
|
|
6958
|
-
uri
|
|
6959
|
-
};
|
|
6960
|
-
if (options !== void 0 && (options.recursive !== void 0 || options.ignoreIfNotExists !== void 0)) result.options = options;
|
|
6961
|
-
if (annotation !== void 0) result.annotationId = annotation;
|
|
6962
|
-
return result;
|
|
6963
|
-
}
|
|
6964
|
-
DeleteFile.create = create;
|
|
6965
|
-
function is(value) {
|
|
6966
|
-
var candidate = value;
|
|
6967
|
-
return candidate && candidate.kind === "delete" && Is.string(candidate.uri) && (candidate.options === void 0 || (candidate.options.recursive === void 0 || Is.boolean(candidate.options.recursive)) && (candidate.options.ignoreIfNotExists === void 0 || Is.boolean(candidate.options.ignoreIfNotExists))) && (candidate.annotationId === void 0 || ChangeAnnotationIdentifier.is(candidate.annotationId));
|
|
6968
|
-
}
|
|
6969
|
-
DeleteFile.is = is;
|
|
6970
|
-
})(DeleteFile || (exports$10.DeleteFile = DeleteFile = {}));
|
|
6971
|
-
var WorkspaceEdit;
|
|
6972
|
-
(function(WorkspaceEdit) {
|
|
6973
|
-
function is(value) {
|
|
6974
|
-
var candidate = value;
|
|
6975
|
-
return candidate && (candidate.changes !== void 0 || candidate.documentChanges !== void 0) && (candidate.documentChanges === void 0 || candidate.documentChanges.every(function(change) {
|
|
6976
|
-
if (Is.string(change.kind)) return CreateFile.is(change) || RenameFile.is(change) || DeleteFile.is(change);
|
|
6977
|
-
else return TextDocumentEdit.is(change);
|
|
6978
|
-
}));
|
|
6979
|
-
}
|
|
6980
|
-
WorkspaceEdit.is = is;
|
|
6981
|
-
})(WorkspaceEdit || (exports$10.WorkspaceEdit = WorkspaceEdit = {}));
|
|
6982
|
-
var TextEditChangeImpl = function() {
|
|
6983
|
-
function TextEditChangeImpl(edits, changeAnnotations) {
|
|
6984
|
-
this.edits = edits;
|
|
6985
|
-
this.changeAnnotations = changeAnnotations;
|
|
6986
|
-
}
|
|
6987
|
-
TextEditChangeImpl.prototype.insert = function(position, newText, annotation) {
|
|
6988
|
-
var edit;
|
|
6989
|
-
var id;
|
|
6990
|
-
if (annotation === void 0) edit = TextEdit.insert(position, newText);
|
|
6991
|
-
else if (ChangeAnnotationIdentifier.is(annotation)) {
|
|
6992
|
-
id = annotation;
|
|
6993
|
-
edit = AnnotatedTextEdit.insert(position, newText, annotation);
|
|
6994
|
-
} else {
|
|
6995
|
-
this.assertChangeAnnotations(this.changeAnnotations);
|
|
6996
|
-
id = this.changeAnnotations.manage(annotation);
|
|
6997
|
-
edit = AnnotatedTextEdit.insert(position, newText, id);
|
|
6998
|
-
}
|
|
6999
|
-
this.edits.push(edit);
|
|
7000
|
-
if (id !== void 0) return id;
|
|
6648
|
+
function create(startLine, endLine, startCharacter, endCharacter, kind, collapsedText) {
|
|
6649
|
+
const result = {
|
|
6650
|
+
startLine,
|
|
6651
|
+
endLine
|
|
7001
6652
|
};
|
|
7002
|
-
|
|
7003
|
-
|
|
7004
|
-
|
|
7005
|
-
|
|
7006
|
-
|
|
7007
|
-
|
|
7008
|
-
|
|
7009
|
-
} else {
|
|
7010
|
-
this.assertChangeAnnotations(this.changeAnnotations);
|
|
7011
|
-
id = this.changeAnnotations.manage(annotation);
|
|
7012
|
-
edit = AnnotatedTextEdit.replace(range, newText, id);
|
|
7013
|
-
}
|
|
7014
|
-
this.edits.push(edit);
|
|
7015
|
-
if (id !== void 0) return id;
|
|
7016
|
-
};
|
|
7017
|
-
TextEditChangeImpl.prototype.delete = function(range, annotation) {
|
|
7018
|
-
var edit;
|
|
7019
|
-
var id;
|
|
7020
|
-
if (annotation === void 0) edit = TextEdit.del(range);
|
|
7021
|
-
else if (ChangeAnnotationIdentifier.is(annotation)) {
|
|
7022
|
-
id = annotation;
|
|
7023
|
-
edit = AnnotatedTextEdit.del(range, annotation);
|
|
7024
|
-
} else {
|
|
7025
|
-
this.assertChangeAnnotations(this.changeAnnotations);
|
|
7026
|
-
id = this.changeAnnotations.manage(annotation);
|
|
7027
|
-
edit = AnnotatedTextEdit.del(range, id);
|
|
7028
|
-
}
|
|
7029
|
-
this.edits.push(edit);
|
|
7030
|
-
if (id !== void 0) return id;
|
|
7031
|
-
};
|
|
7032
|
-
TextEditChangeImpl.prototype.add = function(edit) {
|
|
7033
|
-
this.edits.push(edit);
|
|
7034
|
-
};
|
|
7035
|
-
TextEditChangeImpl.prototype.all = function() {
|
|
7036
|
-
return this.edits;
|
|
7037
|
-
};
|
|
7038
|
-
TextEditChangeImpl.prototype.clear = function() {
|
|
7039
|
-
this.edits.splice(0, this.edits.length);
|
|
7040
|
-
};
|
|
7041
|
-
TextEditChangeImpl.prototype.assertChangeAnnotations = function(value) {
|
|
7042
|
-
if (value === void 0) throw new Error("Text edit change is not configured to manage change annotations.");
|
|
7043
|
-
};
|
|
7044
|
-
return TextEditChangeImpl;
|
|
7045
|
-
}();
|
|
6653
|
+
if (Is.defined(startCharacter)) result.startCharacter = startCharacter;
|
|
6654
|
+
if (Is.defined(endCharacter)) result.endCharacter = endCharacter;
|
|
6655
|
+
if (Is.defined(kind)) result.kind = kind;
|
|
6656
|
+
if (Is.defined(collapsedText)) result.collapsedText = collapsedText;
|
|
6657
|
+
return result;
|
|
6658
|
+
}
|
|
6659
|
+
FoldingRange.create = create;
|
|
7046
6660
|
/**
|
|
7047
|
-
*
|
|
6661
|
+
* Checks whether the given literal conforms to the {@link FoldingRange} interface.
|
|
7048
6662
|
*/
|
|
7049
|
-
|
|
7050
|
-
|
|
7051
|
-
|
|
7052
|
-
|
|
7053
|
-
|
|
7054
|
-
|
|
7055
|
-
|
|
7056
|
-
|
|
7057
|
-
|
|
7058
|
-
|
|
7059
|
-
|
|
7060
|
-
|
|
7061
|
-
|
|
7062
|
-
|
|
7063
|
-
|
|
7064
|
-
});
|
|
7065
|
-
ChangeAnnotations.prototype.manage = function(idOrAnnotation, annotation) {
|
|
7066
|
-
var id;
|
|
7067
|
-
if (ChangeAnnotationIdentifier.is(idOrAnnotation)) id = idOrAnnotation;
|
|
7068
|
-
else {
|
|
7069
|
-
id = this.nextId();
|
|
7070
|
-
annotation = idOrAnnotation;
|
|
7071
|
-
}
|
|
7072
|
-
if (this._annotations[id] !== void 0) throw new Error("Id ".concat(id, " is already in use."));
|
|
7073
|
-
if (annotation === void 0) throw new Error("No annotation provided for id ".concat(id));
|
|
7074
|
-
this._annotations[id] = annotation;
|
|
7075
|
-
this._size++;
|
|
7076
|
-
return id;
|
|
7077
|
-
};
|
|
7078
|
-
ChangeAnnotations.prototype.nextId = function() {
|
|
7079
|
-
this._counter++;
|
|
7080
|
-
return this._counter.toString();
|
|
7081
|
-
};
|
|
7082
|
-
return ChangeAnnotations;
|
|
7083
|
-
}();
|
|
7084
|
-
exports$10.WorkspaceChange = function() {
|
|
7085
|
-
function WorkspaceChange(workspaceEdit) {
|
|
7086
|
-
var _this = this;
|
|
7087
|
-
this._textEditChanges = Object.create(null);
|
|
7088
|
-
if (workspaceEdit !== void 0) {
|
|
7089
|
-
this._workspaceEdit = workspaceEdit;
|
|
7090
|
-
if (workspaceEdit.documentChanges) {
|
|
7091
|
-
this._changeAnnotations = new ChangeAnnotations(workspaceEdit.changeAnnotations);
|
|
7092
|
-
workspaceEdit.changeAnnotations = this._changeAnnotations.all();
|
|
7093
|
-
workspaceEdit.documentChanges.forEach(function(change) {
|
|
7094
|
-
if (TextDocumentEdit.is(change)) {
|
|
7095
|
-
var textEditChange = new TextEditChangeImpl(change.edits, _this._changeAnnotations);
|
|
7096
|
-
_this._textEditChanges[change.textDocument.uri] = textEditChange;
|
|
7097
|
-
}
|
|
7098
|
-
});
|
|
7099
|
-
} else if (workspaceEdit.changes) Object.keys(workspaceEdit.changes).forEach(function(key) {
|
|
7100
|
-
var textEditChange = new TextEditChangeImpl(workspaceEdit.changes[key]);
|
|
7101
|
-
_this._textEditChanges[key] = textEditChange;
|
|
7102
|
-
});
|
|
7103
|
-
} else this._workspaceEdit = {};
|
|
7104
|
-
}
|
|
7105
|
-
Object.defineProperty(WorkspaceChange.prototype, "edit", {
|
|
7106
|
-
/**
|
|
7107
|
-
* Returns the underlying {@link WorkspaceEdit} literal
|
|
7108
|
-
* use to be returned from a workspace edit operation like rename.
|
|
7109
|
-
*/
|
|
7110
|
-
get: function() {
|
|
7111
|
-
this.initDocumentChanges();
|
|
7112
|
-
if (this._changeAnnotations !== void 0) {
|
|
7113
|
-
if (this._changeAnnotations.size === 0) this._workspaceEdit.changeAnnotations = void 0;
|
|
7114
|
-
else this._workspaceEdit.changeAnnotations = this._changeAnnotations.all();
|
|
7115
|
-
}
|
|
7116
|
-
return this._workspaceEdit;
|
|
7117
|
-
},
|
|
7118
|
-
enumerable: false,
|
|
7119
|
-
configurable: true
|
|
7120
|
-
});
|
|
7121
|
-
WorkspaceChange.prototype.getTextEditChange = function(key) {
|
|
7122
|
-
if (OptionalVersionedTextDocumentIdentifier.is(key)) {
|
|
7123
|
-
this.initDocumentChanges();
|
|
7124
|
-
if (this._workspaceEdit.documentChanges === void 0) throw new Error("Workspace edit is not configured for document changes.");
|
|
7125
|
-
var textDocument = {
|
|
7126
|
-
uri: key.uri,
|
|
7127
|
-
version: key.version
|
|
7128
|
-
};
|
|
7129
|
-
var result = this._textEditChanges[textDocument.uri];
|
|
7130
|
-
if (!result) {
|
|
7131
|
-
var edits = [];
|
|
7132
|
-
var textDocumentEdit = {
|
|
7133
|
-
textDocument,
|
|
7134
|
-
edits
|
|
7135
|
-
};
|
|
7136
|
-
this._workspaceEdit.documentChanges.push(textDocumentEdit);
|
|
7137
|
-
result = new TextEditChangeImpl(edits, this._changeAnnotations);
|
|
7138
|
-
this._textEditChanges[textDocument.uri] = result;
|
|
7139
|
-
}
|
|
7140
|
-
return result;
|
|
7141
|
-
} else {
|
|
7142
|
-
this.initChanges();
|
|
7143
|
-
if (this._workspaceEdit.changes === void 0) throw new Error("Workspace edit is not configured for normal text edit changes.");
|
|
7144
|
-
var result = this._textEditChanges[key];
|
|
7145
|
-
if (!result) {
|
|
7146
|
-
var edits = [];
|
|
7147
|
-
this._workspaceEdit.changes[key] = edits;
|
|
7148
|
-
result = new TextEditChangeImpl(edits);
|
|
7149
|
-
this._textEditChanges[key] = result;
|
|
7150
|
-
}
|
|
7151
|
-
return result;
|
|
7152
|
-
}
|
|
7153
|
-
};
|
|
7154
|
-
WorkspaceChange.prototype.initDocumentChanges = function() {
|
|
7155
|
-
if (this._workspaceEdit.documentChanges === void 0 && this._workspaceEdit.changes === void 0) {
|
|
7156
|
-
this._changeAnnotations = new ChangeAnnotations();
|
|
7157
|
-
this._workspaceEdit.documentChanges = [];
|
|
7158
|
-
this._workspaceEdit.changeAnnotations = this._changeAnnotations.all();
|
|
7159
|
-
}
|
|
7160
|
-
};
|
|
7161
|
-
WorkspaceChange.prototype.initChanges = function() {
|
|
7162
|
-
if (this._workspaceEdit.documentChanges === void 0 && this._workspaceEdit.changes === void 0) this._workspaceEdit.changes = Object.create(null);
|
|
7163
|
-
};
|
|
7164
|
-
WorkspaceChange.prototype.createFile = function(uri, optionsOrAnnotation, options) {
|
|
7165
|
-
this.initDocumentChanges();
|
|
7166
|
-
if (this._workspaceEdit.documentChanges === void 0) throw new Error("Workspace edit is not configured for document changes.");
|
|
7167
|
-
var annotation;
|
|
7168
|
-
if (ChangeAnnotation.is(optionsOrAnnotation) || ChangeAnnotationIdentifier.is(optionsOrAnnotation)) annotation = optionsOrAnnotation;
|
|
7169
|
-
else options = optionsOrAnnotation;
|
|
7170
|
-
var operation;
|
|
7171
|
-
var id;
|
|
7172
|
-
if (annotation === void 0) operation = CreateFile.create(uri, options);
|
|
7173
|
-
else {
|
|
7174
|
-
id = ChangeAnnotationIdentifier.is(annotation) ? annotation : this._changeAnnotations.manage(annotation);
|
|
7175
|
-
operation = CreateFile.create(uri, options, id);
|
|
7176
|
-
}
|
|
7177
|
-
this._workspaceEdit.documentChanges.push(operation);
|
|
7178
|
-
if (id !== void 0) return id;
|
|
7179
|
-
};
|
|
7180
|
-
WorkspaceChange.prototype.renameFile = function(oldUri, newUri, optionsOrAnnotation, options) {
|
|
7181
|
-
this.initDocumentChanges();
|
|
7182
|
-
if (this._workspaceEdit.documentChanges === void 0) throw new Error("Workspace edit is not configured for document changes.");
|
|
7183
|
-
var annotation;
|
|
7184
|
-
if (ChangeAnnotation.is(optionsOrAnnotation) || ChangeAnnotationIdentifier.is(optionsOrAnnotation)) annotation = optionsOrAnnotation;
|
|
7185
|
-
else options = optionsOrAnnotation;
|
|
7186
|
-
var operation;
|
|
7187
|
-
var id;
|
|
7188
|
-
if (annotation === void 0) operation = RenameFile.create(oldUri, newUri, options);
|
|
7189
|
-
else {
|
|
7190
|
-
id = ChangeAnnotationIdentifier.is(annotation) ? annotation : this._changeAnnotations.manage(annotation);
|
|
7191
|
-
operation = RenameFile.create(oldUri, newUri, options, id);
|
|
7192
|
-
}
|
|
7193
|
-
this._workspaceEdit.documentChanges.push(operation);
|
|
7194
|
-
if (id !== void 0) return id;
|
|
7195
|
-
};
|
|
7196
|
-
WorkspaceChange.prototype.deleteFile = function(uri, optionsOrAnnotation, options) {
|
|
7197
|
-
this.initDocumentChanges();
|
|
7198
|
-
if (this._workspaceEdit.documentChanges === void 0) throw new Error("Workspace edit is not configured for document changes.");
|
|
7199
|
-
var annotation;
|
|
7200
|
-
if (ChangeAnnotation.is(optionsOrAnnotation) || ChangeAnnotationIdentifier.is(optionsOrAnnotation)) annotation = optionsOrAnnotation;
|
|
7201
|
-
else options = optionsOrAnnotation;
|
|
7202
|
-
var operation;
|
|
7203
|
-
var id;
|
|
7204
|
-
if (annotation === void 0) operation = DeleteFile.create(uri, options);
|
|
7205
|
-
else {
|
|
7206
|
-
id = ChangeAnnotationIdentifier.is(annotation) ? annotation : this._changeAnnotations.manage(annotation);
|
|
7207
|
-
operation = DeleteFile.create(uri, options, id);
|
|
7208
|
-
}
|
|
7209
|
-
this._workspaceEdit.documentChanges.push(operation);
|
|
7210
|
-
if (id !== void 0) return id;
|
|
6663
|
+
function is(value) {
|
|
6664
|
+
const candidate = value;
|
|
6665
|
+
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));
|
|
6666
|
+
}
|
|
6667
|
+
FoldingRange.is = is;
|
|
6668
|
+
})(FoldingRange || (FoldingRange = {}));
|
|
6669
|
+
;
|
|
6670
|
+
(function(DiagnosticRelatedInformation) {
|
|
6671
|
+
/**
|
|
6672
|
+
* Creates a new DiagnosticRelatedInformation literal.
|
|
6673
|
+
*/
|
|
6674
|
+
function create(location, message) {
|
|
6675
|
+
return {
|
|
6676
|
+
location,
|
|
6677
|
+
message
|
|
7211
6678
|
};
|
|
7212
|
-
|
|
7213
|
-
|
|
6679
|
+
}
|
|
6680
|
+
DiagnosticRelatedInformation.create = create;
|
|
7214
6681
|
/**
|
|
7215
|
-
*
|
|
7216
|
-
* {@link TextDocumentIdentifier} literals.
|
|
6682
|
+
* Checks whether the given literal conforms to the {@link DiagnosticRelatedInformation} interface.
|
|
7217
6683
|
*/
|
|
7218
|
-
|
|
7219
|
-
|
|
7220
|
-
|
|
7221
|
-
|
|
7222
|
-
|
|
7223
|
-
|
|
7224
|
-
|
|
7225
|
-
|
|
7226
|
-
}
|
|
7227
|
-
TextDocumentIdentifier.create = create;
|
|
7228
|
-
/**
|
|
7229
|
-
* Checks whether the given literal conforms to the {@link TextDocumentIdentifier} interface.
|
|
7230
|
-
*/
|
|
7231
|
-
function is(value) {
|
|
7232
|
-
var candidate = value;
|
|
7233
|
-
return Is.defined(candidate) && Is.string(candidate.uri);
|
|
7234
|
-
}
|
|
7235
|
-
TextDocumentIdentifier.is = is;
|
|
7236
|
-
})(TextDocumentIdentifier || (exports$10.TextDocumentIdentifier = TextDocumentIdentifier = {}));
|
|
6684
|
+
function is(value) {
|
|
6685
|
+
const candidate = value;
|
|
6686
|
+
return Is.defined(candidate) && Location.is(candidate.location) && Is.string(candidate.message);
|
|
6687
|
+
}
|
|
6688
|
+
DiagnosticRelatedInformation.is = is;
|
|
6689
|
+
})(DiagnosticRelatedInformation || (DiagnosticRelatedInformation = {}));
|
|
6690
|
+
;
|
|
6691
|
+
(function(DiagnosticSeverity) {
|
|
7237
6692
|
/**
|
|
7238
|
-
*
|
|
7239
|
-
* {@link VersionedTextDocumentIdentifier} literals.
|
|
6693
|
+
* Reports an error.
|
|
7240
6694
|
*/
|
|
7241
|
-
|
|
7242
|
-
(function(VersionedTextDocumentIdentifier) {
|
|
7243
|
-
/**
|
|
7244
|
-
* Creates a new VersionedTextDocumentIdentifier literal.
|
|
7245
|
-
* @param uri The document's uri.
|
|
7246
|
-
* @param version The document's version.
|
|
7247
|
-
*/
|
|
7248
|
-
function create(uri, version) {
|
|
7249
|
-
return {
|
|
7250
|
-
uri,
|
|
7251
|
-
version
|
|
7252
|
-
};
|
|
7253
|
-
}
|
|
7254
|
-
VersionedTextDocumentIdentifier.create = create;
|
|
7255
|
-
/**
|
|
7256
|
-
* Checks whether the given literal conforms to the {@link VersionedTextDocumentIdentifier} interface.
|
|
7257
|
-
*/
|
|
7258
|
-
function is(value) {
|
|
7259
|
-
var candidate = value;
|
|
7260
|
-
return Is.defined(candidate) && Is.string(candidate.uri) && Is.integer(candidate.version);
|
|
7261
|
-
}
|
|
7262
|
-
VersionedTextDocumentIdentifier.is = is;
|
|
7263
|
-
})(VersionedTextDocumentIdentifier || (exports$10.VersionedTextDocumentIdentifier = VersionedTextDocumentIdentifier = {}));
|
|
6695
|
+
DiagnosticSeverity.Error = 1;
|
|
7264
6696
|
/**
|
|
7265
|
-
*
|
|
7266
|
-
* {@link OptionalVersionedTextDocumentIdentifier} literals.
|
|
6697
|
+
* Reports a warning.
|
|
7267
6698
|
*/
|
|
7268
|
-
|
|
7269
|
-
(function(OptionalVersionedTextDocumentIdentifier) {
|
|
7270
|
-
/**
|
|
7271
|
-
* Creates a new OptionalVersionedTextDocumentIdentifier literal.
|
|
7272
|
-
* @param uri The document's uri.
|
|
7273
|
-
* @param version The document's version.
|
|
7274
|
-
*/
|
|
7275
|
-
function create(uri, version) {
|
|
7276
|
-
return {
|
|
7277
|
-
uri,
|
|
7278
|
-
version
|
|
7279
|
-
};
|
|
7280
|
-
}
|
|
7281
|
-
OptionalVersionedTextDocumentIdentifier.create = create;
|
|
7282
|
-
/**
|
|
7283
|
-
* Checks whether the given literal conforms to the {@link OptionalVersionedTextDocumentIdentifier} interface.
|
|
7284
|
-
*/
|
|
7285
|
-
function is(value) {
|
|
7286
|
-
var candidate = value;
|
|
7287
|
-
return Is.defined(candidate) && Is.string(candidate.uri) && (candidate.version === null || Is.integer(candidate.version));
|
|
7288
|
-
}
|
|
7289
|
-
OptionalVersionedTextDocumentIdentifier.is = is;
|
|
7290
|
-
})(OptionalVersionedTextDocumentIdentifier || (exports$10.OptionalVersionedTextDocumentIdentifier = OptionalVersionedTextDocumentIdentifier = {}));
|
|
6699
|
+
DiagnosticSeverity.Warning = 2;
|
|
7291
6700
|
/**
|
|
7292
|
-
*
|
|
7293
|
-
* {@link TextDocumentItem} literals.
|
|
6701
|
+
* Reports an information.
|
|
7294
6702
|
*/
|
|
7295
|
-
|
|
7296
|
-
(function(TextDocumentItem) {
|
|
7297
|
-
/**
|
|
7298
|
-
* Creates a new TextDocumentItem literal.
|
|
7299
|
-
* @param uri The document's uri.
|
|
7300
|
-
* @param languageId The document's language identifier.
|
|
7301
|
-
* @param version The document's version number.
|
|
7302
|
-
* @param text The document's text.
|
|
7303
|
-
*/
|
|
7304
|
-
function create(uri, languageId, version, text) {
|
|
7305
|
-
return {
|
|
7306
|
-
uri,
|
|
7307
|
-
languageId,
|
|
7308
|
-
version,
|
|
7309
|
-
text
|
|
7310
|
-
};
|
|
7311
|
-
}
|
|
7312
|
-
TextDocumentItem.create = create;
|
|
7313
|
-
/**
|
|
7314
|
-
* Checks whether the given literal conforms to the {@link TextDocumentItem} interface.
|
|
7315
|
-
*/
|
|
7316
|
-
function is(value) {
|
|
7317
|
-
var candidate = value;
|
|
7318
|
-
return Is.defined(candidate) && Is.string(candidate.uri) && Is.string(candidate.languageId) && Is.integer(candidate.version) && Is.string(candidate.text);
|
|
7319
|
-
}
|
|
7320
|
-
TextDocumentItem.is = is;
|
|
7321
|
-
})(TextDocumentItem || (exports$10.TextDocumentItem = TextDocumentItem = {}));
|
|
6703
|
+
DiagnosticSeverity.Information = 3;
|
|
7322
6704
|
/**
|
|
7323
|
-
*
|
|
7324
|
-
|
|
6705
|
+
* Reports a hint.
|
|
6706
|
+
*/
|
|
6707
|
+
DiagnosticSeverity.Hint = 4;
|
|
6708
|
+
})(DiagnosticSeverity$1 || (DiagnosticSeverity$1 = {}));
|
|
6709
|
+
;
|
|
6710
|
+
(function(DiagnosticTag) {
|
|
6711
|
+
/**
|
|
6712
|
+
* Unused or unnecessary code.
|
|
7325
6713
|
*
|
|
7326
|
-
*
|
|
7327
|
-
*
|
|
6714
|
+
* Clients are allowed to render diagnostics with this tag faded out instead of having
|
|
6715
|
+
* an error squiggle.
|
|
7328
6716
|
*/
|
|
7329
|
-
|
|
7330
|
-
(function(MarkupKind) {
|
|
7331
|
-
/**
|
|
7332
|
-
* Plain text is supported as a content format
|
|
7333
|
-
*/
|
|
7334
|
-
MarkupKind.PlainText = "plaintext";
|
|
7335
|
-
/**
|
|
7336
|
-
* Markdown is supported as a content format
|
|
7337
|
-
*/
|
|
7338
|
-
MarkupKind.Markdown = "markdown";
|
|
7339
|
-
/**
|
|
7340
|
-
* Checks whether the given value is a value of the {@link MarkupKind} type.
|
|
7341
|
-
*/
|
|
7342
|
-
function is(value) {
|
|
7343
|
-
var candidate = value;
|
|
7344
|
-
return candidate === MarkupKind.PlainText || candidate === MarkupKind.Markdown;
|
|
7345
|
-
}
|
|
7346
|
-
MarkupKind.is = is;
|
|
7347
|
-
})(MarkupKind || (exports$10.MarkupKind = MarkupKind = {}));
|
|
7348
|
-
var MarkupContent;
|
|
7349
|
-
(function(MarkupContent) {
|
|
7350
|
-
/**
|
|
7351
|
-
* Checks whether the given value conforms to the {@link MarkupContent} interface.
|
|
7352
|
-
*/
|
|
7353
|
-
function is(value) {
|
|
7354
|
-
var candidate = value;
|
|
7355
|
-
return Is.objectLiteral(value) && MarkupKind.is(candidate.kind) && Is.string(candidate.value);
|
|
7356
|
-
}
|
|
7357
|
-
MarkupContent.is = is;
|
|
7358
|
-
})(MarkupContent || (exports$10.MarkupContent = MarkupContent = {}));
|
|
6717
|
+
DiagnosticTag.Unnecessary = 1;
|
|
7359
6718
|
/**
|
|
7360
|
-
*
|
|
6719
|
+
* Deprecated or obsolete code.
|
|
6720
|
+
*
|
|
6721
|
+
* Clients are allowed to rendered diagnostics with this tag strike through.
|
|
7361
6722
|
*/
|
|
7362
|
-
|
|
7363
|
-
|
|
7364
|
-
|
|
7365
|
-
|
|
7366
|
-
|
|
7367
|
-
|
|
7368
|
-
|
|
7369
|
-
|
|
7370
|
-
|
|
7371
|
-
|
|
7372
|
-
|
|
7373
|
-
|
|
7374
|
-
CompletionItemKind.Unit = 11;
|
|
7375
|
-
CompletionItemKind.Value = 12;
|
|
7376
|
-
CompletionItemKind.Enum = 13;
|
|
7377
|
-
CompletionItemKind.Keyword = 14;
|
|
7378
|
-
CompletionItemKind.Snippet = 15;
|
|
7379
|
-
CompletionItemKind.Color = 16;
|
|
7380
|
-
CompletionItemKind.File = 17;
|
|
7381
|
-
CompletionItemKind.Reference = 18;
|
|
7382
|
-
CompletionItemKind.Folder = 19;
|
|
7383
|
-
CompletionItemKind.EnumMember = 20;
|
|
7384
|
-
CompletionItemKind.Constant = 21;
|
|
7385
|
-
CompletionItemKind.Struct = 22;
|
|
7386
|
-
CompletionItemKind.Event = 23;
|
|
7387
|
-
CompletionItemKind.Operator = 24;
|
|
7388
|
-
CompletionItemKind.TypeParameter = 25;
|
|
7389
|
-
})(CompletionItemKind || (exports$10.CompletionItemKind = CompletionItemKind = {}));
|
|
6723
|
+
DiagnosticTag.Deprecated = 2;
|
|
6724
|
+
})(DiagnosticTag || (DiagnosticTag = {}));
|
|
6725
|
+
;
|
|
6726
|
+
(function(CodeDescription) {
|
|
6727
|
+
function is(value) {
|
|
6728
|
+
const candidate = value;
|
|
6729
|
+
return Is.objectLiteral(candidate) && Is.string(candidate.href);
|
|
6730
|
+
}
|
|
6731
|
+
CodeDescription.is = is;
|
|
6732
|
+
})(CodeDescription || (CodeDescription = {}));
|
|
6733
|
+
;
|
|
6734
|
+
(function(Diagnostic) {
|
|
7390
6735
|
/**
|
|
7391
|
-
*
|
|
7392
|
-
* plain text or a snippet.
|
|
6736
|
+
* Creates a new Diagnostic literal.
|
|
7393
6737
|
*/
|
|
7394
|
-
|
|
7395
|
-
|
|
7396
|
-
|
|
7397
|
-
|
|
7398
|
-
|
|
7399
|
-
|
|
7400
|
-
|
|
7401
|
-
|
|
7402
|
-
|
|
7403
|
-
|
|
7404
|
-
|
|
7405
|
-
|
|
7406
|
-
* that is typing in one will update others too.
|
|
7407
|
-
*
|
|
7408
|
-
* See also: https://microsoft.github.io/language-server-protocol/specifications/specification-current/#snippet_syntax
|
|
7409
|
-
*/
|
|
7410
|
-
InsertTextFormat.Snippet = 2;
|
|
7411
|
-
})(InsertTextFormat || (exports$10.InsertTextFormat = InsertTextFormat = {}));
|
|
6738
|
+
function create(range, message, severity, code, source, relatedInformation) {
|
|
6739
|
+
const result = {
|
|
6740
|
+
range,
|
|
6741
|
+
message
|
|
6742
|
+
};
|
|
6743
|
+
if (Is.defined(severity)) result.severity = severity;
|
|
6744
|
+
if (Is.defined(code)) result.code = code;
|
|
6745
|
+
if (Is.defined(source)) result.source = source;
|
|
6746
|
+
if (Is.defined(relatedInformation)) result.relatedInformation = relatedInformation;
|
|
6747
|
+
return result;
|
|
6748
|
+
}
|
|
6749
|
+
Diagnostic.create = create;
|
|
7412
6750
|
/**
|
|
7413
|
-
*
|
|
7414
|
-
* item.
|
|
7415
|
-
*
|
|
7416
|
-
* @since 3.15.0
|
|
6751
|
+
* Checks whether the given literal conforms to the {@link Diagnostic} interface.
|
|
7417
6752
|
*/
|
|
7418
|
-
|
|
7419
|
-
|
|
7420
|
-
|
|
7421
|
-
|
|
7422
|
-
|
|
7423
|
-
|
|
7424
|
-
})(CompletionItemTag || (exports$10.CompletionItemTag = CompletionItemTag = {}));
|
|
6753
|
+
function is(value) {
|
|
6754
|
+
var _a;
|
|
6755
|
+
const candidate = value;
|
|
6756
|
+
return Is.defined(candidate) && Range.is(candidate.range) && (Is.string(candidate.message) || MarkupContent.is(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));
|
|
6757
|
+
}
|
|
6758
|
+
Diagnostic.is = is;
|
|
7425
6759
|
/**
|
|
7426
|
-
*
|
|
6760
|
+
* Checks whether the given diagnostic's message conforms to the 3.17.0
|
|
6761
|
+
* version of the protocol where the message is a string.
|
|
7427
6762
|
*
|
|
7428
|
-
* @
|
|
6763
|
+
* @param value the diagnostic
|
|
6764
|
+
* @returns true if the diagnostic's message is a string, false otherwise.
|
|
7429
6765
|
*/
|
|
7430
|
-
|
|
7431
|
-
|
|
7432
|
-
|
|
7433
|
-
|
|
7434
|
-
*/
|
|
7435
|
-
function create(newText, insert, replace) {
|
|
7436
|
-
return {
|
|
7437
|
-
newText,
|
|
7438
|
-
insert,
|
|
7439
|
-
replace
|
|
7440
|
-
};
|
|
7441
|
-
}
|
|
7442
|
-
InsertReplaceEdit.create = create;
|
|
7443
|
-
/**
|
|
7444
|
-
* Checks whether the given literal conforms to the {@link InsertReplaceEdit} interface.
|
|
7445
|
-
*/
|
|
7446
|
-
function is(value) {
|
|
7447
|
-
var candidate = value;
|
|
7448
|
-
return candidate && Is.string(candidate.newText) && Range.is(candidate.insert) && Range.is(candidate.replace);
|
|
7449
|
-
}
|
|
7450
|
-
InsertReplaceEdit.is = is;
|
|
7451
|
-
})(InsertReplaceEdit || (exports$10.InsertReplaceEdit = InsertReplaceEdit = {}));
|
|
6766
|
+
function is3_17(value) {
|
|
6767
|
+
return Is.string(value.message);
|
|
6768
|
+
}
|
|
6769
|
+
Diagnostic.is3_17 = is3_17;
|
|
7452
6770
|
/**
|
|
7453
|
-
*
|
|
7454
|
-
*
|
|
6771
|
+
* Gets the message string of a diagnostic. If the message is already a
|
|
6772
|
+
* string, it is returned as is. If the message is a MarkupContent,
|
|
6773
|
+
* the value of the MarkupContent is returned. Otherwise an error is thrown.
|
|
7455
6774
|
*
|
|
7456
|
-
* @
|
|
6775
|
+
* @param diagnostic the diagnostic to get the message string from.
|
|
6776
|
+
* @returns the message string of the given diagnostic.
|
|
7457
6777
|
*/
|
|
7458
|
-
|
|
7459
|
-
|
|
7460
|
-
|
|
7461
|
-
|
|
7462
|
-
|
|
7463
|
-
|
|
7464
|
-
|
|
7465
|
-
|
|
7466
|
-
|
|
7467
|
-
InsertTextMode.asIs = 1;
|
|
7468
|
-
/**
|
|
7469
|
-
* The editor adjusts leading whitespace of new lines so that
|
|
7470
|
-
* they match the indentation up to the cursor of the line for
|
|
7471
|
-
* which the item is accepted.
|
|
7472
|
-
*
|
|
7473
|
-
* Consider a line like this: <2tabs><cursor><3tabs>foo. Accepting a
|
|
7474
|
-
* multi line completion item is indented using 2 tabs and all
|
|
7475
|
-
* following lines inserted will be indented using 2 tabs as well.
|
|
7476
|
-
*/
|
|
7477
|
-
InsertTextMode.adjustIndentation = 2;
|
|
7478
|
-
})(InsertTextMode || (exports$10.InsertTextMode = InsertTextMode = {}));
|
|
7479
|
-
var CompletionItemLabelDetails;
|
|
7480
|
-
(function(CompletionItemLabelDetails) {
|
|
7481
|
-
function is(value) {
|
|
7482
|
-
var candidate = value;
|
|
7483
|
-
return candidate && (Is.string(candidate.detail) || candidate.detail === void 0) && (Is.string(candidate.description) || candidate.description === void 0);
|
|
7484
|
-
}
|
|
7485
|
-
CompletionItemLabelDetails.is = is;
|
|
7486
|
-
})(CompletionItemLabelDetails || (exports$10.CompletionItemLabelDetails = CompletionItemLabelDetails = {}));
|
|
6778
|
+
function getMessageString(diagnostic) {
|
|
6779
|
+
if (Is.string(diagnostic.message)) return diagnostic.message;
|
|
6780
|
+
else if (MarkupContent.is(diagnostic.message)) return diagnostic.message.value;
|
|
6781
|
+
else throw new Error(`Unknown message type ${typeof diagnostic.message}`);
|
|
6782
|
+
}
|
|
6783
|
+
Diagnostic.getMessageString = getMessageString;
|
|
6784
|
+
})(Diagnostic || (Diagnostic = {}));
|
|
6785
|
+
;
|
|
6786
|
+
(function(Command) {
|
|
7487
6787
|
/**
|
|
7488
|
-
*
|
|
7489
|
-
* completion items.
|
|
6788
|
+
* Creates a new Command literal.
|
|
7490
6789
|
*/
|
|
7491
|
-
|
|
7492
|
-
|
|
7493
|
-
|
|
7494
|
-
|
|
7495
|
-
|
|
7496
|
-
|
|
7497
|
-
|
|
7498
|
-
|
|
7499
|
-
|
|
7500
|
-
CompletionItem.create = create;
|
|
7501
|
-
})(CompletionItem || (exports$10.CompletionItem = CompletionItem = {}));
|
|
6790
|
+
function create(title, command, ...args) {
|
|
6791
|
+
const result = {
|
|
6792
|
+
title,
|
|
6793
|
+
command
|
|
6794
|
+
};
|
|
6795
|
+
if (Is.defined(args) && args.length > 0) result.arguments = args;
|
|
6796
|
+
return result;
|
|
6797
|
+
}
|
|
6798
|
+
Command.create = create;
|
|
7502
6799
|
/**
|
|
7503
|
-
*
|
|
7504
|
-
* completion lists.
|
|
6800
|
+
* Checks whether the given literal conforms to the {@link Command} interface.
|
|
7505
6801
|
*/
|
|
7506
|
-
|
|
7507
|
-
|
|
7508
|
-
|
|
7509
|
-
|
|
7510
|
-
|
|
7511
|
-
|
|
7512
|
-
|
|
7513
|
-
|
|
7514
|
-
function create(items, isIncomplete) {
|
|
7515
|
-
return {
|
|
7516
|
-
items: items ? items : [],
|
|
7517
|
-
isIncomplete: !!isIncomplete
|
|
7518
|
-
};
|
|
7519
|
-
}
|
|
7520
|
-
CompletionList.create = create;
|
|
7521
|
-
})(CompletionList || (exports$10.CompletionList = CompletionList = {}));
|
|
7522
|
-
var MarkedString;
|
|
7523
|
-
(function(MarkedString) {
|
|
7524
|
-
/**
|
|
7525
|
-
* Creates a marked string from plain text.
|
|
7526
|
-
*
|
|
7527
|
-
* @param plainText The plain text.
|
|
7528
|
-
*/
|
|
7529
|
-
function fromPlainText(plainText) {
|
|
7530
|
-
return plainText.replace(/[\\`*_{}[\]()#+\-.!]/g, "\\$&");
|
|
7531
|
-
}
|
|
7532
|
-
MarkedString.fromPlainText = fromPlainText;
|
|
7533
|
-
/**
|
|
7534
|
-
* Checks whether the given value conforms to the {@link MarkedString} type.
|
|
7535
|
-
*/
|
|
7536
|
-
function is(value) {
|
|
7537
|
-
var candidate = value;
|
|
7538
|
-
return Is.string(candidate) || Is.objectLiteral(candidate) && Is.string(candidate.language) && Is.string(candidate.value);
|
|
7539
|
-
}
|
|
7540
|
-
MarkedString.is = is;
|
|
7541
|
-
})(MarkedString || (exports$10.MarkedString = MarkedString = {}));
|
|
7542
|
-
var Hover;
|
|
7543
|
-
(function(Hover) {
|
|
7544
|
-
/**
|
|
7545
|
-
* Checks whether the given value conforms to the {@link Hover} interface.
|
|
7546
|
-
*/
|
|
7547
|
-
function is(value) {
|
|
7548
|
-
var candidate = value;
|
|
7549
|
-
return !!candidate && Is.objectLiteral(candidate) && (MarkupContent.is(candidate.contents) || MarkedString.is(candidate.contents) || Is.typedArray(candidate.contents, MarkedString.is)) && (value.range === void 0 || Range.is(value.range));
|
|
7550
|
-
}
|
|
7551
|
-
Hover.is = is;
|
|
7552
|
-
})(Hover || (exports$10.Hover = Hover = {}));
|
|
6802
|
+
function is(value) {
|
|
6803
|
+
const candidate = value;
|
|
6804
|
+
return Is.defined(candidate) && Is.string(candidate.title) && (candidate.tooltip === void 0 || Is.string(candidate.tooltip)) && Is.string(candidate.command);
|
|
6805
|
+
}
|
|
6806
|
+
Command.is = is;
|
|
6807
|
+
})(Command || (Command = {}));
|
|
6808
|
+
;
|
|
6809
|
+
(function(TextEdit) {
|
|
7553
6810
|
/**
|
|
7554
|
-
*
|
|
7555
|
-
*
|
|
6811
|
+
* Creates a replace text edit.
|
|
6812
|
+
* @param range The range of text to be replaced.
|
|
6813
|
+
* @param newText The new text.
|
|
7556
6814
|
*/
|
|
7557
|
-
|
|
7558
|
-
|
|
7559
|
-
|
|
7560
|
-
|
|
7561
|
-
|
|
7562
|
-
|
|
7563
|
-
|
|
7564
|
-
*/
|
|
7565
|
-
function create(label, documentation) {
|
|
7566
|
-
return documentation ? {
|
|
7567
|
-
label,
|
|
7568
|
-
documentation
|
|
7569
|
-
} : { label };
|
|
7570
|
-
}
|
|
7571
|
-
ParameterInformation.create = create;
|
|
7572
|
-
})(ParameterInformation || (exports$10.ParameterInformation = ParameterInformation = {}));
|
|
6815
|
+
function replace(range, newText) {
|
|
6816
|
+
return {
|
|
6817
|
+
range,
|
|
6818
|
+
newText
|
|
6819
|
+
};
|
|
6820
|
+
}
|
|
6821
|
+
TextEdit.replace = replace;
|
|
7573
6822
|
/**
|
|
7574
|
-
*
|
|
7575
|
-
*
|
|
6823
|
+
* Creates an insert text edit.
|
|
6824
|
+
* @param position The position to insert the text at.
|
|
6825
|
+
* @param newText The text to be inserted.
|
|
7576
6826
|
*/
|
|
7577
|
-
|
|
7578
|
-
|
|
7579
|
-
|
|
7580
|
-
|
|
7581
|
-
|
|
7582
|
-
|
|
7583
|
-
|
|
7584
|
-
|
|
7585
|
-
|
|
7586
|
-
|
|
7587
|
-
}
|
|
7588
|
-
SignatureInformation.create = create;
|
|
7589
|
-
})(SignatureInformation || (exports$10.SignatureInformation = SignatureInformation = {}));
|
|
6827
|
+
function insert(position, newText) {
|
|
6828
|
+
return {
|
|
6829
|
+
range: {
|
|
6830
|
+
start: position,
|
|
6831
|
+
end: position
|
|
6832
|
+
},
|
|
6833
|
+
newText
|
|
6834
|
+
};
|
|
6835
|
+
}
|
|
6836
|
+
TextEdit.insert = insert;
|
|
7590
6837
|
/**
|
|
7591
|
-
*
|
|
6838
|
+
* Creates a delete text edit.
|
|
6839
|
+
* @param range The range of text to be deleted.
|
|
7592
6840
|
*/
|
|
7593
|
-
|
|
7594
|
-
|
|
7595
|
-
|
|
7596
|
-
|
|
7597
|
-
|
|
7598
|
-
|
|
7599
|
-
|
|
7600
|
-
|
|
7601
|
-
|
|
7602
|
-
|
|
7603
|
-
|
|
7604
|
-
|
|
7605
|
-
|
|
7606
|
-
|
|
7607
|
-
|
|
6841
|
+
function del(range) {
|
|
6842
|
+
return {
|
|
6843
|
+
range,
|
|
6844
|
+
newText: ""
|
|
6845
|
+
};
|
|
6846
|
+
}
|
|
6847
|
+
TextEdit.del = del;
|
|
6848
|
+
function is(value) {
|
|
6849
|
+
const candidate = value;
|
|
6850
|
+
return Is.objectLiteral(candidate) && Is.string(candidate.newText) && Range.is(candidate.range);
|
|
6851
|
+
}
|
|
6852
|
+
TextEdit.is = is;
|
|
6853
|
+
})(TextEdit || (TextEdit = {}));
|
|
6854
|
+
;
|
|
6855
|
+
(function(ChangeAnnotation) {
|
|
6856
|
+
function create(label, needsConfirmation, description) {
|
|
6857
|
+
const result = { label };
|
|
6858
|
+
if (needsConfirmation !== void 0) result.needsConfirmation = needsConfirmation;
|
|
6859
|
+
if (description !== void 0) result.description = description;
|
|
6860
|
+
return result;
|
|
6861
|
+
}
|
|
6862
|
+
ChangeAnnotation.create = create;
|
|
6863
|
+
function is(value) {
|
|
6864
|
+
const candidate = value;
|
|
6865
|
+
return Is.objectLiteral(candidate) && Is.string(candidate.label) && (Is.boolean(candidate.needsConfirmation) || candidate.needsConfirmation === void 0) && (Is.string(candidate.description) || candidate.description === void 0);
|
|
6866
|
+
}
|
|
6867
|
+
ChangeAnnotation.is = is;
|
|
6868
|
+
})(ChangeAnnotation || (ChangeAnnotation = {}));
|
|
6869
|
+
;
|
|
6870
|
+
(function(ChangeAnnotationIdentifier) {
|
|
6871
|
+
function is(value) {
|
|
6872
|
+
const candidate = value;
|
|
6873
|
+
return Is.string(candidate);
|
|
6874
|
+
}
|
|
6875
|
+
ChangeAnnotationIdentifier.is = is;
|
|
6876
|
+
})(ChangeAnnotationIdentifier || (ChangeAnnotationIdentifier = {}));
|
|
6877
|
+
;
|
|
6878
|
+
(function(AnnotatedTextEdit) {
|
|
7608
6879
|
/**
|
|
7609
|
-
*
|
|
7610
|
-
*
|
|
6880
|
+
* Creates an annotated replace text edit.
|
|
6881
|
+
*
|
|
6882
|
+
* @param range The range of text to be replaced.
|
|
6883
|
+
* @param newText The new text.
|
|
6884
|
+
* @param annotation The annotation.
|
|
7611
6885
|
*/
|
|
7612
|
-
|
|
7613
|
-
|
|
7614
|
-
|
|
7615
|
-
|
|
7616
|
-
|
|
7617
|
-
|
|
7618
|
-
|
|
7619
|
-
|
|
7620
|
-
var result = { range };
|
|
7621
|
-
if (Is.number(kind)) result.kind = kind;
|
|
7622
|
-
return result;
|
|
7623
|
-
}
|
|
7624
|
-
DocumentHighlight.create = create;
|
|
7625
|
-
})(DocumentHighlight || (exports$10.DocumentHighlight = DocumentHighlight = {}));
|
|
6886
|
+
function replace(range, newText, annotation) {
|
|
6887
|
+
return {
|
|
6888
|
+
range,
|
|
6889
|
+
newText,
|
|
6890
|
+
annotationId: annotation
|
|
6891
|
+
};
|
|
6892
|
+
}
|
|
6893
|
+
AnnotatedTextEdit.replace = replace;
|
|
7626
6894
|
/**
|
|
7627
|
-
*
|
|
6895
|
+
* Creates an annotated insert text edit.
|
|
6896
|
+
*
|
|
6897
|
+
* @param position The position to insert the text at.
|
|
6898
|
+
* @param newText The text to be inserted.
|
|
6899
|
+
* @param annotation The annotation.
|
|
7628
6900
|
*/
|
|
7629
|
-
|
|
7630
|
-
|
|
7631
|
-
|
|
7632
|
-
|
|
7633
|
-
|
|
7634
|
-
|
|
7635
|
-
|
|
7636
|
-
|
|
7637
|
-
|
|
7638
|
-
|
|
7639
|
-
|
|
7640
|
-
SymbolKind.Enum = 10;
|
|
7641
|
-
SymbolKind.Interface = 11;
|
|
7642
|
-
SymbolKind.Function = 12;
|
|
7643
|
-
SymbolKind.Variable = 13;
|
|
7644
|
-
SymbolKind.Constant = 14;
|
|
7645
|
-
SymbolKind.String = 15;
|
|
7646
|
-
SymbolKind.Number = 16;
|
|
7647
|
-
SymbolKind.Boolean = 17;
|
|
7648
|
-
SymbolKind.Array = 18;
|
|
7649
|
-
SymbolKind.Object = 19;
|
|
7650
|
-
SymbolKind.Key = 20;
|
|
7651
|
-
SymbolKind.Null = 21;
|
|
7652
|
-
SymbolKind.EnumMember = 22;
|
|
7653
|
-
SymbolKind.Struct = 23;
|
|
7654
|
-
SymbolKind.Event = 24;
|
|
7655
|
-
SymbolKind.Operator = 25;
|
|
7656
|
-
SymbolKind.TypeParameter = 26;
|
|
7657
|
-
})(SymbolKind || (exports$10.SymbolKind = SymbolKind = {}));
|
|
6901
|
+
function insert(position, newText, annotation) {
|
|
6902
|
+
return {
|
|
6903
|
+
range: {
|
|
6904
|
+
start: position,
|
|
6905
|
+
end: position
|
|
6906
|
+
},
|
|
6907
|
+
newText,
|
|
6908
|
+
annotationId: annotation
|
|
6909
|
+
};
|
|
6910
|
+
}
|
|
6911
|
+
AnnotatedTextEdit.insert = insert;
|
|
7658
6912
|
/**
|
|
7659
|
-
*
|
|
6913
|
+
* Creates an annotated delete text edit.
|
|
7660
6914
|
*
|
|
7661
|
-
* @
|
|
6915
|
+
* @param range The range of text to be deleted.
|
|
6916
|
+
* @param annotation The annotation.
|
|
7662
6917
|
*/
|
|
7663
|
-
|
|
7664
|
-
|
|
7665
|
-
|
|
7666
|
-
|
|
7667
|
-
|
|
7668
|
-
|
|
7669
|
-
}
|
|
7670
|
-
|
|
7671
|
-
|
|
7672
|
-
|
|
7673
|
-
|
|
7674
|
-
|
|
7675
|
-
|
|
7676
|
-
|
|
7677
|
-
|
|
7678
|
-
|
|
7679
|
-
|
|
7680
|
-
|
|
7681
|
-
|
|
7682
|
-
|
|
7683
|
-
|
|
7684
|
-
|
|
7685
|
-
|
|
7686
|
-
|
|
7687
|
-
|
|
7688
|
-
|
|
7689
|
-
|
|
7690
|
-
|
|
7691
|
-
|
|
7692
|
-
|
|
7693
|
-
|
|
7694
|
-
|
|
7695
|
-
|
|
7696
|
-
|
|
7697
|
-
|
|
7698
|
-
|
|
7699
|
-
|
|
7700
|
-
|
|
7701
|
-
|
|
7702
|
-
|
|
7703
|
-
|
|
7704
|
-
|
|
7705
|
-
|
|
7706
|
-
|
|
7707
|
-
|
|
7708
|
-
|
|
7709
|
-
|
|
7710
|
-
|
|
7711
|
-
|
|
7712
|
-
|
|
7713
|
-
|
|
7714
|
-
|
|
7715
|
-
|
|
7716
|
-
|
|
7717
|
-
|
|
7718
|
-
|
|
7719
|
-
|
|
7720
|
-
|
|
7721
|
-
|
|
7722
|
-
|
|
7723
|
-
|
|
7724
|
-
|
|
7725
|
-
|
|
7726
|
-
|
|
7727
|
-
|
|
7728
|
-
|
|
7729
|
-
|
|
7730
|
-
|
|
7731
|
-
|
|
7732
|
-
|
|
7733
|
-
|
|
7734
|
-
|
|
7735
|
-
|
|
7736
|
-
|
|
7737
|
-
|
|
7738
|
-
|
|
7739
|
-
|
|
7740
|
-
|
|
7741
|
-
|
|
7742
|
-
|
|
7743
|
-
|
|
7744
|
-
|
|
7745
|
-
|
|
7746
|
-
|
|
7747
|
-
|
|
7748
|
-
|
|
7749
|
-
|
|
7750
|
-
|
|
7751
|
-
|
|
7752
|
-
|
|
7753
|
-
|
|
7754
|
-
|
|
6918
|
+
function del(range, annotation) {
|
|
6919
|
+
return {
|
|
6920
|
+
range,
|
|
6921
|
+
newText: "",
|
|
6922
|
+
annotationId: annotation
|
|
6923
|
+
};
|
|
6924
|
+
}
|
|
6925
|
+
AnnotatedTextEdit.del = del;
|
|
6926
|
+
function is(value) {
|
|
6927
|
+
const candidate = value;
|
|
6928
|
+
return TextEdit.is(candidate) && (ChangeAnnotation.is(candidate.annotationId) || ChangeAnnotationIdentifier.is(candidate.annotationId));
|
|
6929
|
+
}
|
|
6930
|
+
AnnotatedTextEdit.is = is;
|
|
6931
|
+
})(AnnotatedTextEdit || (AnnotatedTextEdit = {}));
|
|
6932
|
+
;
|
|
6933
|
+
(function(TextDocumentEdit) {
|
|
6934
|
+
/**
|
|
6935
|
+
* Creates a new `TextDocumentEdit`
|
|
6936
|
+
*/
|
|
6937
|
+
function create(textDocument, edits) {
|
|
6938
|
+
return {
|
|
6939
|
+
textDocument,
|
|
6940
|
+
edits
|
|
6941
|
+
};
|
|
6942
|
+
}
|
|
6943
|
+
TextDocumentEdit.create = create;
|
|
6944
|
+
function is(value) {
|
|
6945
|
+
const candidate = value;
|
|
6946
|
+
return Is.defined(candidate) && OptionalVersionedTextDocumentIdentifier.is(candidate.textDocument) && Array.isArray(candidate.edits);
|
|
6947
|
+
}
|
|
6948
|
+
TextDocumentEdit.is = is;
|
|
6949
|
+
})(TextDocumentEdit || (TextDocumentEdit = {}));
|
|
6950
|
+
;
|
|
6951
|
+
(function(CreateFile) {
|
|
6952
|
+
function create(uri, options, annotation) {
|
|
6953
|
+
const result = {
|
|
6954
|
+
kind: "create",
|
|
6955
|
+
uri
|
|
6956
|
+
};
|
|
6957
|
+
if (options !== void 0 && (options.overwrite !== void 0 || options.ignoreIfExists !== void 0)) result.options = options;
|
|
6958
|
+
if (annotation !== void 0) result.annotationId = annotation;
|
|
6959
|
+
return result;
|
|
6960
|
+
}
|
|
6961
|
+
CreateFile.create = create;
|
|
6962
|
+
function is(value) {
|
|
6963
|
+
const candidate = value;
|
|
6964
|
+
return candidate && candidate.kind === "create" && Is.string(candidate.uri) && (candidate.options === void 0 || (candidate.options.overwrite === void 0 || Is.boolean(candidate.options.overwrite)) && (candidate.options.ignoreIfExists === void 0 || Is.boolean(candidate.options.ignoreIfExists))) && (candidate.annotationId === void 0 || ChangeAnnotationIdentifier.is(candidate.annotationId));
|
|
6965
|
+
}
|
|
6966
|
+
CreateFile.is = is;
|
|
6967
|
+
})(CreateFile || (CreateFile = {}));
|
|
6968
|
+
;
|
|
6969
|
+
(function(RenameFile) {
|
|
6970
|
+
function create(oldUri, newUri, options, annotation) {
|
|
6971
|
+
const result = {
|
|
6972
|
+
kind: "rename",
|
|
6973
|
+
oldUri,
|
|
6974
|
+
newUri
|
|
6975
|
+
};
|
|
6976
|
+
if (options !== void 0 && (options.overwrite !== void 0 || options.ignoreIfExists !== void 0)) result.options = options;
|
|
6977
|
+
if (annotation !== void 0) result.annotationId = annotation;
|
|
6978
|
+
return result;
|
|
6979
|
+
}
|
|
6980
|
+
RenameFile.create = create;
|
|
6981
|
+
function is(value) {
|
|
6982
|
+
const candidate = value;
|
|
6983
|
+
return candidate && candidate.kind === "rename" && Is.string(candidate.oldUri) && Is.string(candidate.newUri) && (candidate.options === void 0 || (candidate.options.overwrite === void 0 || Is.boolean(candidate.options.overwrite)) && (candidate.options.ignoreIfExists === void 0 || Is.boolean(candidate.options.ignoreIfExists))) && (candidate.annotationId === void 0 || ChangeAnnotationIdentifier.is(candidate.annotationId));
|
|
6984
|
+
}
|
|
6985
|
+
RenameFile.is = is;
|
|
6986
|
+
})(RenameFile || (RenameFile = {}));
|
|
6987
|
+
;
|
|
6988
|
+
(function(DeleteFile) {
|
|
6989
|
+
function create(uri, options, annotation) {
|
|
6990
|
+
const result = {
|
|
6991
|
+
kind: "delete",
|
|
6992
|
+
uri
|
|
6993
|
+
};
|
|
6994
|
+
if (options !== void 0 && (options.recursive !== void 0 || options.ignoreIfNotExists !== void 0)) result.options = options;
|
|
6995
|
+
if (annotation !== void 0) result.annotationId = annotation;
|
|
6996
|
+
return result;
|
|
6997
|
+
}
|
|
6998
|
+
DeleteFile.create = create;
|
|
6999
|
+
function is(value) {
|
|
7000
|
+
const candidate = value;
|
|
7001
|
+
return candidate && candidate.kind === "delete" && Is.string(candidate.uri) && (candidate.options === void 0 || (candidate.options.recursive === void 0 || Is.boolean(candidate.options.recursive)) && (candidate.options.ignoreIfNotExists === void 0 || Is.boolean(candidate.options.ignoreIfNotExists))) && (candidate.annotationId === void 0 || ChangeAnnotationIdentifier.is(candidate.annotationId));
|
|
7002
|
+
}
|
|
7003
|
+
DeleteFile.is = is;
|
|
7004
|
+
})(DeleteFile || (DeleteFile = {}));
|
|
7005
|
+
;
|
|
7006
|
+
(function(WorkspaceEdit) {
|
|
7007
|
+
function is(value) {
|
|
7008
|
+
const candidate = value;
|
|
7009
|
+
return candidate && (candidate.changes !== void 0 || candidate.documentChanges !== void 0) && (candidate.documentChanges === void 0 || candidate.documentChanges.every((change) => {
|
|
7010
|
+
if (Is.string(change.kind)) return CreateFile.is(change) || RenameFile.is(change) || DeleteFile.is(change);
|
|
7011
|
+
else return TextDocumentEdit.is(change);
|
|
7012
|
+
}));
|
|
7013
|
+
}
|
|
7014
|
+
WorkspaceEdit.is = is;
|
|
7015
|
+
})(WorkspaceEdit || (WorkspaceEdit = {}));
|
|
7016
|
+
TextEditChangeImpl = class {
|
|
7017
|
+
constructor(edits, changeAnnotations) {
|
|
7018
|
+
this.edits = edits;
|
|
7019
|
+
this.changeAnnotations = changeAnnotations;
|
|
7020
|
+
}
|
|
7021
|
+
insert(position, newText, annotation) {
|
|
7022
|
+
let edit;
|
|
7023
|
+
let id;
|
|
7024
|
+
if (annotation === void 0) edit = TextEdit.insert(position, newText);
|
|
7025
|
+
else if (ChangeAnnotationIdentifier.is(annotation)) {
|
|
7026
|
+
id = annotation;
|
|
7027
|
+
edit = AnnotatedTextEdit.insert(position, newText, annotation);
|
|
7028
|
+
} else {
|
|
7029
|
+
this.assertChangeAnnotations(this.changeAnnotations);
|
|
7030
|
+
id = this.changeAnnotations.manage(annotation);
|
|
7031
|
+
edit = AnnotatedTextEdit.insert(position, newText, id);
|
|
7032
|
+
}
|
|
7033
|
+
this.edits.push(edit);
|
|
7034
|
+
if (id !== void 0) return id;
|
|
7035
|
+
}
|
|
7036
|
+
replace(range, newText, annotation) {
|
|
7037
|
+
let edit;
|
|
7038
|
+
let id;
|
|
7039
|
+
if (annotation === void 0) edit = TextEdit.replace(range, newText);
|
|
7040
|
+
else if (ChangeAnnotationIdentifier.is(annotation)) {
|
|
7041
|
+
id = annotation;
|
|
7042
|
+
edit = AnnotatedTextEdit.replace(range, newText, annotation);
|
|
7043
|
+
} else {
|
|
7044
|
+
this.assertChangeAnnotations(this.changeAnnotations);
|
|
7045
|
+
id = this.changeAnnotations.manage(annotation);
|
|
7046
|
+
edit = AnnotatedTextEdit.replace(range, newText, id);
|
|
7047
|
+
}
|
|
7048
|
+
this.edits.push(edit);
|
|
7049
|
+
if (id !== void 0) return id;
|
|
7050
|
+
}
|
|
7051
|
+
delete(range, annotation) {
|
|
7052
|
+
let edit;
|
|
7053
|
+
let id;
|
|
7054
|
+
if (annotation === void 0) edit = TextEdit.del(range);
|
|
7055
|
+
else if (ChangeAnnotationIdentifier.is(annotation)) {
|
|
7056
|
+
id = annotation;
|
|
7057
|
+
edit = AnnotatedTextEdit.del(range, annotation);
|
|
7058
|
+
} else {
|
|
7059
|
+
this.assertChangeAnnotations(this.changeAnnotations);
|
|
7060
|
+
id = this.changeAnnotations.manage(annotation);
|
|
7061
|
+
edit = AnnotatedTextEdit.del(range, id);
|
|
7062
|
+
}
|
|
7063
|
+
this.edits.push(edit);
|
|
7064
|
+
if (id !== void 0) return id;
|
|
7065
|
+
}
|
|
7066
|
+
add(edit) {
|
|
7067
|
+
this.edits.push(edit);
|
|
7068
|
+
}
|
|
7069
|
+
all() {
|
|
7070
|
+
return this.edits;
|
|
7071
|
+
}
|
|
7072
|
+
clear() {
|
|
7073
|
+
this.edits.splice(0, this.edits.length);
|
|
7074
|
+
}
|
|
7075
|
+
assertChangeAnnotations(value) {
|
|
7076
|
+
if (value === void 0) throw new Error(`Text edit change is not configured to manage change annotations.`);
|
|
7077
|
+
}
|
|
7078
|
+
};
|
|
7079
|
+
;
|
|
7080
|
+
(function(SnippetTextEdit) {
|
|
7081
|
+
function is(value) {
|
|
7082
|
+
const candidate = value;
|
|
7083
|
+
return Is.objectLiteral(candidate) && Range.is(candidate.range) && StringValue.isSnippet(candidate.snippet) && (candidate.annotationId === void 0 || ChangeAnnotation.is(candidate.annotationId) || ChangeAnnotationIdentifier.is(candidate.annotationId));
|
|
7084
|
+
}
|
|
7085
|
+
SnippetTextEdit.is = is;
|
|
7086
|
+
})(SnippetTextEdit || (SnippetTextEdit = {}));
|
|
7087
|
+
ChangeAnnotations = class {
|
|
7088
|
+
constructor(annotations) {
|
|
7089
|
+
this._annotations = annotations === void 0 ? Object.create(null) : annotations;
|
|
7090
|
+
this._counter = 0;
|
|
7091
|
+
this._size = 0;
|
|
7092
|
+
}
|
|
7093
|
+
all() {
|
|
7094
|
+
return this._annotations;
|
|
7095
|
+
}
|
|
7096
|
+
get size() {
|
|
7097
|
+
return this._size;
|
|
7098
|
+
}
|
|
7099
|
+
manage(idOrAnnotation, annotation) {
|
|
7100
|
+
let id;
|
|
7101
|
+
if (ChangeAnnotationIdentifier.is(idOrAnnotation)) id = idOrAnnotation;
|
|
7102
|
+
else {
|
|
7103
|
+
id = this.nextId();
|
|
7104
|
+
annotation = idOrAnnotation;
|
|
7105
|
+
}
|
|
7106
|
+
if (this._annotations[id] !== void 0) throw new Error(`Id ${id} is already in use.`);
|
|
7107
|
+
if (annotation === void 0) throw new Error(`No annotation provided for id ${id}`);
|
|
7108
|
+
this._annotations[id] = annotation;
|
|
7109
|
+
this._size++;
|
|
7110
|
+
return id;
|
|
7111
|
+
}
|
|
7112
|
+
nextId() {
|
|
7113
|
+
this._counter++;
|
|
7114
|
+
return this._counter.toString();
|
|
7115
|
+
}
|
|
7116
|
+
};
|
|
7117
|
+
WorkspaceChange = class {
|
|
7118
|
+
constructor(workspaceEdit) {
|
|
7119
|
+
this._textEditChanges = Object.create(null);
|
|
7120
|
+
if (workspaceEdit !== void 0) {
|
|
7121
|
+
this._workspaceEdit = workspaceEdit;
|
|
7122
|
+
if (workspaceEdit.documentChanges) {
|
|
7123
|
+
this._changeAnnotations = new ChangeAnnotations(workspaceEdit.changeAnnotations);
|
|
7124
|
+
workspaceEdit.changeAnnotations = this._changeAnnotations.all();
|
|
7125
|
+
workspaceEdit.documentChanges.forEach((change) => {
|
|
7126
|
+
if (TextDocumentEdit.is(change)) {
|
|
7127
|
+
const textEditChange = new TextEditChangeImpl(change.edits, this._changeAnnotations);
|
|
7128
|
+
this._textEditChanges[change.textDocument.uri] = textEditChange;
|
|
7129
|
+
}
|
|
7130
|
+
});
|
|
7131
|
+
} else if (workspaceEdit.changes) Object.keys(workspaceEdit.changes).forEach((key) => {
|
|
7132
|
+
const textEditChange = new TextEditChangeImpl(workspaceEdit.changes[key]);
|
|
7133
|
+
this._textEditChanges[key] = textEditChange;
|
|
7134
|
+
});
|
|
7135
|
+
} else this._workspaceEdit = {};
|
|
7136
|
+
}
|
|
7137
|
+
/**
|
|
7138
|
+
* Returns the underlying {@link WorkspaceEdit} literal
|
|
7139
|
+
* use to be returned from a workspace edit operation like rename.
|
|
7140
|
+
*/
|
|
7141
|
+
get edit() {
|
|
7142
|
+
this.initDocumentChanges();
|
|
7143
|
+
if (this._changeAnnotations !== void 0) {
|
|
7144
|
+
if (this._changeAnnotations.size === 0) this._workspaceEdit.changeAnnotations = void 0;
|
|
7145
|
+
else this._workspaceEdit.changeAnnotations = this._changeAnnotations.all();
|
|
7146
|
+
}
|
|
7147
|
+
return this._workspaceEdit;
|
|
7148
|
+
}
|
|
7149
|
+
getTextEditChange(key) {
|
|
7150
|
+
if (OptionalVersionedTextDocumentIdentifier.is(key)) {
|
|
7151
|
+
this.initDocumentChanges();
|
|
7152
|
+
if (this._workspaceEdit.documentChanges === void 0) throw new Error("Workspace edit is not configured for document changes.");
|
|
7153
|
+
const textDocument = {
|
|
7154
|
+
uri: key.uri,
|
|
7155
|
+
version: key.version
|
|
7156
|
+
};
|
|
7157
|
+
let result = this._textEditChanges[textDocument.uri];
|
|
7158
|
+
if (!result) {
|
|
7159
|
+
const edits = [];
|
|
7160
|
+
const textDocumentEdit = {
|
|
7161
|
+
textDocument,
|
|
7162
|
+
edits
|
|
7163
|
+
};
|
|
7164
|
+
this._workspaceEdit.documentChanges.push(textDocumentEdit);
|
|
7165
|
+
result = new TextEditChangeImpl(edits, this._changeAnnotations);
|
|
7166
|
+
this._textEditChanges[textDocument.uri] = result;
|
|
7167
|
+
}
|
|
7168
|
+
return result;
|
|
7169
|
+
} else {
|
|
7170
|
+
this.initChanges();
|
|
7171
|
+
if (this._workspaceEdit.changes === void 0) throw new Error("Workspace edit is not configured for normal text edit changes.");
|
|
7172
|
+
let result = this._textEditChanges[key];
|
|
7173
|
+
if (!result) {
|
|
7174
|
+
const edits = [];
|
|
7175
|
+
this._workspaceEdit.changes[key] = edits;
|
|
7176
|
+
result = new TextEditChangeImpl(edits);
|
|
7177
|
+
this._textEditChanges[key] = result;
|
|
7178
|
+
}
|
|
7179
|
+
return result;
|
|
7180
|
+
}
|
|
7181
|
+
}
|
|
7182
|
+
initDocumentChanges() {
|
|
7183
|
+
if (this._workspaceEdit.documentChanges === void 0 && this._workspaceEdit.changes === void 0) {
|
|
7184
|
+
this._changeAnnotations = new ChangeAnnotations();
|
|
7185
|
+
this._workspaceEdit.documentChanges = [];
|
|
7186
|
+
this._workspaceEdit.changeAnnotations = this._changeAnnotations.all();
|
|
7187
|
+
}
|
|
7188
|
+
}
|
|
7189
|
+
initChanges() {
|
|
7190
|
+
if (this._workspaceEdit.documentChanges === void 0 && this._workspaceEdit.changes === void 0) this._workspaceEdit.changes = Object.create(null);
|
|
7191
|
+
}
|
|
7192
|
+
createFile(uri, optionsOrAnnotation, options) {
|
|
7193
|
+
this.initDocumentChanges();
|
|
7194
|
+
if (this._workspaceEdit.documentChanges === void 0) throw new Error("Workspace edit is not configured for document changes.");
|
|
7195
|
+
let annotation;
|
|
7196
|
+
if (ChangeAnnotation.is(optionsOrAnnotation) || ChangeAnnotationIdentifier.is(optionsOrAnnotation)) annotation = optionsOrAnnotation;
|
|
7197
|
+
else options = optionsOrAnnotation;
|
|
7198
|
+
let operation;
|
|
7199
|
+
let id;
|
|
7200
|
+
if (annotation === void 0) operation = CreateFile.create(uri, options);
|
|
7201
|
+
else {
|
|
7202
|
+
id = ChangeAnnotationIdentifier.is(annotation) ? annotation : this._changeAnnotations.manage(annotation);
|
|
7203
|
+
operation = CreateFile.create(uri, options, id);
|
|
7204
|
+
}
|
|
7205
|
+
this._workspaceEdit.documentChanges.push(operation);
|
|
7206
|
+
if (id !== void 0) return id;
|
|
7207
|
+
}
|
|
7208
|
+
renameFile(oldUri, newUri, optionsOrAnnotation, options) {
|
|
7209
|
+
this.initDocumentChanges();
|
|
7210
|
+
if (this._workspaceEdit.documentChanges === void 0) throw new Error("Workspace edit is not configured for document changes.");
|
|
7211
|
+
let annotation;
|
|
7212
|
+
if (ChangeAnnotation.is(optionsOrAnnotation) || ChangeAnnotationIdentifier.is(optionsOrAnnotation)) annotation = optionsOrAnnotation;
|
|
7213
|
+
else options = optionsOrAnnotation;
|
|
7214
|
+
let operation;
|
|
7215
|
+
let id;
|
|
7216
|
+
if (annotation === void 0) operation = RenameFile.create(oldUri, newUri, options);
|
|
7217
|
+
else {
|
|
7218
|
+
id = ChangeAnnotationIdentifier.is(annotation) ? annotation : this._changeAnnotations.manage(annotation);
|
|
7219
|
+
operation = RenameFile.create(oldUri, newUri, options, id);
|
|
7220
|
+
}
|
|
7221
|
+
this._workspaceEdit.documentChanges.push(operation);
|
|
7222
|
+
if (id !== void 0) return id;
|
|
7223
|
+
}
|
|
7224
|
+
deleteFile(uri, optionsOrAnnotation, options) {
|
|
7225
|
+
this.initDocumentChanges();
|
|
7226
|
+
if (this._workspaceEdit.documentChanges === void 0) throw new Error("Workspace edit is not configured for document changes.");
|
|
7227
|
+
let annotation;
|
|
7228
|
+
if (ChangeAnnotation.is(optionsOrAnnotation) || ChangeAnnotationIdentifier.is(optionsOrAnnotation)) annotation = optionsOrAnnotation;
|
|
7229
|
+
else options = optionsOrAnnotation;
|
|
7230
|
+
let operation;
|
|
7231
|
+
let id;
|
|
7232
|
+
if (annotation === void 0) operation = DeleteFile.create(uri, options);
|
|
7233
|
+
else {
|
|
7234
|
+
id = ChangeAnnotationIdentifier.is(annotation) ? annotation : this._changeAnnotations.manage(annotation);
|
|
7235
|
+
operation = DeleteFile.create(uri, options, id);
|
|
7236
|
+
}
|
|
7237
|
+
this._workspaceEdit.documentChanges.push(operation);
|
|
7238
|
+
if (id !== void 0) return id;
|
|
7239
|
+
}
|
|
7240
|
+
};
|
|
7241
|
+
;
|
|
7242
|
+
(function(TextDocumentIdentifier) {
|
|
7243
|
+
/**
|
|
7244
|
+
* Creates a new TextDocumentIdentifier literal.
|
|
7245
|
+
* @param uri The document's uri.
|
|
7246
|
+
*/
|
|
7247
|
+
function create(uri) {
|
|
7248
|
+
return { uri };
|
|
7249
|
+
}
|
|
7250
|
+
TextDocumentIdentifier.create = create;
|
|
7251
|
+
/**
|
|
7252
|
+
* Checks whether the given literal conforms to the {@link TextDocumentIdentifier} interface.
|
|
7253
|
+
*/
|
|
7254
|
+
function is(value) {
|
|
7255
|
+
const candidate = value;
|
|
7256
|
+
return Is.defined(candidate) && Is.string(candidate.uri);
|
|
7257
|
+
}
|
|
7258
|
+
TextDocumentIdentifier.is = is;
|
|
7259
|
+
})(TextDocumentIdentifier || (TextDocumentIdentifier = {}));
|
|
7260
|
+
;
|
|
7261
|
+
(function(VersionedTextDocumentIdentifier) {
|
|
7262
|
+
/**
|
|
7263
|
+
* Creates a new VersionedTextDocumentIdentifier literal.
|
|
7264
|
+
* @param uri The document's uri.
|
|
7265
|
+
* @param version The document's version.
|
|
7266
|
+
*/
|
|
7267
|
+
function create(uri, version) {
|
|
7268
|
+
return {
|
|
7269
|
+
uri,
|
|
7270
|
+
version
|
|
7271
|
+
};
|
|
7272
|
+
}
|
|
7273
|
+
VersionedTextDocumentIdentifier.create = create;
|
|
7274
|
+
/**
|
|
7275
|
+
* Checks whether the given literal conforms to the {@link VersionedTextDocumentIdentifier} interface.
|
|
7276
|
+
*/
|
|
7277
|
+
function is(value) {
|
|
7278
|
+
const candidate = value;
|
|
7279
|
+
return Is.defined(candidate) && Is.string(candidate.uri) && Is.integer(candidate.version);
|
|
7280
|
+
}
|
|
7281
|
+
VersionedTextDocumentIdentifier.is = is;
|
|
7282
|
+
})(VersionedTextDocumentIdentifier || (VersionedTextDocumentIdentifier = {}));
|
|
7283
|
+
;
|
|
7284
|
+
(function(OptionalVersionedTextDocumentIdentifier) {
|
|
7285
|
+
/**
|
|
7286
|
+
* Creates a new OptionalVersionedTextDocumentIdentifier literal.
|
|
7287
|
+
* @param uri The document's uri.
|
|
7288
|
+
* @param version The document's version.
|
|
7289
|
+
*/
|
|
7290
|
+
function create(uri, version) {
|
|
7291
|
+
return {
|
|
7292
|
+
uri,
|
|
7293
|
+
version
|
|
7294
|
+
};
|
|
7295
|
+
}
|
|
7296
|
+
OptionalVersionedTextDocumentIdentifier.create = create;
|
|
7297
|
+
/**
|
|
7298
|
+
* Checks whether the given literal conforms to the {@link OptionalVersionedTextDocumentIdentifier} interface.
|
|
7299
|
+
*/
|
|
7300
|
+
function is(value) {
|
|
7301
|
+
const candidate = value;
|
|
7302
|
+
return Is.defined(candidate) && Is.string(candidate.uri) && (candidate.version === null || Is.integer(candidate.version));
|
|
7303
|
+
}
|
|
7304
|
+
OptionalVersionedTextDocumentIdentifier.is = is;
|
|
7305
|
+
})(OptionalVersionedTextDocumentIdentifier || (OptionalVersionedTextDocumentIdentifier = {}));
|
|
7306
|
+
;
|
|
7307
|
+
(function(LanguageKind) {
|
|
7308
|
+
LanguageKind.ABAP = "abap";
|
|
7309
|
+
LanguageKind.WindowsBat = "bat";
|
|
7310
|
+
LanguageKind.BibTeX = "bibtex";
|
|
7311
|
+
LanguageKind.Clojure = "clojure";
|
|
7312
|
+
LanguageKind.Coffeescript = "coffeescript";
|
|
7313
|
+
LanguageKind.C = "c";
|
|
7314
|
+
LanguageKind.CPP = "cpp";
|
|
7315
|
+
LanguageKind.CSharp = "csharp";
|
|
7316
|
+
LanguageKind.CSS = "css";
|
|
7317
|
+
/**
|
|
7318
|
+
* @since 3.18.0
|
|
7319
|
+
*/
|
|
7320
|
+
LanguageKind.D = "d";
|
|
7321
|
+
/**
|
|
7322
|
+
* @since 3.18.0
|
|
7323
|
+
*/
|
|
7324
|
+
LanguageKind.Delphi = "pascal";
|
|
7325
|
+
LanguageKind.Diff = "diff";
|
|
7326
|
+
LanguageKind.Dart = "dart";
|
|
7327
|
+
LanguageKind.Dockerfile = "dockerfile";
|
|
7328
|
+
LanguageKind.Elixir = "elixir";
|
|
7329
|
+
LanguageKind.Erlang = "erlang";
|
|
7330
|
+
LanguageKind.FSharp = "fsharp";
|
|
7331
|
+
LanguageKind.GitCommit = "git-commit";
|
|
7332
|
+
LanguageKind.GitRebase = "git-rebase";
|
|
7333
|
+
LanguageKind.Go = "go";
|
|
7334
|
+
LanguageKind.Groovy = "groovy";
|
|
7335
|
+
LanguageKind.Handlebars = "handlebars";
|
|
7336
|
+
LanguageKind.Haskell = "haskell";
|
|
7337
|
+
LanguageKind.HTML = "html";
|
|
7338
|
+
LanguageKind.Ini = "ini";
|
|
7339
|
+
LanguageKind.Java = "java";
|
|
7340
|
+
LanguageKind.JavaScript = "javascript";
|
|
7341
|
+
LanguageKind.JavaScriptReact = "javascriptreact";
|
|
7342
|
+
LanguageKind.JSON = "json";
|
|
7343
|
+
LanguageKind.LaTeX = "latex";
|
|
7344
|
+
LanguageKind.Less = "less";
|
|
7345
|
+
LanguageKind.Lua = "lua";
|
|
7346
|
+
LanguageKind.Makefile = "makefile";
|
|
7347
|
+
LanguageKind.Markdown = "markdown";
|
|
7348
|
+
LanguageKind.ObjectiveC = "objective-c";
|
|
7349
|
+
LanguageKind.ObjectiveCPP = "objective-cpp";
|
|
7350
|
+
/**
|
|
7351
|
+
* @since 3.18.0
|
|
7352
|
+
*/
|
|
7353
|
+
LanguageKind.Pascal = "pascal";
|
|
7354
|
+
LanguageKind.Perl = "perl";
|
|
7355
|
+
LanguageKind.Perl6 = "perl6";
|
|
7356
|
+
LanguageKind.PHP = "php";
|
|
7357
|
+
LanguageKind.Plaintext = "plaintext";
|
|
7358
|
+
LanguageKind.Powershell = "powershell";
|
|
7359
|
+
LanguageKind.Pug = "jade";
|
|
7360
|
+
LanguageKind.Python = "python";
|
|
7361
|
+
LanguageKind.R = "r";
|
|
7362
|
+
LanguageKind.Razor = "razor";
|
|
7363
|
+
LanguageKind.Ruby = "ruby";
|
|
7364
|
+
LanguageKind.Rust = "rust";
|
|
7365
|
+
LanguageKind.SCSS = "scss";
|
|
7366
|
+
LanguageKind.SASS = "sass";
|
|
7367
|
+
LanguageKind.Scala = "scala";
|
|
7368
|
+
LanguageKind.ShaderLab = "shaderlab";
|
|
7369
|
+
LanguageKind.ShellScript = "shellscript";
|
|
7370
|
+
LanguageKind.SQL = "sql";
|
|
7371
|
+
LanguageKind.Swift = "swift";
|
|
7372
|
+
LanguageKind.TypeScript = "typescript";
|
|
7373
|
+
LanguageKind.TypeScriptReact = "typescriptreact";
|
|
7374
|
+
LanguageKind.TeX = "tex";
|
|
7375
|
+
LanguageKind.VisualBasic = "vb";
|
|
7376
|
+
LanguageKind.XML = "xml";
|
|
7377
|
+
LanguageKind.XSL = "xsl";
|
|
7378
|
+
LanguageKind.YAML = "yaml";
|
|
7379
|
+
})(LanguageKind || (LanguageKind = {}));
|
|
7380
|
+
;
|
|
7381
|
+
(function(TextDocumentItem) {
|
|
7382
|
+
/**
|
|
7383
|
+
* Creates a new TextDocumentItem literal.
|
|
7384
|
+
* @param uri The document's uri.
|
|
7385
|
+
* @param languageId The document's language identifier.
|
|
7386
|
+
* @param version The document's version number.
|
|
7387
|
+
* @param text The document's text.
|
|
7388
|
+
*/
|
|
7389
|
+
function create(uri, languageId, version, text) {
|
|
7390
|
+
return {
|
|
7391
|
+
uri,
|
|
7392
|
+
languageId,
|
|
7393
|
+
version,
|
|
7394
|
+
text
|
|
7395
|
+
};
|
|
7396
|
+
}
|
|
7397
|
+
TextDocumentItem.create = create;
|
|
7398
|
+
/**
|
|
7399
|
+
* Checks whether the given literal conforms to the {@link TextDocumentItem} interface.
|
|
7400
|
+
*/
|
|
7401
|
+
function is(value) {
|
|
7402
|
+
const candidate = value;
|
|
7403
|
+
return Is.defined(candidate) && Is.string(candidate.uri) && Is.string(candidate.languageId) && Is.integer(candidate.version) && Is.string(candidate.text);
|
|
7404
|
+
}
|
|
7405
|
+
TextDocumentItem.is = is;
|
|
7406
|
+
})(TextDocumentItem || (TextDocumentItem = {}));
|
|
7407
|
+
;
|
|
7408
|
+
(function(MarkupKind) {
|
|
7409
|
+
/**
|
|
7410
|
+
* Plain text is supported as a content format
|
|
7411
|
+
*/
|
|
7412
|
+
MarkupKind.PlainText = "plaintext";
|
|
7413
|
+
/**
|
|
7414
|
+
* Markdown is supported as a content format
|
|
7415
|
+
*/
|
|
7416
|
+
MarkupKind.Markdown = "markdown";
|
|
7417
|
+
/**
|
|
7418
|
+
* Checks whether the given value is a value of the {@link MarkupKind} type.
|
|
7419
|
+
*/
|
|
7420
|
+
function is(value) {
|
|
7421
|
+
const candidate = value;
|
|
7422
|
+
return candidate === MarkupKind.PlainText || candidate === MarkupKind.Markdown;
|
|
7423
|
+
}
|
|
7424
|
+
MarkupKind.is = is;
|
|
7425
|
+
})(MarkupKind || (MarkupKind = {}));
|
|
7426
|
+
;
|
|
7427
|
+
(function(MarkupContent) {
|
|
7428
|
+
/**
|
|
7429
|
+
* Checks whether the given value conforms to the {@link MarkupContent} interface.
|
|
7430
|
+
*/
|
|
7431
|
+
function is(value) {
|
|
7432
|
+
const candidate = value;
|
|
7433
|
+
return Is.objectLiteral(value) && MarkupKind.is(candidate.kind) && Is.string(candidate.value);
|
|
7434
|
+
}
|
|
7435
|
+
MarkupContent.is = is;
|
|
7436
|
+
})(MarkupContent || (MarkupContent = {}));
|
|
7437
|
+
;
|
|
7438
|
+
(function(CompletionItemKind) {
|
|
7439
|
+
CompletionItemKind.Text = 1;
|
|
7440
|
+
CompletionItemKind.Method = 2;
|
|
7441
|
+
CompletionItemKind.Function = 3;
|
|
7442
|
+
CompletionItemKind.Constructor = 4;
|
|
7443
|
+
CompletionItemKind.Field = 5;
|
|
7444
|
+
CompletionItemKind.Variable = 6;
|
|
7445
|
+
CompletionItemKind.Class = 7;
|
|
7446
|
+
CompletionItemKind.Interface = 8;
|
|
7447
|
+
CompletionItemKind.Module = 9;
|
|
7448
|
+
CompletionItemKind.Property = 10;
|
|
7449
|
+
CompletionItemKind.Unit = 11;
|
|
7450
|
+
CompletionItemKind.Value = 12;
|
|
7451
|
+
CompletionItemKind.Enum = 13;
|
|
7452
|
+
CompletionItemKind.Keyword = 14;
|
|
7453
|
+
CompletionItemKind.Snippet = 15;
|
|
7454
|
+
CompletionItemKind.Color = 16;
|
|
7455
|
+
CompletionItemKind.File = 17;
|
|
7456
|
+
CompletionItemKind.Reference = 18;
|
|
7457
|
+
CompletionItemKind.Folder = 19;
|
|
7458
|
+
CompletionItemKind.EnumMember = 20;
|
|
7459
|
+
CompletionItemKind.Constant = 21;
|
|
7460
|
+
CompletionItemKind.Struct = 22;
|
|
7461
|
+
CompletionItemKind.Event = 23;
|
|
7462
|
+
CompletionItemKind.Operator = 24;
|
|
7463
|
+
CompletionItemKind.TypeParameter = 25;
|
|
7464
|
+
})(CompletionItemKind$1 || (CompletionItemKind$1 = {}));
|
|
7465
|
+
;
|
|
7466
|
+
(function(InsertTextFormat) {
|
|
7467
|
+
/**
|
|
7468
|
+
* The primary text to be inserted is treated as a plain string.
|
|
7469
|
+
*/
|
|
7470
|
+
InsertTextFormat.PlainText = 1;
|
|
7471
|
+
/**
|
|
7472
|
+
* The primary text to be inserted is treated as a snippet.
|
|
7473
|
+
*
|
|
7474
|
+
* A snippet can define tab stops and placeholders with `$1`, `$2`
|
|
7475
|
+
* and `${3:foo}`. `$0` defines the final tab stop, it defaults to
|
|
7476
|
+
* the end of the snippet. Placeholders with equal identifiers are linked,
|
|
7477
|
+
* that is typing in one will update others too.
|
|
7478
|
+
*
|
|
7479
|
+
* See also: https://microsoft.github.io/language-server-protocol/specifications/specification-current/#snippet_syntax
|
|
7480
|
+
*/
|
|
7481
|
+
InsertTextFormat.Snippet = 2;
|
|
7482
|
+
})(InsertTextFormat$1 || (InsertTextFormat$1 = {}));
|
|
7483
|
+
;
|
|
7484
|
+
(function(CompletionItemTag) {
|
|
7485
|
+
/**
|
|
7486
|
+
* Render a completion as obsolete, usually using a strike-out.
|
|
7487
|
+
*/
|
|
7488
|
+
CompletionItemTag.Deprecated = 1;
|
|
7489
|
+
})(CompletionItemTag || (CompletionItemTag = {}));
|
|
7490
|
+
;
|
|
7491
|
+
(function(InsertReplaceEdit) {
|
|
7492
|
+
/**
|
|
7493
|
+
* Creates a new insert / replace edit
|
|
7494
|
+
*/
|
|
7495
|
+
function create(newText, insert, replace) {
|
|
7496
|
+
return {
|
|
7497
|
+
newText,
|
|
7498
|
+
insert,
|
|
7499
|
+
replace
|
|
7500
|
+
};
|
|
7501
|
+
}
|
|
7502
|
+
InsertReplaceEdit.create = create;
|
|
7503
|
+
/**
|
|
7504
|
+
* Checks whether the given literal conforms to the {@link InsertReplaceEdit} interface.
|
|
7505
|
+
*/
|
|
7506
|
+
function is(value) {
|
|
7507
|
+
const candidate = value;
|
|
7508
|
+
return candidate && Is.string(candidate.newText) && Range.is(candidate.insert) && Range.is(candidate.replace);
|
|
7509
|
+
}
|
|
7510
|
+
InsertReplaceEdit.is = is;
|
|
7511
|
+
})(InsertReplaceEdit || (InsertReplaceEdit = {}));
|
|
7512
|
+
;
|
|
7513
|
+
(function(InsertTextMode) {
|
|
7514
|
+
/**
|
|
7515
|
+
* The insertion or replace strings is taken as it is. If the
|
|
7516
|
+
* value is multi line the lines below the cursor will be
|
|
7517
|
+
* inserted using the indentation defined in the string value.
|
|
7518
|
+
* The client will not apply any kind of adjustments to the
|
|
7519
|
+
* string.
|
|
7520
|
+
*/
|
|
7521
|
+
InsertTextMode.asIs = 1;
|
|
7522
|
+
/**
|
|
7523
|
+
* The editor adjusts leading whitespace of new lines so that
|
|
7524
|
+
* they match the indentation up to the cursor of the line for
|
|
7525
|
+
* which the item is accepted.
|
|
7526
|
+
*
|
|
7527
|
+
* Consider a line like this: <2tabs><cursor><3tabs>foo. Accepting a
|
|
7528
|
+
* multi line completion item is indented using 2 tabs and all
|
|
7529
|
+
* following lines inserted will be indented using 2 tabs as well.
|
|
7530
|
+
*/
|
|
7531
|
+
InsertTextMode.adjustIndentation = 2;
|
|
7532
|
+
})(InsertTextMode || (InsertTextMode = {}));
|
|
7533
|
+
;
|
|
7534
|
+
(function(ApplyKind) {
|
|
7535
|
+
/**
|
|
7536
|
+
* The value from the individual item (if provided and not `null`) will be
|
|
7537
|
+
* used instead of the default.
|
|
7538
|
+
*/
|
|
7539
|
+
ApplyKind.Replace = 1;
|
|
7540
|
+
/**
|
|
7541
|
+
* The value from the item will be merged with the default.
|
|
7542
|
+
*
|
|
7543
|
+
* The specific rules for mergeing values are defined against each field
|
|
7544
|
+
* that supports merging.
|
|
7545
|
+
*/
|
|
7546
|
+
ApplyKind.Merge = 2;
|
|
7547
|
+
})(ApplyKind || (ApplyKind = {}));
|
|
7548
|
+
;
|
|
7549
|
+
(function(CompletionItemLabelDetails) {
|
|
7550
|
+
function is(value) {
|
|
7551
|
+
const candidate = value;
|
|
7552
|
+
return candidate && (Is.string(candidate.detail) || candidate.detail === void 0) && (Is.string(candidate.description) || candidate.description === void 0);
|
|
7553
|
+
}
|
|
7554
|
+
CompletionItemLabelDetails.is = is;
|
|
7555
|
+
})(CompletionItemLabelDetails || (CompletionItemLabelDetails = {}));
|
|
7556
|
+
;
|
|
7557
|
+
(function(CompletionItem) {
|
|
7558
|
+
/**
|
|
7559
|
+
* Create a completion item and seed it with a label.
|
|
7560
|
+
* @param label The completion item's label
|
|
7561
|
+
*/
|
|
7562
|
+
function create(label) {
|
|
7563
|
+
return { label };
|
|
7564
|
+
}
|
|
7565
|
+
CompletionItem.create = create;
|
|
7566
|
+
})(CompletionItem || (CompletionItem = {}));
|
|
7567
|
+
;
|
|
7568
|
+
(function(CompletionList) {
|
|
7569
|
+
/**
|
|
7570
|
+
* Creates a new completion list.
|
|
7571
|
+
*
|
|
7572
|
+
* @param items The completion items.
|
|
7573
|
+
* @param isIncomplete The list is not complete.
|
|
7574
|
+
*/
|
|
7575
|
+
function create(items, isIncomplete) {
|
|
7576
|
+
return {
|
|
7577
|
+
items: items ? items : [],
|
|
7578
|
+
isIncomplete: !!isIncomplete
|
|
7579
|
+
};
|
|
7580
|
+
}
|
|
7581
|
+
CompletionList.create = create;
|
|
7582
|
+
})(CompletionList || (CompletionList = {}));
|
|
7583
|
+
;
|
|
7584
|
+
(function(MarkedString) {
|
|
7585
|
+
/**
|
|
7586
|
+
* Creates a marked string from plain text.
|
|
7587
|
+
*
|
|
7588
|
+
* @param plainText The plain text.
|
|
7589
|
+
*/
|
|
7590
|
+
function fromPlainText(plainText) {
|
|
7591
|
+
return plainText.replace(/[\\`*_{}[\]()#+\-.!]/g, "\\$&");
|
|
7592
|
+
}
|
|
7593
|
+
MarkedString.fromPlainText = fromPlainText;
|
|
7594
|
+
/**
|
|
7595
|
+
* Checks whether the given value conforms to the {@link MarkedString} type.
|
|
7596
|
+
*/
|
|
7597
|
+
function is(value) {
|
|
7598
|
+
const candidate = value;
|
|
7599
|
+
return Is.string(candidate) || Is.objectLiteral(candidate) && Is.string(candidate.language) && Is.string(candidate.value);
|
|
7600
|
+
}
|
|
7601
|
+
MarkedString.is = is;
|
|
7602
|
+
})(MarkedString || (MarkedString = {}));
|
|
7603
|
+
;
|
|
7604
|
+
(function(Hover) {
|
|
7605
|
+
/**
|
|
7606
|
+
* Checks whether the given value conforms to the {@link Hover} interface.
|
|
7607
|
+
*/
|
|
7608
|
+
function is(value) {
|
|
7609
|
+
const candidate = value;
|
|
7610
|
+
return !!candidate && Is.objectLiteral(candidate) && (MarkupContent.is(candidate.contents) || MarkedString.is(candidate.contents) || Is.typedArray(candidate.contents, MarkedString.is)) && (value.range === void 0 || Range.is(value.range));
|
|
7611
|
+
}
|
|
7612
|
+
Hover.is = is;
|
|
7613
|
+
})(Hover || (Hover = {}));
|
|
7614
|
+
;
|
|
7615
|
+
(function(ParameterInformation) {
|
|
7616
|
+
/**
|
|
7617
|
+
* Creates a new parameter information literal.
|
|
7618
|
+
*
|
|
7619
|
+
* @param label A label string.
|
|
7620
|
+
* @param documentation A doc string.
|
|
7621
|
+
*/
|
|
7622
|
+
function create(label, documentation) {
|
|
7623
|
+
return documentation ? {
|
|
7624
|
+
label,
|
|
7625
|
+
documentation
|
|
7626
|
+
} : { label };
|
|
7627
|
+
}
|
|
7628
|
+
ParameterInformation.create = create;
|
|
7629
|
+
})(ParameterInformation || (ParameterInformation = {}));
|
|
7630
|
+
;
|
|
7631
|
+
(function(SignatureInformation) {
|
|
7632
|
+
function create(label, documentation, ...parameters) {
|
|
7633
|
+
const result = { label };
|
|
7634
|
+
if (Is.defined(documentation)) result.documentation = documentation;
|
|
7635
|
+
if (Is.defined(parameters)) result.parameters = parameters;
|
|
7636
|
+
else result.parameters = [];
|
|
7637
|
+
return result;
|
|
7638
|
+
}
|
|
7639
|
+
SignatureInformation.create = create;
|
|
7640
|
+
})(SignatureInformation || (SignatureInformation = {}));
|
|
7641
|
+
;
|
|
7642
|
+
(function(DocumentHighlightKind) {
|
|
7643
|
+
/**
|
|
7644
|
+
* A textual occurrence.
|
|
7645
|
+
*/
|
|
7646
|
+
DocumentHighlightKind.Text = 1;
|
|
7647
|
+
/**
|
|
7648
|
+
* Read-access of a symbol, like reading a variable.
|
|
7649
|
+
*/
|
|
7650
|
+
DocumentHighlightKind.Read = 2;
|
|
7651
|
+
/**
|
|
7652
|
+
* Write-access of a symbol, like writing to a variable.
|
|
7653
|
+
*/
|
|
7654
|
+
DocumentHighlightKind.Write = 3;
|
|
7655
|
+
})(DocumentHighlightKind || (DocumentHighlightKind = {}));
|
|
7656
|
+
;
|
|
7657
|
+
(function(DocumentHighlight) {
|
|
7658
|
+
/**
|
|
7659
|
+
* Create a DocumentHighlight object.
|
|
7660
|
+
* @param range The range the highlight applies to.
|
|
7661
|
+
* @param kind The highlight kind
|
|
7662
|
+
*/
|
|
7663
|
+
function create(range, kind) {
|
|
7664
|
+
const result = { range };
|
|
7665
|
+
if (Is.number(kind)) result.kind = kind;
|
|
7666
|
+
return result;
|
|
7667
|
+
}
|
|
7668
|
+
DocumentHighlight.create = create;
|
|
7669
|
+
})(DocumentHighlight || (DocumentHighlight = {}));
|
|
7670
|
+
;
|
|
7671
|
+
(function(SymbolKind) {
|
|
7672
|
+
SymbolKind.File = 1;
|
|
7673
|
+
SymbolKind.Module = 2;
|
|
7674
|
+
SymbolKind.Namespace = 3;
|
|
7675
|
+
SymbolKind.Package = 4;
|
|
7676
|
+
SymbolKind.Class = 5;
|
|
7677
|
+
SymbolKind.Method = 6;
|
|
7678
|
+
SymbolKind.Property = 7;
|
|
7679
|
+
SymbolKind.Field = 8;
|
|
7680
|
+
SymbolKind.Constructor = 9;
|
|
7681
|
+
SymbolKind.Enum = 10;
|
|
7682
|
+
SymbolKind.Interface = 11;
|
|
7683
|
+
SymbolKind.Function = 12;
|
|
7684
|
+
SymbolKind.Variable = 13;
|
|
7685
|
+
SymbolKind.Constant = 14;
|
|
7686
|
+
SymbolKind.String = 15;
|
|
7687
|
+
SymbolKind.Number = 16;
|
|
7688
|
+
SymbolKind.Boolean = 17;
|
|
7689
|
+
SymbolKind.Array = 18;
|
|
7690
|
+
SymbolKind.Object = 19;
|
|
7691
|
+
SymbolKind.Key = 20;
|
|
7692
|
+
SymbolKind.Null = 21;
|
|
7693
|
+
SymbolKind.EnumMember = 22;
|
|
7694
|
+
SymbolKind.Struct = 23;
|
|
7695
|
+
SymbolKind.Event = 24;
|
|
7696
|
+
SymbolKind.Operator = 25;
|
|
7697
|
+
SymbolKind.TypeParameter = 26;
|
|
7698
|
+
})(SymbolKind$1 || (SymbolKind$1 = {}));
|
|
7699
|
+
;
|
|
7700
|
+
(function(SymbolTag) {
|
|
7701
|
+
/**
|
|
7702
|
+
* Render a symbol as obsolete, usually using a strike-out.
|
|
7703
|
+
*/
|
|
7704
|
+
SymbolTag.Deprecated = 1;
|
|
7705
|
+
})(SymbolTag || (SymbolTag = {}));
|
|
7706
|
+
;
|
|
7707
|
+
(function(SymbolInformation) {
|
|
7708
|
+
/**
|
|
7709
|
+
* Creates a new symbol information literal.
|
|
7710
|
+
*
|
|
7711
|
+
* @param name The name of the symbol.
|
|
7712
|
+
* @param kind The kind of the symbol.
|
|
7713
|
+
* @param range The range of the location of the symbol.
|
|
7714
|
+
* @param uri The resource of the location of symbol.
|
|
7715
|
+
* @param containerName The name of the symbol containing the symbol.
|
|
7716
|
+
*/
|
|
7717
|
+
function create(name, kind, range, uri, containerName) {
|
|
7718
|
+
const result = {
|
|
7719
|
+
name,
|
|
7720
|
+
kind,
|
|
7721
|
+
location: {
|
|
7722
|
+
uri,
|
|
7723
|
+
range
|
|
7724
|
+
}
|
|
7725
|
+
};
|
|
7726
|
+
if (containerName) result.containerName = containerName;
|
|
7727
|
+
return result;
|
|
7728
|
+
}
|
|
7729
|
+
SymbolInformation.create = create;
|
|
7730
|
+
})(SymbolInformation || (SymbolInformation = {}));
|
|
7731
|
+
;
|
|
7732
|
+
(function(WorkspaceSymbol) {
|
|
7733
|
+
/**
|
|
7734
|
+
* Create a new workspace symbol.
|
|
7735
|
+
*
|
|
7736
|
+
* @param name The name of the symbol.
|
|
7737
|
+
* @param kind The kind of the symbol.
|
|
7738
|
+
* @param uri The resource of the location of the symbol.
|
|
7739
|
+
* @param range An options range of the location.
|
|
7740
|
+
* @returns A WorkspaceSymbol.
|
|
7741
|
+
*/
|
|
7742
|
+
function create(name, kind, uri, range) {
|
|
7743
|
+
return range !== void 0 ? {
|
|
7744
|
+
name,
|
|
7745
|
+
kind,
|
|
7746
|
+
location: {
|
|
7747
|
+
uri,
|
|
7748
|
+
range
|
|
7749
|
+
}
|
|
7750
|
+
} : {
|
|
7751
|
+
name,
|
|
7752
|
+
kind,
|
|
7753
|
+
location: { uri }
|
|
7754
|
+
};
|
|
7755
|
+
}
|
|
7756
|
+
WorkspaceSymbol.create = create;
|
|
7757
|
+
})(WorkspaceSymbol || (WorkspaceSymbol = {}));
|
|
7758
|
+
;
|
|
7759
|
+
(function(DocumentSymbol) {
|
|
7760
|
+
/**
|
|
7761
|
+
* Creates a new symbol information literal.
|
|
7762
|
+
*
|
|
7763
|
+
* @param name The name of the symbol.
|
|
7764
|
+
* @param detail The detail of the symbol.
|
|
7765
|
+
* @param kind The kind of the symbol.
|
|
7766
|
+
* @param range The range of the symbol.
|
|
7767
|
+
* @param selectionRange The selectionRange of the symbol.
|
|
7768
|
+
* @param children Children of the symbol.
|
|
7769
|
+
*/
|
|
7770
|
+
function create(name, detail, kind, range, selectionRange, children) {
|
|
7771
|
+
const result = {
|
|
7772
|
+
name,
|
|
7773
|
+
detail,
|
|
7774
|
+
kind,
|
|
7775
|
+
range,
|
|
7776
|
+
selectionRange
|
|
7777
|
+
};
|
|
7778
|
+
if (children !== void 0) result.children = children;
|
|
7779
|
+
return result;
|
|
7780
|
+
}
|
|
7781
|
+
DocumentSymbol.create = create;
|
|
7782
|
+
/**
|
|
7783
|
+
* Checks whether the given literal conforms to the {@link DocumentSymbol} interface.
|
|
7784
|
+
*/
|
|
7785
|
+
function is(value) {
|
|
7786
|
+
const candidate = value;
|
|
7787
|
+
return candidate && Is.string(candidate.name) && Is.number(candidate.kind) && Range.is(candidate.range) && Range.is(candidate.selectionRange) && (candidate.detail === void 0 || Is.string(candidate.detail)) && (candidate.deprecated === void 0 || Is.boolean(candidate.deprecated)) && (candidate.children === void 0 || Array.isArray(candidate.children)) && (candidate.tags === void 0 || Array.isArray(candidate.tags));
|
|
7788
|
+
}
|
|
7789
|
+
DocumentSymbol.is = is;
|
|
7790
|
+
})(DocumentSymbol || (DocumentSymbol = {}));
|
|
7791
|
+
;
|
|
7792
|
+
(function(CodeActionKind) {
|
|
7793
|
+
/**
|
|
7794
|
+
* Empty kind.
|
|
7795
|
+
*/
|
|
7796
|
+
CodeActionKind.Empty = "";
|
|
7797
|
+
/**
|
|
7798
|
+
* Base kind for quickfix actions: 'quickfix'
|
|
7799
|
+
*/
|
|
7800
|
+
CodeActionKind.QuickFix = "quickfix";
|
|
7801
|
+
/**
|
|
7802
|
+
* Base kind for refactoring actions: 'refactor'
|
|
7803
|
+
*/
|
|
7804
|
+
CodeActionKind.Refactor = "refactor";
|
|
7805
|
+
/**
|
|
7806
|
+
* Base kind for refactoring extraction actions: 'refactor.extract'
|
|
7807
|
+
*
|
|
7808
|
+
* Example extract actions:
|
|
7809
|
+
*
|
|
7810
|
+
* - Extract method
|
|
7811
|
+
* - Extract function
|
|
7812
|
+
* - Extract variable
|
|
7813
|
+
* - Extract interface from class
|
|
7814
|
+
* - ...
|
|
7815
|
+
*/
|
|
7816
|
+
CodeActionKind.RefactorExtract = "refactor.extract";
|
|
7817
|
+
/**
|
|
7818
|
+
* Base kind for refactoring inline actions: 'refactor.inline'
|
|
7819
|
+
*
|
|
7820
|
+
* Example inline actions:
|
|
7821
|
+
*
|
|
7822
|
+
* - Inline function
|
|
7823
|
+
* - Inline variable
|
|
7824
|
+
* - Inline constant
|
|
7825
|
+
* - ...
|
|
7826
|
+
*/
|
|
7827
|
+
CodeActionKind.RefactorInline = "refactor.inline";
|
|
7828
|
+
/**
|
|
7829
|
+
* Base kind for refactoring move actions: `refactor.move`
|
|
7830
|
+
*
|
|
7831
|
+
* Example move actions:
|
|
7832
|
+
*
|
|
7833
|
+
* - Move a function to a new file
|
|
7834
|
+
* - Move a property between classes
|
|
7835
|
+
* - Move method to base class
|
|
7836
|
+
* - ...
|
|
7837
|
+
*
|
|
7838
|
+
* @since 3.18.0
|
|
7839
|
+
*/
|
|
7840
|
+
CodeActionKind.RefactorMove = "refactor.move";
|
|
7841
|
+
/**
|
|
7842
|
+
* Base kind for refactoring rewrite actions: 'refactor.rewrite'
|
|
7843
|
+
*
|
|
7844
|
+
* Example rewrite actions:
|
|
7845
|
+
*
|
|
7846
|
+
* - Convert JavaScript function to class
|
|
7847
|
+
* - Add or remove parameter
|
|
7848
|
+
* - Encapsulate field
|
|
7849
|
+
* - Make method static
|
|
7850
|
+
* - Move method to base class
|
|
7851
|
+
* - ...
|
|
7852
|
+
*/
|
|
7853
|
+
CodeActionKind.RefactorRewrite = "refactor.rewrite";
|
|
7854
|
+
/**
|
|
7855
|
+
* Base kind for source actions: `source`
|
|
7856
|
+
*
|
|
7857
|
+
* Source code actions apply to the entire file.
|
|
7858
|
+
*/
|
|
7859
|
+
CodeActionKind.Source = "source";
|
|
7860
|
+
/**
|
|
7861
|
+
* Base kind for an organize imports source action: `source.organizeImports`
|
|
7862
|
+
*/
|
|
7863
|
+
CodeActionKind.SourceOrganizeImports = "source.organizeImports";
|
|
7864
|
+
/**
|
|
7865
|
+
* Base kind for auto-fix source actions: `source.fixAll`.
|
|
7866
|
+
*
|
|
7867
|
+
* Fix all actions automatically fix errors that have a clear fix that do not require user input.
|
|
7868
|
+
* They should not suppress errors or perform unsafe fixes such as generating new types or classes.
|
|
7869
|
+
*
|
|
7870
|
+
* @since 3.15.0
|
|
7871
|
+
*/
|
|
7872
|
+
CodeActionKind.SourceFixAll = "source.fixAll";
|
|
7873
|
+
/**
|
|
7874
|
+
* Base kind for all code actions applying to the entire notebook's scope. CodeActionKinds using
|
|
7875
|
+
* this should always begin with `notebook.`
|
|
7876
|
+
*
|
|
7877
|
+
* @since 3.18.0
|
|
7878
|
+
*/
|
|
7879
|
+
CodeActionKind.Notebook = "notebook";
|
|
7880
|
+
})(CodeActionKind || (CodeActionKind = {}));
|
|
7881
|
+
;
|
|
7882
|
+
(function(CodeActionTriggerKind) {
|
|
7883
|
+
/**
|
|
7884
|
+
* Code actions were explicitly requested by the user or by an extension.
|
|
7885
|
+
*/
|
|
7886
|
+
CodeActionTriggerKind.Invoked = 1;
|
|
7887
|
+
/**
|
|
7888
|
+
* Code actions were requested automatically.
|
|
7889
|
+
*
|
|
7890
|
+
* This typically happens when current selection in a file changes, but can
|
|
7891
|
+
* also be triggered when file content changes.
|
|
7892
|
+
*/
|
|
7893
|
+
CodeActionTriggerKind.Automatic = 2;
|
|
7894
|
+
})(CodeActionTriggerKind || (CodeActionTriggerKind = {}));
|
|
7895
|
+
;
|
|
7896
|
+
(function(CodeActionContext) {
|
|
7897
|
+
/**
|
|
7898
|
+
* Creates a new CodeActionContext literal.
|
|
7899
|
+
*/
|
|
7900
|
+
function create(diagnostics, only, triggerKind) {
|
|
7901
|
+
const result = { diagnostics };
|
|
7902
|
+
if (only !== void 0 && only !== null) result.only = only;
|
|
7903
|
+
if (triggerKind !== void 0 && triggerKind !== null) result.triggerKind = triggerKind;
|
|
7904
|
+
return result;
|
|
7905
|
+
}
|
|
7906
|
+
CodeActionContext.create = create;
|
|
7907
|
+
/**
|
|
7908
|
+
* Checks whether the given literal conforms to the {@link CodeActionContext} interface.
|
|
7909
|
+
*/
|
|
7910
|
+
function is(value) {
|
|
7911
|
+
const candidate = value;
|
|
7912
|
+
return Is.defined(candidate) && Is.typedArray(candidate.diagnostics, Diagnostic.is) && (candidate.only === void 0 || Is.typedArray(candidate.only, Is.string)) && (candidate.triggerKind === void 0 || candidate.triggerKind === CodeActionTriggerKind.Invoked || candidate.triggerKind === CodeActionTriggerKind.Automatic);
|
|
7913
|
+
}
|
|
7914
|
+
CodeActionContext.is = is;
|
|
7915
|
+
})(CodeActionContext || (CodeActionContext = {}));
|
|
7916
|
+
;
|
|
7917
|
+
(function(CodeActionTag) {
|
|
7918
|
+
/**
|
|
7919
|
+
* Marks the code action as LLM-generated.
|
|
7920
|
+
*/
|
|
7921
|
+
CodeActionTag.LLMGenerated = 1;
|
|
7922
|
+
/**
|
|
7923
|
+
* Checks whether the given literal conforms to the {@link CodeActionTag} interface.
|
|
7924
|
+
*/
|
|
7925
|
+
function is(value) {
|
|
7926
|
+
return Is.defined(value) && value === CodeActionTag.LLMGenerated;
|
|
7927
|
+
}
|
|
7928
|
+
CodeActionTag.is = is;
|
|
7929
|
+
})(CodeActionTag || (CodeActionTag = {}));
|
|
7930
|
+
;
|
|
7931
|
+
(function(CodeAction) {
|
|
7932
|
+
function create(title, kindOrCommandOrEdit, kind) {
|
|
7933
|
+
const result = { title };
|
|
7934
|
+
let checkKind = true;
|
|
7935
|
+
if (typeof kindOrCommandOrEdit === "string") {
|
|
7936
|
+
checkKind = false;
|
|
7937
|
+
result.kind = kindOrCommandOrEdit;
|
|
7938
|
+
} else if (Command.is(kindOrCommandOrEdit)) result.command = kindOrCommandOrEdit;
|
|
7939
|
+
else result.edit = kindOrCommandOrEdit;
|
|
7940
|
+
if (checkKind && kind !== void 0) result.kind = kind;
|
|
7941
|
+
return result;
|
|
7942
|
+
}
|
|
7943
|
+
CodeAction.create = create;
|
|
7944
|
+
function is(value) {
|
|
7945
|
+
const candidate = value;
|
|
7946
|
+
return candidate && Is.string(candidate.title) && (candidate.diagnostics === void 0 || Is.typedArray(candidate.diagnostics, Diagnostic.is)) && (candidate.kind === void 0 || Is.string(candidate.kind)) && (candidate.edit !== void 0 || candidate.command !== void 0) && (candidate.command === void 0 || Command.is(candidate.command)) && (candidate.isPreferred === void 0 || Is.boolean(candidate.isPreferred)) && (candidate.edit === void 0 || WorkspaceEdit.is(candidate.edit)) && (candidate.tags === void 0 || Is.typedArray(candidate.tags, CodeActionTag.is));
|
|
7947
|
+
}
|
|
7948
|
+
CodeAction.is = is;
|
|
7949
|
+
})(CodeAction || (CodeAction = {}));
|
|
7950
|
+
;
|
|
7951
|
+
(function(CodeLens) {
|
|
7755
7952
|
/**
|
|
7756
|
-
*
|
|
7953
|
+
* Creates a new CodeLens literal.
|
|
7757
7954
|
*/
|
|
7758
|
-
|
|
7759
|
-
|
|
7760
|
-
|
|
7761
|
-
|
|
7762
|
-
|
|
7763
|
-
|
|
7764
|
-
/**
|
|
7765
|
-
* Base kind for quickfix actions: 'quickfix'
|
|
7766
|
-
*/
|
|
7767
|
-
CodeActionKind.QuickFix = "quickfix";
|
|
7768
|
-
/**
|
|
7769
|
-
* Base kind for refactoring actions: 'refactor'
|
|
7770
|
-
*/
|
|
7771
|
-
CodeActionKind.Refactor = "refactor";
|
|
7772
|
-
/**
|
|
7773
|
-
* Base kind for refactoring extraction actions: 'refactor.extract'
|
|
7774
|
-
*
|
|
7775
|
-
* Example extract actions:
|
|
7776
|
-
*
|
|
7777
|
-
* - Extract method
|
|
7778
|
-
* - Extract function
|
|
7779
|
-
* - Extract variable
|
|
7780
|
-
* - Extract interface from class
|
|
7781
|
-
* - ...
|
|
7782
|
-
*/
|
|
7783
|
-
CodeActionKind.RefactorExtract = "refactor.extract";
|
|
7784
|
-
/**
|
|
7785
|
-
* Base kind for refactoring inline actions: 'refactor.inline'
|
|
7786
|
-
*
|
|
7787
|
-
* Example inline actions:
|
|
7788
|
-
*
|
|
7789
|
-
* - Inline function
|
|
7790
|
-
* - Inline variable
|
|
7791
|
-
* - Inline constant
|
|
7792
|
-
* - ...
|
|
7793
|
-
*/
|
|
7794
|
-
CodeActionKind.RefactorInline = "refactor.inline";
|
|
7795
|
-
/**
|
|
7796
|
-
* Base kind for refactoring rewrite actions: 'refactor.rewrite'
|
|
7797
|
-
*
|
|
7798
|
-
* Example rewrite actions:
|
|
7799
|
-
*
|
|
7800
|
-
* - Convert JavaScript function to class
|
|
7801
|
-
* - Add or remove parameter
|
|
7802
|
-
* - Encapsulate field
|
|
7803
|
-
* - Make method static
|
|
7804
|
-
* - Move method to base class
|
|
7805
|
-
* - ...
|
|
7806
|
-
*/
|
|
7807
|
-
CodeActionKind.RefactorRewrite = "refactor.rewrite";
|
|
7808
|
-
/**
|
|
7809
|
-
* Base kind for source actions: `source`
|
|
7810
|
-
*
|
|
7811
|
-
* Source code actions apply to the entire file.
|
|
7812
|
-
*/
|
|
7813
|
-
CodeActionKind.Source = "source";
|
|
7814
|
-
/**
|
|
7815
|
-
* Base kind for an organize imports source action: `source.organizeImports`
|
|
7816
|
-
*/
|
|
7817
|
-
CodeActionKind.SourceOrganizeImports = "source.organizeImports";
|
|
7818
|
-
/**
|
|
7819
|
-
* Base kind for auto-fix source actions: `source.fixAll`.
|
|
7820
|
-
*
|
|
7821
|
-
* Fix all actions automatically fix errors that have a clear fix that do not require user input.
|
|
7822
|
-
* They should not suppress errors or perform unsafe fixes such as generating new types or classes.
|
|
7823
|
-
*
|
|
7824
|
-
* @since 3.15.0
|
|
7825
|
-
*/
|
|
7826
|
-
CodeActionKind.SourceFixAll = "source.fixAll";
|
|
7827
|
-
})(CodeActionKind || (exports$10.CodeActionKind = CodeActionKind = {}));
|
|
7955
|
+
function create(range, data) {
|
|
7956
|
+
const result = { range };
|
|
7957
|
+
if (Is.defined(data)) result.data = data;
|
|
7958
|
+
return result;
|
|
7959
|
+
}
|
|
7960
|
+
CodeLens.create = create;
|
|
7828
7961
|
/**
|
|
7829
|
-
*
|
|
7830
|
-
*
|
|
7831
|
-
* @since 3.17.0
|
|
7962
|
+
* Checks whether the given literal conforms to the {@link CodeLens} interface.
|
|
7832
7963
|
*/
|
|
7833
|
-
|
|
7834
|
-
|
|
7835
|
-
|
|
7836
|
-
|
|
7837
|
-
|
|
7838
|
-
|
|
7839
|
-
|
|
7840
|
-
|
|
7841
|
-
*
|
|
7842
|
-
* This typically happens when current selection in a file changes, but can
|
|
7843
|
-
* also be triggered when file content changes.
|
|
7844
|
-
*/
|
|
7845
|
-
CodeActionTriggerKind.Automatic = 2;
|
|
7846
|
-
})(CodeActionTriggerKind || (exports$10.CodeActionTriggerKind = CodeActionTriggerKind = {}));
|
|
7964
|
+
function is(value) {
|
|
7965
|
+
const candidate = value;
|
|
7966
|
+
return Is.defined(candidate) && Range.is(candidate.range) && (Is.undefined(candidate.command) || Command.is(candidate.command));
|
|
7967
|
+
}
|
|
7968
|
+
CodeLens.is = is;
|
|
7969
|
+
})(CodeLens || (CodeLens = {}));
|
|
7970
|
+
;
|
|
7971
|
+
(function(FormattingOptions) {
|
|
7847
7972
|
/**
|
|
7848
|
-
*
|
|
7849
|
-
* {@link CodeActionContext} literals.
|
|
7973
|
+
* Creates a new FormattingOptions literal.
|
|
7850
7974
|
*/
|
|
7851
|
-
|
|
7852
|
-
|
|
7853
|
-
|
|
7854
|
-
|
|
7855
|
-
|
|
7856
|
-
|
|
7857
|
-
|
|
7858
|
-
if (only !== void 0 && only !== null) result.only = only;
|
|
7859
|
-
if (triggerKind !== void 0 && triggerKind !== null) result.triggerKind = triggerKind;
|
|
7860
|
-
return result;
|
|
7861
|
-
}
|
|
7862
|
-
CodeActionContext.create = create;
|
|
7863
|
-
/**
|
|
7864
|
-
* Checks whether the given literal conforms to the {@link CodeActionContext} interface.
|
|
7865
|
-
*/
|
|
7866
|
-
function is(value) {
|
|
7867
|
-
var candidate = value;
|
|
7868
|
-
return Is.defined(candidate) && Is.typedArray(candidate.diagnostics, Diagnostic.is) && (candidate.only === void 0 || Is.typedArray(candidate.only, Is.string)) && (candidate.triggerKind === void 0 || candidate.triggerKind === CodeActionTriggerKind.Invoked || candidate.triggerKind === CodeActionTriggerKind.Automatic);
|
|
7869
|
-
}
|
|
7870
|
-
CodeActionContext.is = is;
|
|
7871
|
-
})(CodeActionContext || (exports$10.CodeActionContext = CodeActionContext = {}));
|
|
7872
|
-
var CodeAction;
|
|
7873
|
-
(function(CodeAction) {
|
|
7874
|
-
function create(title, kindOrCommandOrEdit, kind) {
|
|
7875
|
-
var result = { title };
|
|
7876
|
-
var checkKind = true;
|
|
7877
|
-
if (typeof kindOrCommandOrEdit === "string") {
|
|
7878
|
-
checkKind = false;
|
|
7879
|
-
result.kind = kindOrCommandOrEdit;
|
|
7880
|
-
} else if (Command.is(kindOrCommandOrEdit)) result.command = kindOrCommandOrEdit;
|
|
7881
|
-
else result.edit = kindOrCommandOrEdit;
|
|
7882
|
-
if (checkKind && kind !== void 0) result.kind = kind;
|
|
7883
|
-
return result;
|
|
7884
|
-
}
|
|
7885
|
-
CodeAction.create = create;
|
|
7886
|
-
function is(value) {
|
|
7887
|
-
var candidate = value;
|
|
7888
|
-
return candidate && Is.string(candidate.title) && (candidate.diagnostics === void 0 || Is.typedArray(candidate.diagnostics, Diagnostic.is)) && (candidate.kind === void 0 || Is.string(candidate.kind)) && (candidate.edit !== void 0 || candidate.command !== void 0) && (candidate.command === void 0 || Command.is(candidate.command)) && (candidate.isPreferred === void 0 || Is.boolean(candidate.isPreferred)) && (candidate.edit === void 0 || WorkspaceEdit.is(candidate.edit));
|
|
7889
|
-
}
|
|
7890
|
-
CodeAction.is = is;
|
|
7891
|
-
})(CodeAction || (exports$10.CodeAction = CodeAction = {}));
|
|
7975
|
+
function create(tabSize, insertSpaces) {
|
|
7976
|
+
return {
|
|
7977
|
+
tabSize,
|
|
7978
|
+
insertSpaces
|
|
7979
|
+
};
|
|
7980
|
+
}
|
|
7981
|
+
FormattingOptions.create = create;
|
|
7892
7982
|
/**
|
|
7893
|
-
*
|
|
7894
|
-
* {@link CodeLens} literals.
|
|
7983
|
+
* Checks whether the given literal conforms to the {@link FormattingOptions} interface.
|
|
7895
7984
|
*/
|
|
7896
|
-
|
|
7897
|
-
|
|
7898
|
-
|
|
7899
|
-
|
|
7900
|
-
|
|
7901
|
-
|
|
7902
|
-
|
|
7903
|
-
|
|
7904
|
-
return result;
|
|
7905
|
-
}
|
|
7906
|
-
CodeLens.create = create;
|
|
7907
|
-
/**
|
|
7908
|
-
* Checks whether the given literal conforms to the {@link CodeLens} interface.
|
|
7909
|
-
*/
|
|
7910
|
-
function is(value) {
|
|
7911
|
-
var candidate = value;
|
|
7912
|
-
return Is.defined(candidate) && Range.is(candidate.range) && (Is.undefined(candidate.command) || Command.is(candidate.command));
|
|
7913
|
-
}
|
|
7914
|
-
CodeLens.is = is;
|
|
7915
|
-
})(CodeLens || (exports$10.CodeLens = CodeLens = {}));
|
|
7985
|
+
function is(value) {
|
|
7986
|
+
const candidate = value;
|
|
7987
|
+
return Is.defined(candidate) && Is.uinteger(candidate.tabSize) && Is.boolean(candidate.insertSpaces);
|
|
7988
|
+
}
|
|
7989
|
+
FormattingOptions.is = is;
|
|
7990
|
+
})(FormattingOptions || (FormattingOptions = {}));
|
|
7991
|
+
;
|
|
7992
|
+
(function(DocumentLink) {
|
|
7916
7993
|
/**
|
|
7917
|
-
*
|
|
7918
|
-
* {@link FormattingOptions} literals.
|
|
7994
|
+
* Creates a new DocumentLink literal.
|
|
7919
7995
|
*/
|
|
7920
|
-
|
|
7921
|
-
|
|
7922
|
-
|
|
7923
|
-
|
|
7924
|
-
|
|
7925
|
-
|
|
7926
|
-
|
|
7927
|
-
|
|
7928
|
-
insertSpaces
|
|
7929
|
-
};
|
|
7930
|
-
}
|
|
7931
|
-
FormattingOptions.create = create;
|
|
7932
|
-
/**
|
|
7933
|
-
* Checks whether the given literal conforms to the {@link FormattingOptions} interface.
|
|
7934
|
-
*/
|
|
7935
|
-
function is(value) {
|
|
7936
|
-
var candidate = value;
|
|
7937
|
-
return Is.defined(candidate) && Is.uinteger(candidate.tabSize) && Is.boolean(candidate.insertSpaces);
|
|
7938
|
-
}
|
|
7939
|
-
FormattingOptions.is = is;
|
|
7940
|
-
})(FormattingOptions || (exports$10.FormattingOptions = FormattingOptions = {}));
|
|
7996
|
+
function create(range, target, data) {
|
|
7997
|
+
return {
|
|
7998
|
+
range,
|
|
7999
|
+
target,
|
|
8000
|
+
data
|
|
8001
|
+
};
|
|
8002
|
+
}
|
|
8003
|
+
DocumentLink.create = create;
|
|
7941
8004
|
/**
|
|
7942
|
-
*
|
|
7943
|
-
* {@link DocumentLink} literals.
|
|
8005
|
+
* Checks whether the given literal conforms to the {@link DocumentLink} interface.
|
|
7944
8006
|
*/
|
|
7945
|
-
|
|
7946
|
-
|
|
7947
|
-
|
|
7948
|
-
|
|
7949
|
-
|
|
7950
|
-
|
|
7951
|
-
|
|
7952
|
-
|
|
7953
|
-
target,
|
|
7954
|
-
data
|
|
7955
|
-
};
|
|
7956
|
-
}
|
|
7957
|
-
DocumentLink.create = create;
|
|
7958
|
-
/**
|
|
7959
|
-
* Checks whether the given literal conforms to the {@link DocumentLink} interface.
|
|
7960
|
-
*/
|
|
7961
|
-
function is(value) {
|
|
7962
|
-
var candidate = value;
|
|
7963
|
-
return Is.defined(candidate) && Range.is(candidate.range) && (Is.undefined(candidate.target) || Is.string(candidate.target));
|
|
7964
|
-
}
|
|
7965
|
-
DocumentLink.is = is;
|
|
7966
|
-
})(DocumentLink || (exports$10.DocumentLink = DocumentLink = {}));
|
|
8007
|
+
function is(value) {
|
|
8008
|
+
const candidate = value;
|
|
8009
|
+
return Is.defined(candidate) && Range.is(candidate.range) && (Is.undefined(candidate.target) || Is.string(candidate.target));
|
|
8010
|
+
}
|
|
8011
|
+
DocumentLink.is = is;
|
|
8012
|
+
})(DocumentLink || (DocumentLink = {}));
|
|
8013
|
+
;
|
|
8014
|
+
(function(SelectionRange) {
|
|
7967
8015
|
/**
|
|
7968
|
-
*
|
|
7969
|
-
*
|
|
8016
|
+
* Creates a new SelectionRange
|
|
8017
|
+
* @param range the range.
|
|
8018
|
+
* @param parent an optional parent.
|
|
7970
8019
|
*/
|
|
7971
|
-
|
|
7972
|
-
|
|
7973
|
-
|
|
7974
|
-
|
|
7975
|
-
|
|
7976
|
-
|
|
7977
|
-
|
|
7978
|
-
|
|
7979
|
-
|
|
7980
|
-
|
|
7981
|
-
|
|
7982
|
-
|
|
7983
|
-
|
|
7984
|
-
|
|
7985
|
-
|
|
7986
|
-
|
|
7987
|
-
return Is.objectLiteral(candidate) && Range.is(candidate.range) && (candidate.parent === void 0 || SelectionRange.is(candidate.parent));
|
|
7988
|
-
}
|
|
7989
|
-
SelectionRange.is = is;
|
|
7990
|
-
})(SelectionRange || (exports$10.SelectionRange = SelectionRange = {}));
|
|
8020
|
+
function create(range, parent) {
|
|
8021
|
+
return {
|
|
8022
|
+
range,
|
|
8023
|
+
parent
|
|
8024
|
+
};
|
|
8025
|
+
}
|
|
8026
|
+
SelectionRange.create = create;
|
|
8027
|
+
function is(value) {
|
|
8028
|
+
const candidate = value;
|
|
8029
|
+
return Is.objectLiteral(candidate) && Range.is(candidate.range) && (candidate.parent === void 0 || SelectionRange.is(candidate.parent));
|
|
8030
|
+
}
|
|
8031
|
+
SelectionRange.is = is;
|
|
8032
|
+
})(SelectionRange || (SelectionRange = {}));
|
|
8033
|
+
;
|
|
8034
|
+
(function(SemanticTokenTypes) {
|
|
8035
|
+
SemanticTokenTypes["namespace"] = "namespace";
|
|
7991
8036
|
/**
|
|
7992
|
-
*
|
|
7993
|
-
*
|
|
7994
|
-
* corresponding client capabilities.
|
|
7995
|
-
*
|
|
7996
|
-
* @since 3.16.0
|
|
8037
|
+
* Represents a generic type. Acts as a fallback for types which can't be mapped to
|
|
8038
|
+
* a specific type like class or enum.
|
|
7997
8039
|
*/
|
|
7998
|
-
|
|
7999
|
-
|
|
8000
|
-
|
|
8001
|
-
|
|
8002
|
-
|
|
8003
|
-
|
|
8004
|
-
|
|
8005
|
-
|
|
8006
|
-
|
|
8007
|
-
|
|
8008
|
-
|
|
8009
|
-
|
|
8010
|
-
|
|
8011
|
-
|
|
8012
|
-
|
|
8013
|
-
|
|
8014
|
-
|
|
8015
|
-
|
|
8016
|
-
|
|
8017
|
-
|
|
8018
|
-
|
|
8019
|
-
SemanticTokenTypes["keyword"] = "keyword";
|
|
8020
|
-
SemanticTokenTypes["modifier"] = "modifier";
|
|
8021
|
-
SemanticTokenTypes["comment"] = "comment";
|
|
8022
|
-
SemanticTokenTypes["string"] = "string";
|
|
8023
|
-
SemanticTokenTypes["number"] = "number";
|
|
8024
|
-
SemanticTokenTypes["regexp"] = "regexp";
|
|
8025
|
-
SemanticTokenTypes["operator"] = "operator";
|
|
8026
|
-
/**
|
|
8027
|
-
* @since 3.17.0
|
|
8028
|
-
*/
|
|
8029
|
-
SemanticTokenTypes["decorator"] = "decorator";
|
|
8030
|
-
})(SemanticTokenTypes || (exports$10.SemanticTokenTypes = SemanticTokenTypes = {}));
|
|
8040
|
+
SemanticTokenTypes["type"] = "type";
|
|
8041
|
+
SemanticTokenTypes["class"] = "class";
|
|
8042
|
+
SemanticTokenTypes["enum"] = "enum";
|
|
8043
|
+
SemanticTokenTypes["interface"] = "interface";
|
|
8044
|
+
SemanticTokenTypes["struct"] = "struct";
|
|
8045
|
+
SemanticTokenTypes["typeParameter"] = "typeParameter";
|
|
8046
|
+
SemanticTokenTypes["parameter"] = "parameter";
|
|
8047
|
+
SemanticTokenTypes["variable"] = "variable";
|
|
8048
|
+
SemanticTokenTypes["property"] = "property";
|
|
8049
|
+
SemanticTokenTypes["enumMember"] = "enumMember";
|
|
8050
|
+
SemanticTokenTypes["event"] = "event";
|
|
8051
|
+
SemanticTokenTypes["function"] = "function";
|
|
8052
|
+
SemanticTokenTypes["method"] = "method";
|
|
8053
|
+
SemanticTokenTypes["macro"] = "macro";
|
|
8054
|
+
SemanticTokenTypes["keyword"] = "keyword";
|
|
8055
|
+
SemanticTokenTypes["modifier"] = "modifier";
|
|
8056
|
+
SemanticTokenTypes["comment"] = "comment";
|
|
8057
|
+
SemanticTokenTypes["string"] = "string";
|
|
8058
|
+
SemanticTokenTypes["number"] = "number";
|
|
8059
|
+
SemanticTokenTypes["regexp"] = "regexp";
|
|
8060
|
+
SemanticTokenTypes["operator"] = "operator";
|
|
8031
8061
|
/**
|
|
8032
|
-
*
|
|
8033
|
-
* an clients can specify additional token types via the
|
|
8034
|
-
* corresponding client capabilities.
|
|
8035
|
-
*
|
|
8036
|
-
* @since 3.16.0
|
|
8062
|
+
* @since 3.17.0
|
|
8037
8063
|
*/
|
|
8038
|
-
|
|
8039
|
-
(function(SemanticTokenModifiers) {
|
|
8040
|
-
SemanticTokenModifiers["declaration"] = "declaration";
|
|
8041
|
-
SemanticTokenModifiers["definition"] = "definition";
|
|
8042
|
-
SemanticTokenModifiers["readonly"] = "readonly";
|
|
8043
|
-
SemanticTokenModifiers["static"] = "static";
|
|
8044
|
-
SemanticTokenModifiers["deprecated"] = "deprecated";
|
|
8045
|
-
SemanticTokenModifiers["abstract"] = "abstract";
|
|
8046
|
-
SemanticTokenModifiers["async"] = "async";
|
|
8047
|
-
SemanticTokenModifiers["modification"] = "modification";
|
|
8048
|
-
SemanticTokenModifiers["documentation"] = "documentation";
|
|
8049
|
-
SemanticTokenModifiers["defaultLibrary"] = "defaultLibrary";
|
|
8050
|
-
})(SemanticTokenModifiers || (exports$10.SemanticTokenModifiers = SemanticTokenModifiers = {}));
|
|
8064
|
+
SemanticTokenTypes["decorator"] = "decorator";
|
|
8051
8065
|
/**
|
|
8052
|
-
* @since 3.
|
|
8066
|
+
* @since 3.18.0
|
|
8053
8067
|
*/
|
|
8054
|
-
|
|
8055
|
-
|
|
8056
|
-
|
|
8057
|
-
|
|
8058
|
-
|
|
8059
|
-
|
|
8060
|
-
|
|
8061
|
-
|
|
8068
|
+
SemanticTokenTypes["label"] = "label";
|
|
8069
|
+
})(SemanticTokenTypes || (SemanticTokenTypes = {}));
|
|
8070
|
+
;
|
|
8071
|
+
(function(SemanticTokenModifiers) {
|
|
8072
|
+
SemanticTokenModifiers["declaration"] = "declaration";
|
|
8073
|
+
SemanticTokenModifiers["definition"] = "definition";
|
|
8074
|
+
SemanticTokenModifiers["readonly"] = "readonly";
|
|
8075
|
+
SemanticTokenModifiers["static"] = "static";
|
|
8076
|
+
SemanticTokenModifiers["deprecated"] = "deprecated";
|
|
8077
|
+
SemanticTokenModifiers["abstract"] = "abstract";
|
|
8078
|
+
SemanticTokenModifiers["async"] = "async";
|
|
8079
|
+
SemanticTokenModifiers["modification"] = "modification";
|
|
8080
|
+
SemanticTokenModifiers["documentation"] = "documentation";
|
|
8081
|
+
SemanticTokenModifiers["defaultLibrary"] = "defaultLibrary";
|
|
8082
|
+
})(SemanticTokenModifiers || (SemanticTokenModifiers = {}));
|
|
8083
|
+
;
|
|
8084
|
+
(function(SemanticTokens) {
|
|
8085
|
+
function is(value) {
|
|
8086
|
+
const candidate = value;
|
|
8087
|
+
return Is.objectLiteral(candidate) && (candidate.resultId === void 0 || typeof candidate.resultId === "string") && Array.isArray(candidate.data) && (candidate.data.length === 0 || typeof candidate.data[0] === "number");
|
|
8088
|
+
}
|
|
8089
|
+
SemanticTokens.is = is;
|
|
8090
|
+
})(SemanticTokens || (SemanticTokens = {}));
|
|
8091
|
+
;
|
|
8092
|
+
(function(InlineValueText) {
|
|
8062
8093
|
/**
|
|
8063
|
-
*
|
|
8064
|
-
*
|
|
8065
|
-
* @since 3.17.0
|
|
8094
|
+
* Creates a new InlineValueText literal.
|
|
8066
8095
|
*/
|
|
8067
|
-
|
|
8068
|
-
|
|
8069
|
-
|
|
8070
|
-
|
|
8071
|
-
|
|
8072
|
-
|
|
8073
|
-
|
|
8074
|
-
|
|
8075
|
-
|
|
8076
|
-
|
|
8077
|
-
|
|
8078
|
-
|
|
8079
|
-
|
|
8080
|
-
|
|
8081
|
-
|
|
8082
|
-
}
|
|
8083
|
-
InlineValueText.is = is;
|
|
8084
|
-
})(InlineValueText || (exports$10.InlineValueText = InlineValueText = {}));
|
|
8096
|
+
function create(range, text) {
|
|
8097
|
+
return {
|
|
8098
|
+
range,
|
|
8099
|
+
text
|
|
8100
|
+
};
|
|
8101
|
+
}
|
|
8102
|
+
InlineValueText.create = create;
|
|
8103
|
+
function is(value) {
|
|
8104
|
+
const candidate = value;
|
|
8105
|
+
return candidate !== void 0 && candidate !== null && Range.is(candidate.range) && Is.string(candidate.text);
|
|
8106
|
+
}
|
|
8107
|
+
InlineValueText.is = is;
|
|
8108
|
+
})(InlineValueText || (InlineValueText = {}));
|
|
8109
|
+
;
|
|
8110
|
+
(function(InlineValueVariableLookup) {
|
|
8085
8111
|
/**
|
|
8086
|
-
*
|
|
8087
|
-
*
|
|
8088
|
-
* @since 3.17.0
|
|
8112
|
+
* Creates a new InlineValueText literal.
|
|
8089
8113
|
*/
|
|
8090
|
-
|
|
8091
|
-
|
|
8092
|
-
|
|
8093
|
-
|
|
8094
|
-
|
|
8095
|
-
|
|
8096
|
-
|
|
8097
|
-
|
|
8098
|
-
|
|
8099
|
-
|
|
8100
|
-
|
|
8101
|
-
|
|
8102
|
-
|
|
8103
|
-
|
|
8104
|
-
|
|
8105
|
-
|
|
8106
|
-
}
|
|
8107
|
-
InlineValueVariableLookup.is = is;
|
|
8108
|
-
})(InlineValueVariableLookup || (exports$10.InlineValueVariableLookup = InlineValueVariableLookup = {}));
|
|
8114
|
+
function create(range, variableName, caseSensitiveLookup) {
|
|
8115
|
+
return {
|
|
8116
|
+
range,
|
|
8117
|
+
variableName,
|
|
8118
|
+
caseSensitiveLookup
|
|
8119
|
+
};
|
|
8120
|
+
}
|
|
8121
|
+
InlineValueVariableLookup.create = create;
|
|
8122
|
+
function is(value) {
|
|
8123
|
+
const candidate = value;
|
|
8124
|
+
return candidate !== void 0 && candidate !== null && Range.is(candidate.range) && Is.boolean(candidate.caseSensitiveLookup) && (Is.string(candidate.variableName) || candidate.variableName === void 0);
|
|
8125
|
+
}
|
|
8126
|
+
InlineValueVariableLookup.is = is;
|
|
8127
|
+
})(InlineValueVariableLookup || (InlineValueVariableLookup = {}));
|
|
8128
|
+
;
|
|
8129
|
+
(function(InlineValueEvaluatableExpression) {
|
|
8109
8130
|
/**
|
|
8110
|
-
*
|
|
8111
|
-
*
|
|
8112
|
-
* @since 3.17.0
|
|
8131
|
+
* Creates a new InlineValueEvaluatableExpression literal.
|
|
8113
8132
|
*/
|
|
8114
|
-
|
|
8115
|
-
|
|
8116
|
-
|
|
8117
|
-
|
|
8118
|
-
|
|
8119
|
-
|
|
8120
|
-
|
|
8121
|
-
|
|
8122
|
-
|
|
8123
|
-
|
|
8124
|
-
|
|
8125
|
-
|
|
8126
|
-
|
|
8127
|
-
|
|
8128
|
-
|
|
8129
|
-
}
|
|
8130
|
-
InlineValueEvaluatableExpression.is = is;
|
|
8131
|
-
})(InlineValueEvaluatableExpression || (exports$10.InlineValueEvaluatableExpression = InlineValueEvaluatableExpression = {}));
|
|
8133
|
+
function create(range, expression) {
|
|
8134
|
+
return {
|
|
8135
|
+
range,
|
|
8136
|
+
expression
|
|
8137
|
+
};
|
|
8138
|
+
}
|
|
8139
|
+
InlineValueEvaluatableExpression.create = create;
|
|
8140
|
+
function is(value) {
|
|
8141
|
+
const candidate = value;
|
|
8142
|
+
return candidate !== void 0 && candidate !== null && Range.is(candidate.range) && (Is.string(candidate.expression) || candidate.expression === void 0);
|
|
8143
|
+
}
|
|
8144
|
+
InlineValueEvaluatableExpression.is = is;
|
|
8145
|
+
})(InlineValueEvaluatableExpression || (InlineValueEvaluatableExpression = {}));
|
|
8146
|
+
;
|
|
8147
|
+
(function(InlineValueContext) {
|
|
8132
8148
|
/**
|
|
8133
|
-
*
|
|
8134
|
-
* {@link InlineValueContext} literals.
|
|
8135
|
-
*
|
|
8136
|
-
* @since 3.17.0
|
|
8149
|
+
* Creates a new InlineValueContext literal.
|
|
8137
8150
|
*/
|
|
8138
|
-
|
|
8139
|
-
|
|
8140
|
-
|
|
8141
|
-
|
|
8142
|
-
|
|
8143
|
-
|
|
8144
|
-
|
|
8145
|
-
frameId,
|
|
8146
|
-
stoppedLocation
|
|
8147
|
-
};
|
|
8148
|
-
}
|
|
8149
|
-
InlineValueContext.create = create;
|
|
8150
|
-
/**
|
|
8151
|
-
* Checks whether the given literal conforms to the {@link InlineValueContext} interface.
|
|
8152
|
-
*/
|
|
8153
|
-
function is(value) {
|
|
8154
|
-
var candidate = value;
|
|
8155
|
-
return Is.defined(candidate) && Range.is(value.stoppedLocation);
|
|
8156
|
-
}
|
|
8157
|
-
InlineValueContext.is = is;
|
|
8158
|
-
})(InlineValueContext || (exports$10.InlineValueContext = InlineValueContext = {}));
|
|
8151
|
+
function create(frameId, stoppedLocation) {
|
|
8152
|
+
return {
|
|
8153
|
+
frameId,
|
|
8154
|
+
stoppedLocation
|
|
8155
|
+
};
|
|
8156
|
+
}
|
|
8157
|
+
InlineValueContext.create = create;
|
|
8159
8158
|
/**
|
|
8160
|
-
*
|
|
8161
|
-
*
|
|
8162
|
-
* @since 3.17.0
|
|
8159
|
+
* Checks whether the given literal conforms to the {@link InlineValueContext} interface.
|
|
8163
8160
|
*/
|
|
8164
|
-
|
|
8165
|
-
|
|
8166
|
-
|
|
8167
|
-
|
|
8168
|
-
|
|
8169
|
-
|
|
8170
|
-
|
|
8171
|
-
|
|
8172
|
-
*/
|
|
8173
|
-
InlayHintKind.Parameter = 2;
|
|
8174
|
-
function is(value) {
|
|
8175
|
-
return value === 1 || value === 2;
|
|
8176
|
-
}
|
|
8177
|
-
InlayHintKind.is = is;
|
|
8178
|
-
})(InlayHintKind || (exports$10.InlayHintKind = InlayHintKind = {}));
|
|
8179
|
-
var InlayHintLabelPart;
|
|
8180
|
-
(function(InlayHintLabelPart) {
|
|
8181
|
-
function create(value) {
|
|
8182
|
-
return { value };
|
|
8183
|
-
}
|
|
8184
|
-
InlayHintLabelPart.create = create;
|
|
8185
|
-
function is(value) {
|
|
8186
|
-
var candidate = value;
|
|
8187
|
-
return Is.objectLiteral(candidate) && (candidate.tooltip === void 0 || Is.string(candidate.tooltip) || MarkupContent.is(candidate.tooltip)) && (candidate.location === void 0 || Location.is(candidate.location)) && (candidate.command === void 0 || Command.is(candidate.command));
|
|
8188
|
-
}
|
|
8189
|
-
InlayHintLabelPart.is = is;
|
|
8190
|
-
})(InlayHintLabelPart || (exports$10.InlayHintLabelPart = InlayHintLabelPart = {}));
|
|
8191
|
-
var InlayHint;
|
|
8192
|
-
(function(InlayHint) {
|
|
8193
|
-
function create(position, label, kind) {
|
|
8194
|
-
var result = {
|
|
8195
|
-
position,
|
|
8196
|
-
label
|
|
8197
|
-
};
|
|
8198
|
-
if (kind !== void 0) result.kind = kind;
|
|
8199
|
-
return result;
|
|
8200
|
-
}
|
|
8201
|
-
InlayHint.create = create;
|
|
8202
|
-
function is(value) {
|
|
8203
|
-
var candidate = value;
|
|
8204
|
-
return Is.objectLiteral(candidate) && Position.is(candidate.position) && (Is.string(candidate.label) || Is.typedArray(candidate.label, InlayHintLabelPart.is)) && (candidate.kind === void 0 || InlayHintKind.is(candidate.kind)) && candidate.textEdits === void 0 || Is.typedArray(candidate.textEdits, TextEdit.is) && (candidate.tooltip === void 0 || Is.string(candidate.tooltip) || MarkupContent.is(candidate.tooltip)) && (candidate.paddingLeft === void 0 || Is.boolean(candidate.paddingLeft)) && (candidate.paddingRight === void 0 || Is.boolean(candidate.paddingRight));
|
|
8205
|
-
}
|
|
8206
|
-
InlayHint.is = is;
|
|
8207
|
-
})(InlayHint || (exports$10.InlayHint = InlayHint = {}));
|
|
8208
|
-
var StringValue;
|
|
8209
|
-
(function(StringValue) {
|
|
8210
|
-
function createSnippet(value) {
|
|
8211
|
-
return {
|
|
8212
|
-
kind: "snippet",
|
|
8213
|
-
value
|
|
8214
|
-
};
|
|
8215
|
-
}
|
|
8216
|
-
StringValue.createSnippet = createSnippet;
|
|
8217
|
-
})(StringValue || (exports$10.StringValue = StringValue = {}));
|
|
8218
|
-
var InlineCompletionItem;
|
|
8219
|
-
(function(InlineCompletionItem) {
|
|
8220
|
-
function create(insertText, filterText, range, command) {
|
|
8221
|
-
return {
|
|
8222
|
-
insertText,
|
|
8223
|
-
filterText,
|
|
8224
|
-
range,
|
|
8225
|
-
command
|
|
8226
|
-
};
|
|
8227
|
-
}
|
|
8228
|
-
InlineCompletionItem.create = create;
|
|
8229
|
-
})(InlineCompletionItem || (exports$10.InlineCompletionItem = InlineCompletionItem = {}));
|
|
8230
|
-
var InlineCompletionList;
|
|
8231
|
-
(function(InlineCompletionList) {
|
|
8232
|
-
function create(items) {
|
|
8233
|
-
return { items };
|
|
8234
|
-
}
|
|
8235
|
-
InlineCompletionList.create = create;
|
|
8236
|
-
})(InlineCompletionList || (exports$10.InlineCompletionList = InlineCompletionList = {}));
|
|
8161
|
+
function is(value) {
|
|
8162
|
+
const candidate = value;
|
|
8163
|
+
return Is.defined(candidate) && Range.is(value.stoppedLocation);
|
|
8164
|
+
}
|
|
8165
|
+
InlineValueContext.is = is;
|
|
8166
|
+
})(InlineValueContext || (InlineValueContext = {}));
|
|
8167
|
+
;
|
|
8168
|
+
(function(InlayHintKind) {
|
|
8237
8169
|
/**
|
|
8238
|
-
*
|
|
8239
|
-
*
|
|
8240
|
-
* @since 3.18.0
|
|
8241
|
-
* @proposed
|
|
8170
|
+
* An inlay hint that for a type annotation.
|
|
8242
8171
|
*/
|
|
8243
|
-
|
|
8244
|
-
|
|
8245
|
-
|
|
8246
|
-
|
|
8247
|
-
|
|
8248
|
-
|
|
8249
|
-
|
|
8250
|
-
|
|
8251
|
-
|
|
8252
|
-
|
|
8253
|
-
|
|
8254
|
-
|
|
8255
|
-
|
|
8256
|
-
|
|
8257
|
-
|
|
8258
|
-
|
|
8259
|
-
|
|
8260
|
-
|
|
8261
|
-
|
|
8262
|
-
|
|
8263
|
-
|
|
8264
|
-
|
|
8265
|
-
|
|
8266
|
-
|
|
8267
|
-
|
|
8268
|
-
|
|
8269
|
-
|
|
8270
|
-
|
|
8271
|
-
}
|
|
8272
|
-
|
|
8273
|
-
|
|
8274
|
-
|
|
8275
|
-
|
|
8276
|
-
|
|
8277
|
-
|
|
8278
|
-
|
|
8279
|
-
|
|
8280
|
-
|
|
8281
|
-
|
|
8282
|
-
|
|
8283
|
-
|
|
8284
|
-
|
|
8285
|
-
|
|
8286
|
-
|
|
8172
|
+
InlayHintKind.Type = 1;
|
|
8173
|
+
/**
|
|
8174
|
+
* An inlay hint that is for a parameter.
|
|
8175
|
+
*/
|
|
8176
|
+
InlayHintKind.Parameter = 2;
|
|
8177
|
+
function is(value) {
|
|
8178
|
+
return value === 1 || value === 2;
|
|
8179
|
+
}
|
|
8180
|
+
InlayHintKind.is = is;
|
|
8181
|
+
})(InlayHintKind || (InlayHintKind = {}));
|
|
8182
|
+
;
|
|
8183
|
+
(function(InlayHintLabelPart) {
|
|
8184
|
+
function create(value) {
|
|
8185
|
+
return { value };
|
|
8186
|
+
}
|
|
8187
|
+
InlayHintLabelPart.create = create;
|
|
8188
|
+
function is(value) {
|
|
8189
|
+
const candidate = value;
|
|
8190
|
+
return Is.objectLiteral(candidate) && (candidate.tooltip === void 0 || Is.string(candidate.tooltip) || MarkupContent.is(candidate.tooltip)) && (candidate.location === void 0 || Location.is(candidate.location)) && (candidate.command === void 0 || Command.is(candidate.command));
|
|
8191
|
+
}
|
|
8192
|
+
InlayHintLabelPart.is = is;
|
|
8193
|
+
})(InlayHintLabelPart || (InlayHintLabelPart = {}));
|
|
8194
|
+
;
|
|
8195
|
+
(function(InlayHint) {
|
|
8196
|
+
function create(position, label, kind) {
|
|
8197
|
+
const result = {
|
|
8198
|
+
position,
|
|
8199
|
+
label
|
|
8200
|
+
};
|
|
8201
|
+
if (kind !== void 0) result.kind = kind;
|
|
8202
|
+
return result;
|
|
8203
|
+
}
|
|
8204
|
+
InlayHint.create = create;
|
|
8205
|
+
function is(value) {
|
|
8206
|
+
const candidate = value;
|
|
8207
|
+
return Is.objectLiteral(candidate) && Position.is(candidate.position) && (Is.string(candidate.label) || Is.typedArray(candidate.label, InlayHintLabelPart.is)) && (candidate.kind === void 0 || InlayHintKind.is(candidate.kind)) && candidate.textEdits === void 0 || Is.typedArray(candidate.textEdits, TextEdit.is) && (candidate.tooltip === void 0 || Is.string(candidate.tooltip) || MarkupContent.is(candidate.tooltip)) && (candidate.paddingLeft === void 0 || Is.boolean(candidate.paddingLeft)) && (candidate.paddingRight === void 0 || Is.boolean(candidate.paddingRight));
|
|
8208
|
+
}
|
|
8209
|
+
InlayHint.is = is;
|
|
8210
|
+
})(InlayHint || (InlayHint = {}));
|
|
8211
|
+
;
|
|
8212
|
+
(function(StringValue) {
|
|
8213
|
+
function createSnippet(value) {
|
|
8214
|
+
return {
|
|
8215
|
+
kind: "snippet",
|
|
8216
|
+
value
|
|
8217
|
+
};
|
|
8218
|
+
}
|
|
8219
|
+
StringValue.createSnippet = createSnippet;
|
|
8220
|
+
function isSnippet(value) {
|
|
8221
|
+
const candidate = value;
|
|
8222
|
+
return Is.objectLiteral(candidate) && candidate.kind === "snippet" && Is.string(candidate.value);
|
|
8223
|
+
}
|
|
8224
|
+
StringValue.isSnippet = isSnippet;
|
|
8225
|
+
})(StringValue || (StringValue = {}));
|
|
8226
|
+
;
|
|
8227
|
+
(function(InlineCompletionItem) {
|
|
8228
|
+
function create(insertText, filterText, range, command) {
|
|
8229
|
+
return {
|
|
8230
|
+
insertText,
|
|
8231
|
+
filterText,
|
|
8232
|
+
range,
|
|
8233
|
+
command
|
|
8234
|
+
};
|
|
8235
|
+
}
|
|
8236
|
+
InlineCompletionItem.create = create;
|
|
8237
|
+
})(InlineCompletionItem || (InlineCompletionItem = {}));
|
|
8238
|
+
;
|
|
8239
|
+
(function(InlineCompletionList) {
|
|
8240
|
+
function create(items) {
|
|
8241
|
+
return { items };
|
|
8242
|
+
}
|
|
8243
|
+
InlineCompletionList.create = create;
|
|
8244
|
+
})(InlineCompletionList || (InlineCompletionList = {}));
|
|
8245
|
+
;
|
|
8246
|
+
(function(InlineCompletionTriggerKind) {
|
|
8247
|
+
/**
|
|
8248
|
+
* Completion was triggered explicitly by a user gesture.
|
|
8249
|
+
*/
|
|
8250
|
+
InlineCompletionTriggerKind.Invoked = 1;
|
|
8251
|
+
/**
|
|
8252
|
+
* Completion was triggered automatically while editing.
|
|
8253
|
+
*/
|
|
8254
|
+
InlineCompletionTriggerKind.Automatic = 2;
|
|
8255
|
+
})(InlineCompletionTriggerKind || (InlineCompletionTriggerKind = {}));
|
|
8256
|
+
;
|
|
8257
|
+
(function(SelectedCompletionInfo) {
|
|
8258
|
+
function create(range, text) {
|
|
8259
|
+
return {
|
|
8260
|
+
range,
|
|
8261
|
+
text
|
|
8262
|
+
};
|
|
8263
|
+
}
|
|
8264
|
+
SelectedCompletionInfo.create = create;
|
|
8265
|
+
})(SelectedCompletionInfo || (SelectedCompletionInfo = {}));
|
|
8266
|
+
;
|
|
8267
|
+
(function(InlineCompletionContext) {
|
|
8268
|
+
function create(triggerKind, selectedCompletionInfo) {
|
|
8269
|
+
return {
|
|
8270
|
+
triggerKind,
|
|
8271
|
+
selectedCompletionInfo
|
|
8272
|
+
};
|
|
8273
|
+
}
|
|
8274
|
+
InlineCompletionContext.create = create;
|
|
8275
|
+
})(InlineCompletionContext || (InlineCompletionContext = {}));
|
|
8276
|
+
;
|
|
8277
|
+
(function(WorkspaceFolder) {
|
|
8278
|
+
function is(value) {
|
|
8279
|
+
const candidate = value;
|
|
8280
|
+
return Is.objectLiteral(candidate) && URI$3.is(candidate.uri) && Is.string(candidate.name);
|
|
8281
|
+
}
|
|
8282
|
+
WorkspaceFolder.is = is;
|
|
8283
|
+
})(WorkspaceFolder || (WorkspaceFolder = {}));
|
|
8284
|
+
EOL = [
|
|
8285
|
+
"\n",
|
|
8286
|
+
"\r\n",
|
|
8287
|
+
"\r"
|
|
8288
|
+
];
|
|
8289
|
+
;
|
|
8290
|
+
(function(TextDocument) {
|
|
8287
8291
|
/**
|
|
8288
|
-
*
|
|
8292
|
+
* Creates a new ITextDocument literal from the given uri and content.
|
|
8293
|
+
* @param uri The document's uri.
|
|
8294
|
+
* @param languageId The document's language Id.
|
|
8295
|
+
* @param version The document's version.
|
|
8296
|
+
* @param content The document's content.
|
|
8289
8297
|
*/
|
|
8290
|
-
|
|
8291
|
-
|
|
8292
|
-
|
|
8293
|
-
|
|
8294
|
-
* @param uri The document's uri.
|
|
8295
|
-
* @param languageId The document's language Id.
|
|
8296
|
-
* @param version The document's version.
|
|
8297
|
-
* @param content The document's content.
|
|
8298
|
-
*/
|
|
8299
|
-
function create(uri, languageId, version, content) {
|
|
8300
|
-
return new FullTextDocument(uri, languageId, version, content);
|
|
8301
|
-
}
|
|
8302
|
-
TextDocument.create = create;
|
|
8303
|
-
/**
|
|
8304
|
-
* Checks whether the given literal conforms to the {@link ITextDocument} interface.
|
|
8305
|
-
*/
|
|
8306
|
-
function is(value) {
|
|
8307
|
-
var candidate = value;
|
|
8308
|
-
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;
|
|
8309
|
-
}
|
|
8310
|
-
TextDocument.is = is;
|
|
8311
|
-
function applyEdits(document, edits) {
|
|
8312
|
-
var text = document.getText();
|
|
8313
|
-
var sortedEdits = mergeSort(edits, function(a, b) {
|
|
8314
|
-
var diff = a.range.start.line - b.range.start.line;
|
|
8315
|
-
if (diff === 0) return a.range.start.character - b.range.start.character;
|
|
8316
|
-
return diff;
|
|
8317
|
-
});
|
|
8318
|
-
var lastModifiedOffset = text.length;
|
|
8319
|
-
for (var i = sortedEdits.length - 1; i >= 0; i--) {
|
|
8320
|
-
var e = sortedEdits[i];
|
|
8321
|
-
var startOffset = document.offsetAt(e.range.start);
|
|
8322
|
-
var endOffset = document.offsetAt(e.range.end);
|
|
8323
|
-
if (endOffset <= lastModifiedOffset) text = text.substring(0, startOffset) + e.newText + text.substring(endOffset, text.length);
|
|
8324
|
-
else throw new Error("Overlapping edit");
|
|
8325
|
-
lastModifiedOffset = startOffset;
|
|
8326
|
-
}
|
|
8327
|
-
return text;
|
|
8328
|
-
}
|
|
8329
|
-
TextDocument.applyEdits = applyEdits;
|
|
8330
|
-
function mergeSort(data, compare) {
|
|
8331
|
-
if (data.length <= 1) return data;
|
|
8332
|
-
var p = data.length / 2 | 0;
|
|
8333
|
-
var left = data.slice(0, p);
|
|
8334
|
-
var right = data.slice(p);
|
|
8335
|
-
mergeSort(left, compare);
|
|
8336
|
-
mergeSort(right, compare);
|
|
8337
|
-
var leftIdx = 0;
|
|
8338
|
-
var rightIdx = 0;
|
|
8339
|
-
var i = 0;
|
|
8340
|
-
while (leftIdx < left.length && rightIdx < right.length) if (compare(left[leftIdx], right[rightIdx]) <= 0) data[i++] = left[leftIdx++];
|
|
8341
|
-
else data[i++] = right[rightIdx++];
|
|
8342
|
-
while (leftIdx < left.length) data[i++] = left[leftIdx++];
|
|
8343
|
-
while (rightIdx < right.length) data[i++] = right[rightIdx++];
|
|
8344
|
-
return data;
|
|
8345
|
-
}
|
|
8346
|
-
})(TextDocument || (exports$10.TextDocument = TextDocument = {}));
|
|
8298
|
+
function create(uri, languageId, version, content) {
|
|
8299
|
+
return new FullTextDocument$1(uri, languageId, version, content);
|
|
8300
|
+
}
|
|
8301
|
+
TextDocument.create = create;
|
|
8347
8302
|
/**
|
|
8348
|
-
*
|
|
8303
|
+
* Checks whether the given literal conforms to the {@link ITextDocument} interface.
|
|
8349
8304
|
*/
|
|
8350
|
-
|
|
8351
|
-
|
|
8352
|
-
|
|
8353
|
-
|
|
8354
|
-
|
|
8355
|
-
|
|
8356
|
-
|
|
8357
|
-
|
|
8358
|
-
|
|
8359
|
-
|
|
8360
|
-
|
|
8361
|
-
},
|
|
8362
|
-
enumerable: false,
|
|
8363
|
-
configurable: true
|
|
8364
|
-
});
|
|
8365
|
-
Object.defineProperty(FullTextDocument.prototype, "languageId", {
|
|
8366
|
-
get: function() {
|
|
8367
|
-
return this._languageId;
|
|
8368
|
-
},
|
|
8369
|
-
enumerable: false,
|
|
8370
|
-
configurable: true
|
|
8371
|
-
});
|
|
8372
|
-
Object.defineProperty(FullTextDocument.prototype, "version", {
|
|
8373
|
-
get: function() {
|
|
8374
|
-
return this._version;
|
|
8375
|
-
},
|
|
8376
|
-
enumerable: false,
|
|
8377
|
-
configurable: true
|
|
8305
|
+
function is(value) {
|
|
8306
|
+
const candidate = value;
|
|
8307
|
+
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;
|
|
8308
|
+
}
|
|
8309
|
+
TextDocument.is = is;
|
|
8310
|
+
function applyEdits(document, edits) {
|
|
8311
|
+
let text = document.getText();
|
|
8312
|
+
const sortedEdits = mergeSort(edits, (a, b) => {
|
|
8313
|
+
const diff = a.range.start.line - b.range.start.line;
|
|
8314
|
+
if (diff === 0) return a.range.start.character - b.range.start.character;
|
|
8315
|
+
return diff;
|
|
8378
8316
|
});
|
|
8379
|
-
|
|
8380
|
-
|
|
8381
|
-
|
|
8382
|
-
|
|
8383
|
-
|
|
8384
|
-
|
|
8385
|
-
|
|
8386
|
-
|
|
8387
|
-
|
|
8388
|
-
|
|
8389
|
-
|
|
8390
|
-
|
|
8391
|
-
|
|
8392
|
-
|
|
8393
|
-
|
|
8394
|
-
|
|
8395
|
-
|
|
8396
|
-
|
|
8397
|
-
|
|
8398
|
-
|
|
8399
|
-
|
|
8400
|
-
|
|
8401
|
-
|
|
8402
|
-
|
|
8403
|
-
|
|
8404
|
-
|
|
8317
|
+
let lastModifiedOffset = text.length;
|
|
8318
|
+
for (let i = sortedEdits.length - 1; i >= 0; i--) {
|
|
8319
|
+
const e = sortedEdits[i];
|
|
8320
|
+
const startOffset = document.offsetAt(e.range.start);
|
|
8321
|
+
const endOffset = document.offsetAt(e.range.end);
|
|
8322
|
+
if (endOffset <= lastModifiedOffset) text = text.substring(0, startOffset) + e.newText + text.substring(endOffset, text.length);
|
|
8323
|
+
else throw new Error("Overlapping edit");
|
|
8324
|
+
lastModifiedOffset = startOffset;
|
|
8325
|
+
}
|
|
8326
|
+
return text;
|
|
8327
|
+
}
|
|
8328
|
+
TextDocument.applyEdits = applyEdits;
|
|
8329
|
+
function mergeSort(data, compare) {
|
|
8330
|
+
if (data.length <= 1) return data;
|
|
8331
|
+
const p = data.length / 2 | 0;
|
|
8332
|
+
const left = data.slice(0, p);
|
|
8333
|
+
const right = data.slice(p);
|
|
8334
|
+
mergeSort(left, compare);
|
|
8335
|
+
mergeSort(right, compare);
|
|
8336
|
+
let leftIdx = 0;
|
|
8337
|
+
let rightIdx = 0;
|
|
8338
|
+
let i = 0;
|
|
8339
|
+
while (leftIdx < left.length && rightIdx < right.length) if (compare(left[leftIdx], right[rightIdx]) <= 0) data[i++] = left[leftIdx++];
|
|
8340
|
+
else data[i++] = right[rightIdx++];
|
|
8341
|
+
while (leftIdx < left.length) data[i++] = left[leftIdx++];
|
|
8342
|
+
while (rightIdx < right.length) data[i++] = right[rightIdx++];
|
|
8343
|
+
return data;
|
|
8344
|
+
}
|
|
8345
|
+
})(TextDocument$1 || (TextDocument$1 = {}));
|
|
8346
|
+
FullTextDocument$1 = class {
|
|
8347
|
+
constructor(uri, languageId, version, content) {
|
|
8348
|
+
this._uri = uri;
|
|
8349
|
+
this._languageId = languageId;
|
|
8350
|
+
this._version = version;
|
|
8351
|
+
this._content = content;
|
|
8352
|
+
this._lineOffsets = void 0;
|
|
8353
|
+
}
|
|
8354
|
+
get uri() {
|
|
8355
|
+
return this._uri;
|
|
8356
|
+
}
|
|
8357
|
+
get languageId() {
|
|
8358
|
+
return this._languageId;
|
|
8359
|
+
}
|
|
8360
|
+
get version() {
|
|
8361
|
+
return this._version;
|
|
8362
|
+
}
|
|
8363
|
+
getText(range) {
|
|
8364
|
+
if (range) {
|
|
8365
|
+
const start = this.offsetAt(range.start);
|
|
8366
|
+
const end = this.offsetAt(range.end);
|
|
8367
|
+
return this._content.substring(start, end);
|
|
8368
|
+
}
|
|
8369
|
+
return this._content;
|
|
8370
|
+
}
|
|
8371
|
+
update(event, version) {
|
|
8372
|
+
this._content = event.text;
|
|
8373
|
+
this._version = version;
|
|
8374
|
+
this._lineOffsets = void 0;
|
|
8375
|
+
}
|
|
8376
|
+
getLineOffsets() {
|
|
8377
|
+
if (this._lineOffsets === void 0) {
|
|
8378
|
+
const lineOffsets = [];
|
|
8379
|
+
const text = this._content;
|
|
8380
|
+
let isLineStart = true;
|
|
8381
|
+
for (let i = 0; i < text.length; i++) {
|
|
8382
|
+
if (isLineStart) {
|
|
8383
|
+
lineOffsets.push(i);
|
|
8384
|
+
isLineStart = false;
|
|
8405
8385
|
}
|
|
8406
|
-
|
|
8407
|
-
|
|
8408
|
-
|
|
8409
|
-
return this._lineOffsets;
|
|
8410
|
-
};
|
|
8411
|
-
FullTextDocument.prototype.positionAt = function(offset) {
|
|
8412
|
-
offset = Math.max(Math.min(offset, this._content.length), 0);
|
|
8413
|
-
var lineOffsets = this.getLineOffsets();
|
|
8414
|
-
var low = 0, high = lineOffsets.length;
|
|
8415
|
-
if (high === 0) return Position.create(0, offset);
|
|
8416
|
-
while (low < high) {
|
|
8417
|
-
var mid = Math.floor((low + high) / 2);
|
|
8418
|
-
if (lineOffsets[mid] > offset) high = mid;
|
|
8419
|
-
else low = mid + 1;
|
|
8386
|
+
const ch = text.charAt(i);
|
|
8387
|
+
isLineStart = ch === "\r" || ch === "\n";
|
|
8388
|
+
if (ch === "\r" && i + 1 < text.length && text.charAt(i + 1) === "\n") i++;
|
|
8420
8389
|
}
|
|
8421
|
-
|
|
8422
|
-
|
|
8423
|
-
}
|
|
8424
|
-
|
|
8425
|
-
|
|
8426
|
-
|
|
8427
|
-
|
|
8428
|
-
|
|
8429
|
-
|
|
8430
|
-
|
|
8431
|
-
|
|
8432
|
-
|
|
8433
|
-
|
|
8434
|
-
|
|
8435
|
-
|
|
8436
|
-
|
|
8437
|
-
|
|
8438
|
-
|
|
8439
|
-
|
|
8440
|
-
|
|
8441
|
-
|
|
8442
|
-
|
|
8443
|
-
|
|
8444
|
-
|
|
8445
|
-
|
|
8446
|
-
|
|
8447
|
-
|
|
8448
|
-
|
|
8449
|
-
|
|
8450
|
-
|
|
8451
|
-
|
|
8452
|
-
|
|
8453
|
-
|
|
8454
|
-
|
|
8455
|
-
|
|
8456
|
-
|
|
8457
|
-
|
|
8458
|
-
|
|
8459
|
-
|
|
8460
|
-
|
|
8461
|
-
|
|
8462
|
-
|
|
8463
|
-
|
|
8464
|
-
|
|
8465
|
-
|
|
8466
|
-
|
|
8467
|
-
|
|
8468
|
-
|
|
8469
|
-
|
|
8470
|
-
|
|
8471
|
-
|
|
8472
|
-
|
|
8473
|
-
|
|
8474
|
-
|
|
8475
|
-
|
|
8476
|
-
|
|
8477
|
-
|
|
8478
|
-
|
|
8479
|
-
|
|
8480
|
-
|
|
8481
|
-
|
|
8482
|
-
|
|
8483
|
-
|
|
8484
|
-
|
|
8485
|
-
|
|
8486
|
-
|
|
8487
|
-
|
|
8488
|
-
}
|
|
8489
|
-
|
|
8390
|
+
if (isLineStart && text.length > 0) lineOffsets.push(text.length);
|
|
8391
|
+
this._lineOffsets = lineOffsets;
|
|
8392
|
+
}
|
|
8393
|
+
return this._lineOffsets;
|
|
8394
|
+
}
|
|
8395
|
+
positionAt(offset) {
|
|
8396
|
+
offset = Math.max(Math.min(offset, this._content.length), 0);
|
|
8397
|
+
const lineOffsets = this.getLineOffsets();
|
|
8398
|
+
let low = 0, high = lineOffsets.length;
|
|
8399
|
+
if (high === 0) return Position.create(0, offset);
|
|
8400
|
+
while (low < high) {
|
|
8401
|
+
const mid = Math.floor((low + high) / 2);
|
|
8402
|
+
if (lineOffsets[mid] > offset) high = mid;
|
|
8403
|
+
else low = mid + 1;
|
|
8404
|
+
}
|
|
8405
|
+
const line = low - 1;
|
|
8406
|
+
return Position.create(line, offset - lineOffsets[line]);
|
|
8407
|
+
}
|
|
8408
|
+
offsetAt(position) {
|
|
8409
|
+
const lineOffsets = this.getLineOffsets();
|
|
8410
|
+
if (position.line >= lineOffsets.length) return this._content.length;
|
|
8411
|
+
else if (position.line < 0) return 0;
|
|
8412
|
+
const lineOffset = lineOffsets[position.line];
|
|
8413
|
+
const nextLineOffset = position.line + 1 < lineOffsets.length ? lineOffsets[position.line + 1] : this._content.length;
|
|
8414
|
+
return Math.max(Math.min(lineOffset + position.character, nextLineOffset), lineOffset);
|
|
8415
|
+
}
|
|
8416
|
+
get lineCount() {
|
|
8417
|
+
return this.getLineOffsets().length;
|
|
8418
|
+
}
|
|
8419
|
+
};
|
|
8420
|
+
;
|
|
8421
|
+
(function(Is) {
|
|
8422
|
+
const toString = Object.prototype.toString;
|
|
8423
|
+
function defined(value) {
|
|
8424
|
+
return typeof value !== "undefined";
|
|
8425
|
+
}
|
|
8426
|
+
Is.defined = defined;
|
|
8427
|
+
function undefined(value) {
|
|
8428
|
+
return typeof value === "undefined";
|
|
8429
|
+
}
|
|
8430
|
+
Is.undefined = undefined;
|
|
8431
|
+
function boolean(value) {
|
|
8432
|
+
return value === true || value === false;
|
|
8433
|
+
}
|
|
8434
|
+
Is.boolean = boolean;
|
|
8435
|
+
function string(value) {
|
|
8436
|
+
return toString.call(value) === "[object String]";
|
|
8437
|
+
}
|
|
8438
|
+
Is.string = string;
|
|
8439
|
+
function number(value) {
|
|
8440
|
+
return toString.call(value) === "[object Number]";
|
|
8441
|
+
}
|
|
8442
|
+
Is.number = number;
|
|
8443
|
+
function numberRange(value, min, max) {
|
|
8444
|
+
return toString.call(value) === "[object Number]" && min <= value && value <= max;
|
|
8445
|
+
}
|
|
8446
|
+
Is.numberRange = numberRange;
|
|
8447
|
+
function integer(value) {
|
|
8448
|
+
return toString.call(value) === "[object Number]" && -2147483648 <= value && value <= 2147483647;
|
|
8449
|
+
}
|
|
8450
|
+
Is.integer = integer;
|
|
8451
|
+
function uinteger(value) {
|
|
8452
|
+
return toString.call(value) === "[object Number]" && 0 <= value && value <= 2147483647;
|
|
8453
|
+
}
|
|
8454
|
+
Is.uinteger = uinteger;
|
|
8455
|
+
function func(value) {
|
|
8456
|
+
return toString.call(value) === "[object Function]";
|
|
8457
|
+
}
|
|
8458
|
+
Is.func = func;
|
|
8459
|
+
function objectLiteral(value) {
|
|
8460
|
+
return value !== null && typeof value === "object";
|
|
8461
|
+
}
|
|
8462
|
+
Is.objectLiteral = objectLiteral;
|
|
8463
|
+
function typedArray(value, check) {
|
|
8464
|
+
return Array.isArray(value) && value.every(check);
|
|
8465
|
+
}
|
|
8466
|
+
Is.typedArray = typedArray;
|
|
8467
|
+
})(Is || (Is = {}));
|
|
8490
8468
|
}));
|
|
8491
8469
|
|
|
8492
8470
|
//#endregion
|
|
@@ -8494,7 +8472,7 @@ var require_main$3 = /* @__PURE__ */ __commonJSMin(((exports, module) => {
|
|
|
8494
8472
|
var require_messages = /* @__PURE__ */ __commonJSMin(((exports) => {
|
|
8495
8473
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
8496
8474
|
exports.ProtocolNotificationType = exports.ProtocolNotificationType0 = exports.ProtocolRequestType = exports.ProtocolRequestType0 = exports.RegistrationType = exports.MessageDirection = void 0;
|
|
8497
|
-
const vscode_jsonrpc_1 = require_main$
|
|
8475
|
+
const vscode_jsonrpc_1 = require_main$3();
|
|
8498
8476
|
var MessageDirection;
|
|
8499
8477
|
(function(MessageDirection) {
|
|
8500
8478
|
MessageDirection["clientToServer"] = "clientToServer";
|
|
@@ -8771,7 +8749,7 @@ var require_protocol_selectionRange = /* @__PURE__ */ __commonJSMin(((exports) =
|
|
|
8771
8749
|
var require_protocol_progress = /* @__PURE__ */ __commonJSMin(((exports) => {
|
|
8772
8750
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
8773
8751
|
exports.WorkDoneProgressCancelNotification = exports.WorkDoneProgressCreateRequest = exports.WorkDoneProgress = void 0;
|
|
8774
|
-
const vscode_jsonrpc_1 = require_main$
|
|
8752
|
+
const vscode_jsonrpc_1 = require_main$3();
|
|
8775
8753
|
const messages_1 = require_messages();
|
|
8776
8754
|
var WorkDoneProgress;
|
|
8777
8755
|
(function(WorkDoneProgress) {
|
|
@@ -9231,7 +9209,7 @@ var require_protocol_inlayHint = /* @__PURE__ */ __commonJSMin(((exports) => {
|
|
|
9231
9209
|
var require_protocol_diagnostic = /* @__PURE__ */ __commonJSMin(((exports) => {
|
|
9232
9210
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
9233
9211
|
exports.DiagnosticRefreshRequest = exports.WorkspaceDiagnosticRequest = exports.DocumentDiagnosticRequest = exports.DocumentDiagnosticReportKind = exports.DiagnosticServerCancellationData = void 0;
|
|
9234
|
-
const vscode_jsonrpc_1 = require_main$
|
|
9212
|
+
const vscode_jsonrpc_1 = require_main$3();
|
|
9235
9213
|
const Is = require_is();
|
|
9236
9214
|
const messages_1 = require_messages();
|
|
9237
9215
|
/**
|
|
@@ -9305,7 +9283,7 @@ var require_protocol_diagnostic = /* @__PURE__ */ __commonJSMin(((exports) => {
|
|
|
9305
9283
|
var require_protocol_notebook = /* @__PURE__ */ __commonJSMin(((exports) => {
|
|
9306
9284
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
9307
9285
|
exports.DidCloseNotebookDocumentNotification = exports.DidSaveNotebookDocumentNotification = exports.DidChangeNotebookDocumentNotification = exports.NotebookCellArrayChange = exports.DidOpenNotebookDocumentNotification = exports.NotebookDocumentSyncRegistrationType = exports.NotebookDocument = exports.NotebookCell = exports.ExecutionSummary = exports.NotebookCellKind = void 0;
|
|
9308
|
-
const vscode_languageserver_types_1 =
|
|
9286
|
+
const vscode_languageserver_types_1 = (init_main$1(), __toCommonJS(main_exports$1));
|
|
9309
9287
|
const Is = require_is();
|
|
9310
9288
|
const messages_1 = require_messages();
|
|
9311
9289
|
/**
|
|
@@ -9514,7 +9492,7 @@ var require_protocol$1 = /* @__PURE__ */ __commonJSMin(((exports) => {
|
|
|
9514
9492
|
exports.MonikerRequest = exports.MonikerKind = exports.UniquenessLevel = exports.WillDeleteFilesRequest = exports.DidDeleteFilesNotification = exports.WillRenameFilesRequest = exports.DidRenameFilesNotification = exports.WillCreateFilesRequest = exports.DidCreateFilesNotification = exports.FileOperationPatternKind = exports.LinkedEditingRangeRequest = exports.ShowDocumentRequest = exports.SemanticTokensRegistrationType = exports.SemanticTokensRefreshRequest = exports.SemanticTokensRangeRequest = exports.SemanticTokensDeltaRequest = exports.SemanticTokensRequest = exports.TokenFormat = exports.CallHierarchyPrepareRequest = exports.CallHierarchyOutgoingCallsRequest = exports.CallHierarchyIncomingCallsRequest = exports.WorkDoneProgressCancelNotification = exports.WorkDoneProgressCreateRequest = exports.WorkDoneProgress = exports.SelectionRangeRequest = exports.DeclarationRequest = exports.FoldingRangeRefreshRequest = exports.FoldingRangeRequest = exports.ColorPresentationRequest = exports.DocumentColorRequest = exports.ConfigurationRequest = exports.DidChangeWorkspaceFoldersNotification = exports.WorkspaceFoldersRequest = exports.TypeDefinitionRequest = exports.ImplementationRequest = exports.ApplyWorkspaceEditRequest = exports.ExecuteCommandRequest = exports.PrepareRenameRequest = exports.RenameRequest = exports.PrepareSupportDefaultBehavior = exports.DocumentOnTypeFormattingRequest = exports.DocumentRangesFormattingRequest = exports.DocumentRangeFormattingRequest = exports.DocumentFormattingRequest = exports.DocumentLinkResolveRequest = exports.DocumentLinkRequest = exports.CodeLensRefreshRequest = exports.CodeLensResolveRequest = exports.CodeLensRequest = exports.WorkspaceSymbolResolveRequest = void 0;
|
|
9515
9493
|
exports.InlineCompletionRequest = exports.DidCloseNotebookDocumentNotification = exports.DidSaveNotebookDocumentNotification = exports.DidChangeNotebookDocumentNotification = exports.NotebookCellArrayChange = exports.DidOpenNotebookDocumentNotification = exports.NotebookDocumentSyncRegistrationType = exports.NotebookDocument = exports.NotebookCell = exports.ExecutionSummary = exports.NotebookCellKind = exports.DiagnosticRefreshRequest = exports.WorkspaceDiagnosticRequest = exports.DocumentDiagnosticRequest = exports.DocumentDiagnosticReportKind = exports.DiagnosticServerCancellationData = exports.InlayHintRefreshRequest = exports.InlayHintResolveRequest = exports.InlayHintRequest = exports.InlineValueRefreshRequest = exports.InlineValueRequest = exports.TypeHierarchySupertypesRequest = exports.TypeHierarchySubtypesRequest = exports.TypeHierarchyPrepareRequest = void 0;
|
|
9516
9494
|
const messages_1 = require_messages();
|
|
9517
|
-
const vscode_languageserver_types_1 =
|
|
9495
|
+
const vscode_languageserver_types_1 = (init_main$1(), __toCommonJS(main_exports$1));
|
|
9518
9496
|
const Is = require_is();
|
|
9519
9497
|
const protocol_implementation_1 = require_protocol_implementation();
|
|
9520
9498
|
Object.defineProperty(exports, "ImplementationRequest", {
|
|
@@ -10731,7 +10709,7 @@ var require_protocol$1 = /* @__PURE__ */ __commonJSMin(((exports) => {
|
|
|
10731
10709
|
var require_connection = /* @__PURE__ */ __commonJSMin(((exports) => {
|
|
10732
10710
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
10733
10711
|
exports.createProtocolConnection = void 0;
|
|
10734
|
-
const vscode_jsonrpc_1 = require_main$
|
|
10712
|
+
const vscode_jsonrpc_1 = require_main$3();
|
|
10735
10713
|
function createProtocolConnection(input, output, logger, options) {
|
|
10736
10714
|
if (vscode_jsonrpc_1.ConnectionStrategy.is(options)) options = { connectionStrategy: options };
|
|
10737
10715
|
return (0, vscode_jsonrpc_1.createMessageConnection)(input, output, logger, options);
|
|
@@ -10761,8 +10739,8 @@ var require_api$1 = /* @__PURE__ */ __commonJSMin(((exports) => {
|
|
|
10761
10739
|
};
|
|
10762
10740
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
10763
10741
|
exports.LSPErrorCodes = exports.createProtocolConnection = void 0;
|
|
10764
|
-
__exportStar(require_main$4(), exports);
|
|
10765
10742
|
__exportStar(require_main$3(), exports);
|
|
10743
|
+
__exportStar((init_main$1(), __toCommonJS(main_exports$1)), exports);
|
|
10766
10744
|
__exportStar(require_messages(), exports);
|
|
10767
10745
|
__exportStar(require_protocol$1(), exports);
|
|
10768
10746
|
var connection_1 = require_connection();
|
|
@@ -12677,8 +12655,8 @@ var require_files = /* @__PURE__ */ __commonJSMin(((exports) => {
|
|
|
12677
12655
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
12678
12656
|
exports.resolveModulePath = exports.FileSystem = exports.resolveGlobalYarnPath = exports.resolveGlobalNodePath = exports.resolve = exports.uriToFilePath = void 0;
|
|
12679
12657
|
const url$1 = require("url");
|
|
12680
|
-
const path$
|
|
12681
|
-
const fs$
|
|
12658
|
+
const path$7 = require("path");
|
|
12659
|
+
const fs$5 = require("fs");
|
|
12682
12660
|
const child_process_1 = require("child_process");
|
|
12683
12661
|
/**
|
|
12684
12662
|
* @deprecated Use the `vscode-uri` npm module which provides a more
|
|
@@ -12694,7 +12672,7 @@ var require_files = /* @__PURE__ */ __commonJSMin(((exports) => {
|
|
|
12694
12672
|
let second = segments[1];
|
|
12695
12673
|
if (first.length === 0 && second.length > 1 && second[1] === ":") segments.shift();
|
|
12696
12674
|
}
|
|
12697
|
-
return path$
|
|
12675
|
+
return path$7.normalize(segments.join("/"));
|
|
12698
12676
|
}
|
|
12699
12677
|
exports.uriToFilePath = uriToFilePath;
|
|
12700
12678
|
function isWindows() {
|
|
@@ -12723,8 +12701,8 @@ var require_files = /* @__PURE__ */ __commonJSMin(((exports) => {
|
|
|
12723
12701
|
let env = process.env;
|
|
12724
12702
|
let newEnv = Object.create(null);
|
|
12725
12703
|
Object.keys(env).forEach((key) => newEnv[key] = env[key]);
|
|
12726
|
-
if (nodePath && fs$
|
|
12727
|
-
if (newEnv[nodePathKey]) newEnv[nodePathKey] = nodePath + path$
|
|
12704
|
+
if (nodePath && fs$5.existsSync(nodePath)) {
|
|
12705
|
+
if (newEnv[nodePathKey]) newEnv[nodePathKey] = nodePath + path$7.delimiter + newEnv[nodePathKey];
|
|
12728
12706
|
else newEnv[nodePathKey] = nodePath;
|
|
12729
12707
|
if (tracer) tracer(`NODE_PATH value is: ${newEnv[nodePathKey]}`);
|
|
12730
12708
|
}
|
|
@@ -12794,8 +12772,8 @@ var require_files = /* @__PURE__ */ __commonJSMin(((exports) => {
|
|
|
12794
12772
|
let prefix = stdout.trim();
|
|
12795
12773
|
if (tracer) tracer(`'npm config get prefix' value is: ${prefix}`);
|
|
12796
12774
|
if (prefix.length > 0) {
|
|
12797
|
-
if (isWindows()) return path$
|
|
12798
|
-
else return path$
|
|
12775
|
+
if (isWindows()) return path$7.join(prefix, "node_modules");
|
|
12776
|
+
else return path$7.join(prefix, "lib", "node_modules");
|
|
12799
12777
|
}
|
|
12800
12778
|
return;
|
|
12801
12779
|
} catch (err) {
|
|
@@ -12831,7 +12809,7 @@ var require_files = /* @__PURE__ */ __commonJSMin(((exports) => {
|
|
|
12831
12809
|
let lines = stdout.trim().split(/\r?\n/);
|
|
12832
12810
|
for (let line of lines) try {
|
|
12833
12811
|
let yarn = JSON.parse(line);
|
|
12834
|
-
if (yarn.type === "log") return path$
|
|
12812
|
+
if (yarn.type === "log") return path$7.join(yarn.data, "node_modules");
|
|
12835
12813
|
} catch (e) {}
|
|
12836
12814
|
return;
|
|
12837
12815
|
} catch (err) {
|
|
@@ -12847,19 +12825,19 @@ var require_files = /* @__PURE__ */ __commonJSMin(((exports) => {
|
|
|
12847
12825
|
function isCaseSensitive() {
|
|
12848
12826
|
if (_isCaseSensitive !== void 0) return _isCaseSensitive;
|
|
12849
12827
|
if (process.platform === "win32") _isCaseSensitive = false;
|
|
12850
|
-
else _isCaseSensitive = !fs$
|
|
12828
|
+
else _isCaseSensitive = !fs$5.existsSync(__filename.toUpperCase()) || !fs$5.existsSync(__filename.toLowerCase());
|
|
12851
12829
|
return _isCaseSensitive;
|
|
12852
12830
|
}
|
|
12853
12831
|
FileSystem.isCaseSensitive = isCaseSensitive;
|
|
12854
12832
|
function isParent(parent, child) {
|
|
12855
|
-
if (isCaseSensitive()) return path$
|
|
12856
|
-
else return path$
|
|
12833
|
+
if (isCaseSensitive()) return path$7.normalize(child).indexOf(path$7.normalize(parent)) === 0;
|
|
12834
|
+
else return path$7.normalize(child).toLowerCase().indexOf(path$7.normalize(parent).toLowerCase()) === 0;
|
|
12857
12835
|
}
|
|
12858
12836
|
FileSystem.isParent = isParent;
|
|
12859
12837
|
})(FileSystem || (exports.FileSystem = FileSystem = {}));
|
|
12860
12838
|
function resolveModulePath(workspaceRoot, moduleName, nodePath, tracer) {
|
|
12861
12839
|
if (nodePath) {
|
|
12862
|
-
if (!path$
|
|
12840
|
+
if (!path$7.isAbsolute(nodePath)) nodePath = path$7.join(workspaceRoot, nodePath);
|
|
12863
12841
|
return resolve(moduleName, nodePath, nodePath, tracer).then((value) => {
|
|
12864
12842
|
if (FileSystem.isParent(nodePath, value)) return value;
|
|
12865
12843
|
else return Promise.reject(/* @__PURE__ */ new Error(`Failed to load ${moduleName} from node path location.`));
|
|
@@ -13930,7 +13908,7 @@ var require_provideRenameEdits = /* @__PURE__ */ __commonJSMin(((exports) => {
|
|
|
13930
13908
|
}));
|
|
13931
13909
|
|
|
13932
13910
|
//#endregion
|
|
13933
|
-
//#region ../../node_modules/.pnpm/vscode-languageserver-textdocument@1.0.
|
|
13911
|
+
//#region ../../node_modules/.pnpm/vscode-languageserver-textdocument@1.0.15/node_modules/vscode-languageserver-textdocument/lib/esm/main.js
|
|
13934
13912
|
var main_exports = /* @__PURE__ */ __exportAll({ TextDocument: () => TextDocument });
|
|
13935
13913
|
function mergeSort(data, compare) {
|
|
13936
13914
|
if (data.length <= 1) return data;
|
|
@@ -14061,6 +14039,52 @@ var init_main = __esmMin((() => {
|
|
|
14061
14039
|
const offset = Math.min(lineOffset + position.character, nextLineOffset);
|
|
14062
14040
|
return this.ensureBeforeEOL(offset, lineOffset);
|
|
14063
14041
|
}
|
|
14042
|
+
getLineRange(line) {
|
|
14043
|
+
const lineOffsets = this.getLineOffsets();
|
|
14044
|
+
if (line >= lineOffsets.length) {
|
|
14045
|
+
const lastLine = lineOffsets.length - 1;
|
|
14046
|
+
return {
|
|
14047
|
+
start: {
|
|
14048
|
+
line: lastLine,
|
|
14049
|
+
character: 0
|
|
14050
|
+
},
|
|
14051
|
+
end: {
|
|
14052
|
+
line: lastLine,
|
|
14053
|
+
character: this._content.length - lineOffsets[lastLine]
|
|
14054
|
+
}
|
|
14055
|
+
};
|
|
14056
|
+
} else if (line < 0) return {
|
|
14057
|
+
start: {
|
|
14058
|
+
line: 0,
|
|
14059
|
+
character: 0
|
|
14060
|
+
},
|
|
14061
|
+
end: {
|
|
14062
|
+
line: 0,
|
|
14063
|
+
character: 0
|
|
14064
|
+
}
|
|
14065
|
+
};
|
|
14066
|
+
const startOffset = lineOffsets[line];
|
|
14067
|
+
const nextLineOffset = line + 1 < lineOffsets.length ? lineOffsets[line + 1] : this._content.length;
|
|
14068
|
+
const endOffset = this.ensureBeforeEOL(nextLineOffset, startOffset);
|
|
14069
|
+
return {
|
|
14070
|
+
start: {
|
|
14071
|
+
line,
|
|
14072
|
+
character: 0
|
|
14073
|
+
},
|
|
14074
|
+
end: {
|
|
14075
|
+
line,
|
|
14076
|
+
character: endOffset - startOffset
|
|
14077
|
+
}
|
|
14078
|
+
};
|
|
14079
|
+
}
|
|
14080
|
+
getEOLCharacters(line) {
|
|
14081
|
+
const lineOffsets = this.getLineOffsets();
|
|
14082
|
+
if (line >= lineOffsets.length) return "";
|
|
14083
|
+
else if (line < 0) return "";
|
|
14084
|
+
const nextLineOffset = line + 1 < lineOffsets.length ? lineOffsets[line + 1] : this._content.length;
|
|
14085
|
+
const eolOffset = this.ensureBeforeEOL(nextLineOffset, lineOffsets[line]);
|
|
14086
|
+
return this._content.substring(eolOffset, nextLineOffset);
|
|
14087
|
+
}
|
|
14064
14088
|
ensureBeforeEOL(offset, lineOffset) {
|
|
14065
14089
|
while (offset > lineOffset && isEOL(this._content.charCodeAt(offset - 1))) offset--;
|
|
14066
14090
|
return offset;
|
|
@@ -17456,11 +17480,11 @@ var require_node$1 = /* @__PURE__ */ __commonJSMin(((exports) => {
|
|
|
17456
17480
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
17457
17481
|
exports.provider = void 0;
|
|
17458
17482
|
const language_service_1 = require_language_service();
|
|
17459
|
-
const fs$
|
|
17483
|
+
const fs$4 = require("fs");
|
|
17460
17484
|
exports.provider = {
|
|
17461
17485
|
stat(uri) {
|
|
17462
17486
|
try {
|
|
17463
|
-
const stats = fs$
|
|
17487
|
+
const stats = fs$4.statSync(uri.fsPath, { throwIfNoEntry: false });
|
|
17464
17488
|
if (stats) return {
|
|
17465
17489
|
type: stats.isFile() ? language_service_1.FileType.File : stats.isDirectory() ? language_service_1.FileType.Directory : stats.isSymbolicLink() ? language_service_1.FileType.SymbolicLink : language_service_1.FileType.Unknown,
|
|
17466
17490
|
ctime: stats.ctimeMs,
|
|
@@ -17473,14 +17497,14 @@ var require_node$1 = /* @__PURE__ */ __commonJSMin(((exports) => {
|
|
|
17473
17497
|
},
|
|
17474
17498
|
readFile(uri, encoding) {
|
|
17475
17499
|
try {
|
|
17476
|
-
return fs$
|
|
17500
|
+
return fs$4.readFileSync(uri.fsPath, { encoding: encoding ?? "utf-8" });
|
|
17477
17501
|
} catch {
|
|
17478
17502
|
return;
|
|
17479
17503
|
}
|
|
17480
17504
|
},
|
|
17481
17505
|
readDirectory(uri) {
|
|
17482
17506
|
try {
|
|
17483
|
-
return fs$
|
|
17507
|
+
return fs$4.readdirSync(uri.fsPath, { withFileTypes: true }).map((file) => {
|
|
17484
17508
|
return [file.name, file.isFile() ? language_service_1.FileType.File : file.isDirectory() ? language_service_1.FileType.Directory : file.isSymbolicLink() ? language_service_1.FileType.SymbolicLink : language_service_1.FileType.Unknown];
|
|
17485
17509
|
});
|
|
17486
17510
|
} catch {
|
|
@@ -22498,10 +22522,10 @@ function resolve_typescript_backend({ argv = [], initializationOptions } = {}) {
|
|
|
22498
22522
|
/**
|
|
22499
22523
|
* The TypeScript installation the classic backend hosts, from the Volar-style
|
|
22500
22524
|
* `typescript.tsdk` initialization option: the absolute path of a TypeScript
|
|
22501
|
-
* `lib` directory (the one containing `typescript.js`).
|
|
22502
|
-
*
|
|
22503
|
-
*
|
|
22504
|
-
*
|
|
22525
|
+
* `lib` directory (the one containing `typescript.js`). An editor may pass
|
|
22526
|
+
* the TypeScript it runs for the workspace. Without it the server loads the
|
|
22527
|
+
* `typescript` package resolvable from its own location (the peer
|
|
22528
|
+
* dependency). The VS Code extension uses the plugin backend, which loads none.
|
|
22505
22529
|
* @param {unknown} initializationOptions
|
|
22506
22530
|
* @returns {string | undefined}
|
|
22507
22531
|
*/
|
|
@@ -22513,6 +22537,126 @@ function resolve_typescript_tsdk(initializationOptions) {
|
|
|
22513
22537
|
return typeof tsdk === "string" && tsdk.length > 0 ? tsdk : void 0;
|
|
22514
22538
|
}
|
|
22515
22539
|
|
|
22540
|
+
//#endregion
|
|
22541
|
+
//#region src/find-typescript.js
|
|
22542
|
+
/**
|
|
22543
|
+
* Finding the `typescript` package the classic backend runs, in this order:
|
|
22544
|
+
*
|
|
22545
|
+
* 1. the `typescript.tsdk` initialization option: an editor's choice, the `lib`
|
|
22546
|
+
* directory of a TypeScript installation;
|
|
22547
|
+
* 2. the project's own `typescript`: `node_modules/typescript` in each open
|
|
22548
|
+
* workspace folder (or, when the client names none, the server's working
|
|
22549
|
+
* directory) and its parent folders, as Node resolves a package, the first
|
|
22550
|
+
* folder that has one wins;
|
|
22551
|
+
* 3. the `typescript` next to the server: `node_modules/typescript` from the
|
|
22552
|
+
* server's own folder up. `typescript` is an optional peer dependency, so npm
|
|
22553
|
+
* and pnpm do not install one by themselves.
|
|
22554
|
+
*
|
|
22555
|
+
* Any version below 7 is used. TypeScript 7's npm package is the native compiler
|
|
22556
|
+
* with no JavaScript API, so the server cannot run it.
|
|
22557
|
+
*/
|
|
22558
|
+
/**
|
|
22559
|
+
* @typedef {{ dir: string, lib: string, version: string, source: 'tsdk' | 'workspace' | 'server' }} FoundTypeScript
|
|
22560
|
+
* `dir`: the package's real path. `lib`: its `lib` directory, with `typescript.js`.
|
|
22561
|
+
*/
|
|
22562
|
+
/**
|
|
22563
|
+
* The version of the `typescript` package in `dir`, or undefined when there is no
|
|
22564
|
+
* readable package there.
|
|
22565
|
+
* @param {string} dir
|
|
22566
|
+
* @returns {string | undefined}
|
|
22567
|
+
*/
|
|
22568
|
+
function package_version(dir) {
|
|
22569
|
+
try {
|
|
22570
|
+
const manifest = JSON.parse(node_fs.default.readFileSync(node_path.default.join(dir, "package.json"), "utf8"));
|
|
22571
|
+
return manifest.name === "typescript" && typeof manifest.version === "string" ? manifest.version : void 0;
|
|
22572
|
+
} catch {
|
|
22573
|
+
return;
|
|
22574
|
+
}
|
|
22575
|
+
}
|
|
22576
|
+
/**
|
|
22577
|
+
* `node_modules/typescript` in `from_dir` or the nearest parent folder that has one.
|
|
22578
|
+
* @param {string} from_dir
|
|
22579
|
+
* @returns {{ dir: string, lib: string, version: string } | undefined}
|
|
22580
|
+
*/
|
|
22581
|
+
function find_typescript_package(from_dir) {
|
|
22582
|
+
for (let dir = node_path.default.resolve(from_dir);; dir = node_path.default.dirname(dir)) {
|
|
22583
|
+
if (node_path.default.basename(dir) !== "node_modules") {
|
|
22584
|
+
const candidate = node_path.default.join(dir, "node_modules", "typescript");
|
|
22585
|
+
const version = package_version(candidate);
|
|
22586
|
+
if (version !== void 0) {
|
|
22587
|
+
const real = node_fs.default.realpathSync(candidate);
|
|
22588
|
+
return {
|
|
22589
|
+
dir: real,
|
|
22590
|
+
lib: node_path.default.join(real, "lib"),
|
|
22591
|
+
version
|
|
22592
|
+
};
|
|
22593
|
+
}
|
|
22594
|
+
}
|
|
22595
|
+
if (node_path.default.dirname(dir) === dir) return;
|
|
22596
|
+
}
|
|
22597
|
+
}
|
|
22598
|
+
/**
|
|
22599
|
+
* @param {{ tsdk?: string, workspace_dirs: readonly string[], server_dir: string }} options
|
|
22600
|
+
* `tsdk`: the `typescript.tsdk` initialization option. `workspace_dirs`: the open
|
|
22601
|
+
* workspace folders. `server_dir`: the server's own folder.
|
|
22602
|
+
* @returns {FoundTypeScript | undefined}
|
|
22603
|
+
*/
|
|
22604
|
+
function find_typescript({ tsdk, workspace_dirs, server_dir }) {
|
|
22605
|
+
if (tsdk !== void 0) {
|
|
22606
|
+
const lib = node_path.default.resolve(tsdk);
|
|
22607
|
+
const dir = node_path.default.dirname(lib);
|
|
22608
|
+
const version = package_version(dir);
|
|
22609
|
+
if (version !== void 0) return {
|
|
22610
|
+
dir: node_fs.default.realpathSync(dir),
|
|
22611
|
+
lib,
|
|
22612
|
+
version,
|
|
22613
|
+
source: "tsdk"
|
|
22614
|
+
};
|
|
22615
|
+
}
|
|
22616
|
+
for (const workspace_dir of workspace_dirs) {
|
|
22617
|
+
const found = find_typescript_package(workspace_dir);
|
|
22618
|
+
if (found) return {
|
|
22619
|
+
...found,
|
|
22620
|
+
source: "workspace"
|
|
22621
|
+
};
|
|
22622
|
+
}
|
|
22623
|
+
const found = find_typescript_package(server_dir);
|
|
22624
|
+
return found ? {
|
|
22625
|
+
...found,
|
|
22626
|
+
source: "server"
|
|
22627
|
+
} : void 0;
|
|
22628
|
+
}
|
|
22629
|
+
/**
|
|
22630
|
+
* Whether the server can run the `typescript` package of this version: below 7.
|
|
22631
|
+
* @param {string} version
|
|
22632
|
+
*/
|
|
22633
|
+
function is_usable_typescript(version) {
|
|
22634
|
+
return Number.parseInt(version, 10) < 7;
|
|
22635
|
+
}
|
|
22636
|
+
/** What still works without TypeScript, for the notices. */
|
|
22637
|
+
const STILL_WORKS = "TSRX compile errors, CSS in <style>, the outline, formatting and closing tags still work.";
|
|
22638
|
+
/**
|
|
22639
|
+
* The notice the server shows when it found no `typescript` it can run.
|
|
22640
|
+
* @param {FoundTypeScript | undefined} found
|
|
22641
|
+
* @param {readonly string[]} workspace_dirs
|
|
22642
|
+
* @returns {string}
|
|
22643
|
+
*/
|
|
22644
|
+
function typescript_notice(found, workspace_dirs) {
|
|
22645
|
+
if (found) return [
|
|
22646
|
+
`The TSRX language server found typescript ${found.version} at ${found.dir}.`,
|
|
22647
|
+
"It cannot run TypeScript 7 or newer, so type checking, hover and completions in .tsrx files are off.",
|
|
22648
|
+
STILL_WORKS,
|
|
22649
|
+
"For TypeScript 7, run its own language server (tsc --lsp) with @tsrx/content-mapper. To use another TypeScript, set the typescript.tsdk startup option to its lib folder.",
|
|
22650
|
+
"See https://github.com/tsrx-org/tsrx/tree/main/packages/language-server#which-typescript-it-uses"
|
|
22651
|
+
].join(" ");
|
|
22652
|
+
return [
|
|
22653
|
+
`The TSRX language server found no typescript package in ${workspace_dirs.join(", ")}, its parent folders, or next to the server,`,
|
|
22654
|
+
"so type checking, hover and completions in .tsrx files are off.",
|
|
22655
|
+
STILL_WORKS,
|
|
22656
|
+
"Install typescript in the project (npm install -D typescript, or pnpm add -D typescript), then restart the language server."
|
|
22657
|
+
].join(" ");
|
|
22658
|
+
}
|
|
22659
|
+
|
|
22516
22660
|
//#endregion
|
|
22517
22661
|
//#region src/autoInsertPlugin.js
|
|
22518
22662
|
/** @import { LanguageServicePlugin } from '@volar/language-server' */
|
|
@@ -24302,7 +24446,10 @@ const { log: log$1, logError: logError$1 } = createLogging("[TSRX TypeScript Dia
|
|
|
24302
24446
|
* @param {Diagnostic[]} items
|
|
24303
24447
|
*/
|
|
24304
24448
|
function process$1(diagnostic, items) {
|
|
24305
|
-
diagnostic.message = deobfuscateIdentifiers(diagnostic.message)
|
|
24449
|
+
diagnostic.message = typeof diagnostic.message === "string" ? deobfuscateIdentifiers(diagnostic.message) : {
|
|
24450
|
+
...diagnostic.message,
|
|
24451
|
+
value: deobfuscateIdentifiers(diagnostic.message.value)
|
|
24452
|
+
};
|
|
24306
24453
|
items.push(diagnostic);
|
|
24307
24454
|
}
|
|
24308
24455
|
/**
|
|
@@ -24759,153 +24906,6 @@ async function formatting_enabled(connection, uri) {
|
|
|
24759
24906
|
}
|
|
24760
24907
|
}
|
|
24761
24908
|
|
|
24762
|
-
//#endregion
|
|
24763
|
-
//#region ../typescript-plugin/src/typescript-version.js
|
|
24764
|
-
/**
|
|
24765
|
-
* The TypeScript versions TSRX's JavaScript tooling runs on, and the messages
|
|
24766
|
-
* shown when a project resolves a `typescript` package it cannot use.
|
|
24767
|
-
*
|
|
24768
|
-
* TypeScript 7 (`typescript@7`) is the native compiler: its npm package only
|
|
24769
|
-
* launches the platform binary and exposes no JavaScript API. Everything that
|
|
24770
|
-
* hosts TypeScript through Volar (the tsserver plugin, the classic TSRX language
|
|
24771
|
-
* server, and `tsrx-tsc` on the classic path) therefore needs TypeScript 5.9 or
|
|
24772
|
-
* 6 installed. The native path needs no other TypeScript: `@tsrx/content-mapper`
|
|
24773
|
-
* and the TSRX language server's native backend read `tsconfig.json` and resolve
|
|
24774
|
-
* compilers themselves (`tsconfig-resolution.js`, `package-resolution.js`), and
|
|
24775
|
-
* TypeScript 7 type-checks `.tsrx` files through the mapper, which needs a 7.1
|
|
24776
|
-
* nightly: the stable 7.0 releases have no content-mapper protocol. `tsrx-tsc`
|
|
24777
|
-
* runs that native path itself when the installed `typescript` is such a build
|
|
24778
|
-
* (`native-tsc.js`), so one command serves every supported TypeScript line.
|
|
24779
|
-
*/
|
|
24780
|
-
/** The `typescript` versions whose JavaScript API TSRX runs on. */
|
|
24781
|
-
const SUPPORTED_TYPESCRIPT_RANGE = "^5.9.3 || ^6.0.0";
|
|
24782
|
-
/**
|
|
24783
|
-
* The oldest TypeScript 7 build `@tsrx/content-mapper` supports (`tsc
|
|
24784
|
-
* --runExternalCode`, `tsc --lsp`): the first 7.1 nightly whose `tsc --watch`
|
|
24785
|
-
* recompiles after an edit (microsoft/TypeScript#64351). The content-mapper
|
|
24786
|
-
* protocol itself arrived in `7.1.0-dev.20260822.1`. The VS Code "TypeScript 7
|
|
24787
|
-
* Nightly" extension version that bundles it is `0.<date>.<n>` for the same date.
|
|
24788
|
-
*/
|
|
24789
|
-
const MINIMUM_NATIVE_TYPESCRIPT_VERSION = "7.1.0-dev.20260923.1";
|
|
24790
|
-
/**
|
|
24791
|
-
* Where the gaps in TypeScript 7 support and their upstream issues are tracked:
|
|
24792
|
-
* the tracking issue, which outlives the pull request that added the support.
|
|
24793
|
-
*/
|
|
24794
|
-
const TYPESCRIPT_7_TRACKING_URL = "https://github.com/tsrx-org/tsrx/issues/136";
|
|
24795
|
-
/** One sentence to append to every message that mentions TypeScript 7. */
|
|
24796
|
-
const TYPESCRIPT_7_SUPPORT_NOTE = `TypeScript 7 support for .tsrx files is not complete yet; the gaps and the upstream TypeScript issues behind them are tracked in ${TYPESCRIPT_7_TRACKING_URL}. If you run into one that is not listed there, please file a new issue on the tsrx repository.`;
|
|
24797
|
-
/**
|
|
24798
|
-
* @param {string} version
|
|
24799
|
-
* @returns {number}
|
|
24800
|
-
*/
|
|
24801
|
-
function typescript_major(version) {
|
|
24802
|
-
return Number.parseInt(version, 10);
|
|
24803
|
-
}
|
|
24804
|
-
/**
|
|
24805
|
-
* Whether a `typescript` package version is the native compiler (7 and up),
|
|
24806
|
-
* whose package has no JavaScript API.
|
|
24807
|
-
* @param {string} version
|
|
24808
|
-
* @returns {boolean}
|
|
24809
|
-
*/
|
|
24810
|
-
function is_native_typescript_package(version) {
|
|
24811
|
-
return typescript_major(version) >= 7;
|
|
24812
|
-
}
|
|
24813
|
-
/**
|
|
24814
|
-
* @typedef {object} ParsedTypeScriptVersion
|
|
24815
|
-
* @property {number[]} core `major.minor.patch` as numbers.
|
|
24816
|
-
* @property {'nightly' | 'prerelease' | 'release'} channel
|
|
24817
|
-
* @property {Array<number | string>} prerelease The dot-separated prerelease
|
|
24818
|
-
* identifiers, numeric ones as numbers.
|
|
24819
|
-
*/
|
|
24820
|
-
/**
|
|
24821
|
-
* @param {string} version
|
|
24822
|
-
* @returns {ParsedTypeScriptVersion}
|
|
24823
|
-
*/
|
|
24824
|
-
function parse_typescript_version(version) {
|
|
24825
|
-
const [core_part, prerelease_part] = version.trim().split("-", 2);
|
|
24826
|
-
const core = core_part.split(".").map((part) => Number.parseInt(part, 10) || 0);
|
|
24827
|
-
while (core.length < 3) core.push(0);
|
|
24828
|
-
if (prerelease_part === void 0 || prerelease_part === "") return {
|
|
24829
|
-
core,
|
|
24830
|
-
channel: "release",
|
|
24831
|
-
prerelease: []
|
|
24832
|
-
};
|
|
24833
|
-
const prerelease = prerelease_part.split(".").map((part) => /^\d+$/.test(part) ? Number.parseInt(part, 10) : part);
|
|
24834
|
-
return {
|
|
24835
|
-
core,
|
|
24836
|
-
channel: prerelease[0] === "dev" ? "nightly" : "prerelease",
|
|
24837
|
-
prerelease
|
|
24838
|
-
};
|
|
24839
|
-
}
|
|
24840
|
-
const CHANNEL_ORDER = {
|
|
24841
|
-
nightly: 0,
|
|
24842
|
-
prerelease: 1,
|
|
24843
|
-
release: 2
|
|
24844
|
-
};
|
|
24845
|
-
/**
|
|
24846
|
-
* Order two `typescript` package versions. Semantic versioning except in one
|
|
24847
|
-
* respect: TypeScript's `-dev.<yyyymmdd>.<n>` nightlies are cut before the
|
|
24848
|
-
* betas and release candidates of the same `major.minor.patch`, so a
|
|
24849
|
-
* `-beta` or `-rc` build ranks above every nightly of that version, not
|
|
24850
|
-
* below it as plain identifier order would say.
|
|
24851
|
-
* @param {string} a
|
|
24852
|
-
* @param {string} b
|
|
24853
|
-
* @returns {number} Negative when `a` is older than `b`, positive when newer, `0` when equal.
|
|
24854
|
-
*/
|
|
24855
|
-
function compare_typescript_versions(a, b) {
|
|
24856
|
-
const left = parse_typescript_version(a);
|
|
24857
|
-
const right = parse_typescript_version(b);
|
|
24858
|
-
for (let index = 0; index < 3; index++) if (left.core[index] !== right.core[index]) return left.core[index] - right.core[index];
|
|
24859
|
-
if (left.channel !== right.channel) return CHANNEL_ORDER[left.channel] - CHANNEL_ORDER[right.channel];
|
|
24860
|
-
const length = Math.max(left.prerelease.length, right.prerelease.length);
|
|
24861
|
-
for (let index = 0; index < length; index++) {
|
|
24862
|
-
const left_part = left.prerelease[index];
|
|
24863
|
-
const right_part = right.prerelease[index];
|
|
24864
|
-
if (left_part === right_part) continue;
|
|
24865
|
-
if (left_part === void 0) return -1;
|
|
24866
|
-
if (right_part === void 0) return 1;
|
|
24867
|
-
if (typeof left_part === "number" && typeof right_part === "number") return left_part - right_part;
|
|
24868
|
-
if (typeof left_part === "number") return -1;
|
|
24869
|
-
if (typeof right_part === "number") return 1;
|
|
24870
|
-
return left_part < right_part ? -1 : 1;
|
|
24871
|
-
}
|
|
24872
|
-
return 0;
|
|
24873
|
-
}
|
|
24874
|
-
/**
|
|
24875
|
-
* Whether a `typescript` package version is a native TypeScript 7 build that
|
|
24876
|
-
* speaks the content-mapper protocol and is at least
|
|
24877
|
-
* {@link MINIMUM_NATIVE_TYPESCRIPT_VERSION}, so `tsc --runExternalCode` can
|
|
24878
|
-
* type-check `.tsrx` files through `@tsrx/content-mapper`.
|
|
24879
|
-
* @param {string} version
|
|
24880
|
-
* @returns {boolean}
|
|
24881
|
-
*/
|
|
24882
|
-
function has_content_mapper_protocol(version) {
|
|
24883
|
-
return is_native_typescript_package(version) && compare_typescript_versions(version, "7.1.0-dev.20260923.1") >= 0;
|
|
24884
|
-
}
|
|
24885
|
-
/** @typedef {'tsrx-tsc' | 'language-server'} TypeScriptConsumer */
|
|
24886
|
-
/**
|
|
24887
|
-
* The message to show when `typescript` resolved to a package the given tool
|
|
24888
|
-
* cannot run on, or `undefined` when it can. `tsrx-tsc` runs on the classic
|
|
24889
|
-
* range through Volar and on TypeScript 7 builds with the content-mapper
|
|
24890
|
-
* protocol through native `tsc`; only a TypeScript 7 build older than
|
|
24891
|
-
* {@link MINIMUM_NATIVE_TYPESCRIPT_VERSION} (the stable 7.0 releases and the
|
|
24892
|
-
* earlier 7.1 nightlies) is unsupported there.
|
|
24893
|
-
* @param {{ version?: string } | string | undefined} typescript The `typescript` module, or its version.
|
|
24894
|
-
* @param {TypeScriptConsumer} tool
|
|
24895
|
-
* @returns {string | undefined}
|
|
24896
|
-
*/
|
|
24897
|
-
function unsupported_typescript_message(typescript, tool) {
|
|
24898
|
-
const version = typeof typescript === "string" ? typescript : typescript?.version;
|
|
24899
|
-
if (typeof version !== "string" || !is_native_typescript_package(version)) return;
|
|
24900
|
-
const resolved = `resolved typescript@${version}, the native TypeScript compiler, whose npm package has no JavaScript API.`;
|
|
24901
|
-
switch (tool) {
|
|
24902
|
-
case "tsrx-tsc":
|
|
24903
|
-
if (has_content_mapper_protocol(version)) return;
|
|
24904
|
-
return `tsrx-tsc ${resolved} tsrx-tsc runs TypeScript 7 through "tsc --runExternalCode" and @tsrx/content-mapper, which needs a 7.1 nightly with the content-mapper protocol (${MINIMUM_NATIVE_TYPESCRIPT_VERSION} or newer; install typescript@next), or TypeScript ${SUPPORTED_TYPESCRIPT_RANGE} through Volar. ${TYPESCRIPT_7_SUPPORT_NOTE}`;
|
|
24905
|
-
case "language-server": return `The TSRX language server's classic backend ${resolved} The classic backend hosts TypeScript ${SUPPORTED_TYPESCRIPT_RANGE} through Volar: install one of those versions, or run the server with --typescript-backend=native beside TypeScript 7's own language server, which needs no other TypeScript. ${TYPESCRIPT_7_SUPPORT_NOTE}`;
|
|
24906
|
-
}
|
|
24907
|
-
}
|
|
24908
|
-
|
|
24909
24909
|
//#endregion
|
|
24910
24910
|
//#region src/workspaceState.js
|
|
24911
24911
|
const WORKSPACE_FILE_PATTERNS = [
|
|
@@ -25038,6 +25038,19 @@ function handleWorkspaceChanges(changes, hooks, tracked_config_files) {
|
|
|
25038
25038
|
//#region src/server.js
|
|
25039
25039
|
/** @import {CompilerOptions} from 'typescript' */
|
|
25040
25040
|
const { log, logError } = createLogging("[TSRX Language Server]");
|
|
25041
|
+
/** The server's own folder, where the search for a `typescript` package ends. */
|
|
25042
|
+
const SERVER_DIR = node_path.default.dirname((0, node_url.fileURLToPath)(require("url").pathToFileURL(__filename).href));
|
|
25043
|
+
/** Where a `typescript` package came from, for the log. */
|
|
25044
|
+
const TYPESCRIPT_SOURCES = {
|
|
25045
|
+
tsdk: "typescript.tsdk initialization option",
|
|
25046
|
+
workspace: "the project",
|
|
25047
|
+
server: "next to the server"
|
|
25048
|
+
};
|
|
25049
|
+
/**
|
|
25050
|
+
* Sent to a client that set the `restartNotification` initialization option
|
|
25051
|
+
* when the server must restart; the client then restarts the server itself.
|
|
25052
|
+
*/
|
|
25053
|
+
const RESTART_NOTIFICATION = "tsrx/restartServer";
|
|
25041
25054
|
/**
|
|
25042
25055
|
* @param {{ argv?: readonly string[] }} [options] `argv` defaults to the process
|
|
25043
25056
|
* arguments; it carries the `--typescript-backend=<classic|native>` flag.
|
|
@@ -25055,10 +25068,27 @@ function createTsrxLanguageServer(options = {}) {
|
|
|
25055
25068
|
/** @type {Set<Set<string>>} */
|
|
25056
25069
|
const compilerResolutionDependencySets = /* @__PURE__ */ new Set();
|
|
25057
25070
|
let restartScheduled = false;
|
|
25058
|
-
|
|
25071
|
+
let clientRestarts = false;
|
|
25072
|
+
/**
|
|
25073
|
+
* Shown once the client is initialized, when the classic backend found no
|
|
25074
|
+
* `typescript` it can run and the server started without TypeScript features.
|
|
25075
|
+
* @type {string | undefined}
|
|
25076
|
+
*/
|
|
25077
|
+
let typescriptNotice;
|
|
25078
|
+
/**
|
|
25079
|
+
* Restart the process so Node drops the complete ESM compiler graph. A
|
|
25080
|
+
* client that restarts the server itself stops sending first. When the
|
|
25081
|
+
* server exits by itself, the client's next message fails (VS Code showed
|
|
25082
|
+
* "Cannot call write after a stream was destroyed").
|
|
25083
|
+
*/
|
|
25059
25084
|
function restartLanguageServer() {
|
|
25060
25085
|
if (restartScheduled) return;
|
|
25061
25086
|
restartScheduled = true;
|
|
25087
|
+
if (clientRestarts) {
|
|
25088
|
+
log("Asking the client to restart the server after package state changed.");
|
|
25089
|
+
connection.sendNotification(RESTART_NOTIFICATION);
|
|
25090
|
+
return;
|
|
25091
|
+
}
|
|
25062
25092
|
log("Restarting after package state changed.");
|
|
25063
25093
|
setTimeout(() => process.exit(0), 50);
|
|
25064
25094
|
}
|
|
@@ -25090,56 +25120,63 @@ function createTsrxLanguageServer(options = {}) {
|
|
|
25090
25120
|
host[method] = wrapped;
|
|
25091
25121
|
}
|
|
25092
25122
|
/**
|
|
25093
|
-
* Load the TypeScript the classic backend hosts
|
|
25094
|
-
*
|
|
25095
|
-
*
|
|
25096
|
-
*
|
|
25097
|
-
*
|
|
25098
|
-
* option, the `typescript` package resolvable from the server (its peer
|
|
25099
|
-
* dependency) is used, as before.
|
|
25100
|
-
* @param {string | undefined} tsdk
|
|
25123
|
+
* Load the TypeScript the classic backend hosts (`find_typescript`). Every
|
|
25124
|
+
* later `require('typescript')` in this process (the shared transform's option
|
|
25125
|
+
* defaults, Volar's TypeScript service) resolves to the same module, so one
|
|
25126
|
+
* TypeScript runs.
|
|
25127
|
+
* @param {import('./find-typescript.js').FoundTypeScript} found
|
|
25101
25128
|
* @returns {typeof import('typescript')}
|
|
25102
25129
|
*/
|
|
25103
|
-
function load_typescript(
|
|
25104
|
-
|
|
25105
|
-
const bundled = require("typescript");
|
|
25106
|
-
log(`TypeScript ${bundled.version} from the typescript package next to the server`);
|
|
25107
|
-
return bundled;
|
|
25108
|
-
}
|
|
25109
|
-
const typescript_js = node_path.default.join(tsdk, "typescript.js");
|
|
25130
|
+
function load_typescript(found) {
|
|
25131
|
+
const typescript_js = node_path.default.join(found.lib, "typescript.js");
|
|
25110
25132
|
const module_loader = node_module.default;
|
|
25111
25133
|
const original_resolve = module_loader._resolveFilename;
|
|
25112
25134
|
module_loader._resolveFilename = function(request, ...rest) {
|
|
25113
25135
|
return request === "typescript" ? typescript_js : original_resolve.call(this, request, ...rest);
|
|
25114
25136
|
};
|
|
25115
25137
|
const loaded = require(typescript_js);
|
|
25116
|
-
log(`TypeScript ${loaded.version} from ${
|
|
25138
|
+
log(`TypeScript ${loaded.version} from ${found.dir} (${TYPESCRIPT_SOURCES[found.source]})`);
|
|
25117
25139
|
return loaded;
|
|
25118
25140
|
}
|
|
25119
25141
|
connection.onInitialize(async (params) => {
|
|
25120
25142
|
try {
|
|
25121
25143
|
log("Initializing TSRX language server...");
|
|
25122
25144
|
log("Initialization options:", JSON.stringify(params.initializationOptions, null, 2));
|
|
25145
|
+
clientRestarts = params.initializationOptions?.restartNotification === true;
|
|
25123
25146
|
const selection = resolve_typescript_backend({
|
|
25124
25147
|
argv,
|
|
25125
25148
|
initializationOptions: params.initializationOptions
|
|
25126
25149
|
});
|
|
25127
25150
|
if (selection.invalid !== void 0) logError(`Unknown TypeScript backend ${JSON.stringify(selection.invalid)}; using "${selection.backend}".`);
|
|
25128
25151
|
log(`TypeScript backend: ${selection.backend} (from ${selection.source})`);
|
|
25129
|
-
|
|
25152
|
+
let backend = selection.backend;
|
|
25153
|
+
/** @type {typeof import('typescript') | undefined} */
|
|
25154
|
+
let ts;
|
|
25155
|
+
if (backend === "classic") {
|
|
25156
|
+
const workspace_dirs = workspace_folder_paths(params);
|
|
25157
|
+
const found = find_typescript({
|
|
25158
|
+
tsdk: resolve_typescript_tsdk(params.initializationOptions),
|
|
25159
|
+
workspace_dirs,
|
|
25160
|
+
server_dir: SERVER_DIR
|
|
25161
|
+
});
|
|
25162
|
+
if (found && is_usable_typescript(found.version)) ts = load_typescript(found);
|
|
25163
|
+
else {
|
|
25164
|
+
typescriptNotice = typescript_notice(found, workspace_dirs);
|
|
25165
|
+
logError(typescriptNotice);
|
|
25166
|
+
backend = "plugin";
|
|
25167
|
+
}
|
|
25168
|
+
}
|
|
25169
|
+
if (ts === void 0) {
|
|
25130
25170
|
const compilerResolutionDependencies = /* @__PURE__ */ new Set();
|
|
25131
25171
|
compilerResolutionDependencySets.add(compilerResolutionDependencies);
|
|
25132
25172
|
const languagePlugin = getTsrxLanguagePlugin({
|
|
25133
25173
|
configHost: NODE_CONFIG_HOST,
|
|
25134
25174
|
dependencies: compilerResolutionDependencies
|
|
25135
25175
|
});
|
|
25136
|
-
const initResult = server.initialize(params, (0, import_node.createSimpleProject)([languagePlugin]), createServicePlugins(
|
|
25137
|
-
log("Server initialization complete
|
|
25176
|
+
const initResult = server.initialize(params, (0, import_node.createSimpleProject)([languagePlugin]), createServicePlugins(backend));
|
|
25177
|
+
log("Server initialization complete");
|
|
25138
25178
|
return with_formatting(initResult);
|
|
25139
25179
|
}
|
|
25140
|
-
const ts = load_typescript(resolve_typescript_tsdk(params.initializationOptions));
|
|
25141
|
-
const unsupported_typescript = unsupported_typescript_message(ts, "language-server");
|
|
25142
|
-
if (unsupported_typescript) throw new Error(unsupported_typescript);
|
|
25143
25180
|
const initResult = server.initialize(params, (0, import_node.createTypeScriptProject)(ts, void 0, ({ configFileName, projectHost, sys }) => {
|
|
25144
25181
|
wrapCompilerOptionsProvider(projectHost, "getCompilationSettings");
|
|
25145
25182
|
const compilerResolutionDependencies = /* @__PURE__ */ new Set();
|
|
@@ -25161,7 +25198,7 @@ function createTsrxLanguageServer(options = {}) {
|
|
|
25161
25198
|
});
|
|
25162
25199
|
}
|
|
25163
25200
|
};
|
|
25164
|
-
}), createServicePlugins(
|
|
25201
|
+
}), createServicePlugins(backend, ts));
|
|
25165
25202
|
log("Server initialization complete");
|
|
25166
25203
|
return with_formatting(initResult);
|
|
25167
25204
|
} catch (initError) {
|
|
@@ -25172,6 +25209,10 @@ function createTsrxLanguageServer(options = {}) {
|
|
|
25172
25209
|
connection.onInitialized(async () => {
|
|
25173
25210
|
log("Server initialized.");
|
|
25174
25211
|
server.initialized();
|
|
25212
|
+
if (typescriptNotice) connection.sendNotification("window/showMessage", {
|
|
25213
|
+
type: 2,
|
|
25214
|
+
message: typescriptNotice
|
|
25215
|
+
});
|
|
25175
25216
|
server.fileWatcher.onDidChangeWatchedFiles(({ changes }) => {
|
|
25176
25217
|
for (const configDependencies of compilerResolutionDependencySets) trackTypeScriptConfigDependencies(trackedTypeScriptConfigFiles, { configDependencies });
|
|
25177
25218
|
if (handleWorkspaceChanges(changes, {
|
|
@@ -25214,8 +25255,28 @@ function with_formatting(initResult) {
|
|
|
25214
25255
|
initResult.capabilities.documentRangeFormattingProvider = true;
|
|
25215
25256
|
return initResult;
|
|
25216
25257
|
}
|
|
25258
|
+
/**
|
|
25259
|
+
* The paths of the open workspace folders (`file:` URIs only), or of the root
|
|
25260
|
+
* the client sent instead. A client that names no folder (Neovim when it finds no
|
|
25261
|
+
* root marker, for a single file) starts the server in the file's project, so the
|
|
25262
|
+
* server's working directory stands in.
|
|
25263
|
+
* @param {import('@volar/language-server/node').InitializeParams} params
|
|
25264
|
+
* @returns {string[]}
|
|
25265
|
+
*/
|
|
25266
|
+
function workspace_folder_paths(params) {
|
|
25267
|
+
const paths = (params.workspaceFolders?.map((folder) => folder.uri) ?? (params.rootUri ? [params.rootUri] : [])).map((uri) => vscode_uri.URI.parse(uri)).filter((uri) => uri.scheme === "file").map((uri) => uri.fsPath);
|
|
25268
|
+
if (paths.length === 0 && params.rootPath) paths.push(params.rootPath);
|
|
25269
|
+
if (paths.length === 0) paths.push(process.cwd());
|
|
25270
|
+
return paths;
|
|
25271
|
+
}
|
|
25217
25272
|
|
|
25218
25273
|
//#endregion
|
|
25274
|
+
Object.defineProperty(exports, 'RESTART_NOTIFICATION', {
|
|
25275
|
+
enumerable: true,
|
|
25276
|
+
get: function () {
|
|
25277
|
+
return RESTART_NOTIFICATION;
|
|
25278
|
+
}
|
|
25279
|
+
});
|
|
25219
25280
|
Object.defineProperty(exports, '__toCommonJS', {
|
|
25220
25281
|
enumerable: true,
|
|
25221
25282
|
get: function () {
|
|
@@ -25228,4 +25289,4 @@ Object.defineProperty(exports, 'createTsrxLanguageServer', {
|
|
|
25228
25289
|
return createTsrxLanguageServer;
|
|
25229
25290
|
}
|
|
25230
25291
|
});
|
|
25231
|
-
//# sourceMappingURL=server-
|
|
25292
|
+
//# sourceMappingURL=server-BnzVhVsF.js.map
|