@abaplint/cli 2.102.46 → 2.102.47

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (2) hide show
  1. package/build/cli.js +2269 -2163
  2. package/package.json +4 -4
package/build/cli.js CHANGED
@@ -3401,6 +3401,27 @@ exports.AttributeName = AttributeName;
3401
3401
 
3402
3402
  /***/ }),
3403
3403
 
3404
+ /***/ "./node_modules/@abaplint/core/build/src/abap/2_statements/expressions/behavior_definition_name.js":
3405
+ /*!*********************************************************************************************************!*\
3406
+ !*** ./node_modules/@abaplint/core/build/src/abap/2_statements/expressions/behavior_definition_name.js ***!
3407
+ \*********************************************************************************************************/
3408
+ /***/ ((__unused_webpack_module, exports, __webpack_require__) => {
3409
+
3410
+ "use strict";
3411
+
3412
+ Object.defineProperty(exports, "__esModule", ({ value: true }));
3413
+ exports.BehaviorDefinitionName = void 0;
3414
+ const combi_1 = __webpack_require__(/*! ../combi */ "./node_modules/@abaplint/core/build/src/abap/2_statements/combi.js");
3415
+ class BehaviorDefinitionName extends combi_1.Expression {
3416
+ getRunnable() {
3417
+ return (0, combi_1.regex)(/^((\w*\/\w+\/)|(\w*\/\w+\/)?[\w\*$%]+)$/);
3418
+ }
3419
+ }
3420
+ exports.BehaviorDefinitionName = BehaviorDefinitionName;
3421
+ //# sourceMappingURL=behavior_definition_name.js.map
3422
+
3423
+ /***/ }),
3424
+
3404
3425
  /***/ "./node_modules/@abaplint/core/build/src/abap/2_statements/expressions/block_name.js":
3405
3426
  /*!*******************************************************************************************!*\
3406
3427
  !*** ./node_modules/@abaplint/core/build/src/abap/2_statements/expressions/block_name.js ***!
@@ -5048,6 +5069,7 @@ __exportStar(__webpack_require__(/*! ./assign_source */ "./node_modules/@abaplin
5048
5069
  __exportStar(__webpack_require__(/*! ./association_name */ "./node_modules/@abaplint/core/build/src/abap/2_statements/expressions/association_name.js"), exports);
5049
5070
  __exportStar(__webpack_require__(/*! ./attribute_chain */ "./node_modules/@abaplint/core/build/src/abap/2_statements/expressions/attribute_chain.js"), exports);
5050
5071
  __exportStar(__webpack_require__(/*! ./attribute_name */ "./node_modules/@abaplint/core/build/src/abap/2_statements/expressions/attribute_name.js"), exports);
5072
+ __exportStar(__webpack_require__(/*! ./behavior_definition_name */ "./node_modules/@abaplint/core/build/src/abap/2_statements/expressions/behavior_definition_name.js"), exports);
5051
5073
  __exportStar(__webpack_require__(/*! ./block_name */ "./node_modules/@abaplint/core/build/src/abap/2_statements/expressions/block_name.js"), exports);
5052
5074
  __exportStar(__webpack_require__(/*! ./call_transformation_options */ "./node_modules/@abaplint/core/build/src/abap/2_statements/expressions/call_transformation_options.js"), exports);
5053
5075
  __exportStar(__webpack_require__(/*! ./call_transformation_parameters */ "./node_modules/@abaplint/core/build/src/abap/2_statements/expressions/call_transformation_parameters.js"), exports);
@@ -10038,7 +10060,7 @@ class ClassDefinition {
10038
10060
  const risk = (0, combi_1.seq)("RISK LEVEL", level);
10039
10061
  const time = (0, combi_1.altPrio)("LONG", "MEDIUM", "SHORT");
10040
10062
  const duration = (0, combi_1.seq)("DURATION", time);
10041
- const blah = (0, combi_1.per)(expressions_1.ClassGlobal, expressions_1.ClassFinal, "ABSTRACT", (0, combi_1.seq)("INHERITING FROM", expressions_1.SuperClassName), create, "FOR TESTING", risk, "SHARED MEMORY ENABLED", duration, (0, combi_1.ver)(version_1.Version.v754, (0, combi_1.seq)("FOR BEHAVIOR OF", expressions_1.NamespaceSimpleName)), expressions_1.ClassFriends);
10063
+ const blah = (0, combi_1.per)(expressions_1.ClassGlobal, expressions_1.ClassFinal, "ABSTRACT", (0, combi_1.seq)("INHERITING FROM", expressions_1.SuperClassName), create, "FOR TESTING", risk, "SHARED MEMORY ENABLED", duration, (0, combi_1.ver)(version_1.Version.v754, (0, combi_1.seq)("FOR BEHAVIOR OF", expressions_1.BehaviorDefinitionName)), expressions_1.ClassFriends);
10042
10064
  const def = (0, combi_1.seq)("DEFINITION", (0, combi_1.optPrio)(blah));
10043
10065
  return (0, combi_1.seq)("CLASS", expressions_1.ClassName, def);
10044
10066
  }
@@ -25542,9 +25564,15 @@ class Select {
25542
25564
  const token = node.getFirstToken();
25543
25565
  const from = node.findDirectExpression(Expressions.SQLFrom);
25544
25566
  const dbSources = from ? new sql_from_1.SQLFrom().runSyntax(from, scope, filename) : [];
25567
+ const fields = this.findFields(node);
25568
+ if (fields.length === 0
25569
+ && node.findDirectExpression(Expressions.SQLFieldListLoop) === undefined) {
25570
+ throw new Error(`fields missing`);
25571
+ }
25572
+ this.checkFields(fields, dbSources, scope);
25545
25573
  for (const inline of node.findAllExpressions(Expressions.InlineData)) {
25546
25574
  // todo, for now these are voided
25547
- new inline_data_1.InlineData().runSyntax(inline, scope, filename, new basic_1.VoidType("SELECT_todo"));
25575
+ new inline_data_1.InlineData().runSyntax(inline, scope, filename, this.buildType(fields));
25548
25576
  }
25549
25577
  const fae = node.findDirectExpression(Expressions.SQLForAllEntries);
25550
25578
  if (fae) {
@@ -25588,6 +25616,59 @@ class Select {
25588
25616
  scope.pop(node.getLastToken().getEnd());
25589
25617
  }
25590
25618
  }
25619
+ checkFields(fields, dbSources, scope) {
25620
+ if (dbSources.length > 1) {
25621
+ return;
25622
+ }
25623
+ const first = dbSources[0];
25624
+ if (first === undefined) {
25625
+ // then its voided
25626
+ return;
25627
+ }
25628
+ const type = first.parseType(scope.getRegistry());
25629
+ if (type instanceof basic_1.VoidType || type instanceof basic_1.UnknownType) {
25630
+ return;
25631
+ }
25632
+ if (!(type instanceof basic_1.StructureType)) {
25633
+ throw new Error("checkFields, expected structure, " + type.constructor.name);
25634
+ }
25635
+ const isSimple = /^\w+$/;
25636
+ for (const field of fields) {
25637
+ if (field.code === "*") {
25638
+ continue;
25639
+ }
25640
+ if (isSimple.test(field.code) && type.getComponentByName(field.code) === undefined) {
25641
+ throw new Error(`checkFields, field ${field.code} not found`);
25642
+ }
25643
+ }
25644
+ }
25645
+ buildType(_fields) {
25646
+ return new basic_1.VoidType("SELECT_todo");
25647
+ }
25648
+ findFields(node) {
25649
+ var _a;
25650
+ let expr = undefined;
25651
+ const ret = [];
25652
+ expr = node.findDirectExpression(Expressions.SQLFieldList);
25653
+ if (expr === undefined) {
25654
+ expr = node.findDirectExpression(Expressions.SQLFields);
25655
+ }
25656
+ if (expr === undefined) {
25657
+ node.findDirectExpression(Expressions.SQLFieldName);
25658
+ }
25659
+ for (const field of (expr === null || expr === void 0 ? void 0 : expr.findAllExpressions(Expressions.SQLField)) || []) {
25660
+ let code = field.concatTokens().toUpperCase();
25661
+ const as = ((_a = field.findDirectExpression(Expressions.SQLAsName)) === null || _a === void 0 ? void 0 : _a.concatTokens()) || "";
25662
+ if (as !== "") {
25663
+ code = code.replace(" AS " + as, "");
25664
+ }
25665
+ ret.push({ code, as, expression: field });
25666
+ }
25667
+ if (ret.length === 0 && expr) {
25668
+ ret.push({ code: expr.concatTokens(), as: "", expression: expr });
25669
+ }
25670
+ return ret;
25671
+ }
25591
25672
  }
25592
25673
  exports.Select = Select;
25593
25674
  //# sourceMappingURL=select.js.map
@@ -40019,7 +40100,7 @@ exports.Issue = Issue;
40019
40100
 
40020
40101
  Object.defineProperty(exports, "__esModule", ({ value: true }));
40021
40102
  exports.LSPEdit = void 0;
40022
- const LServer = __webpack_require__(/*! vscode-languageserver-types */ "./node_modules/vscode-languageserver-types/lib/esm/main.js");
40103
+ const LServer = __webpack_require__(/*! vscode-languageserver-types */ "./node_modules/vscode-languageserver-types/lib/umd/main.js");
40023
40104
  class LSPEdit {
40024
40105
  static mapEdits(edits) {
40025
40106
  const workspace = { changes: {} };
@@ -40094,7 +40175,7 @@ Object.defineProperty(exports, "__esModule", ({ value: true }));
40094
40175
  Object.defineProperty(exports, "__esModule", ({ value: true }));
40095
40176
  exports.LSPLookup = void 0;
40096
40177
  /* eslint-disable max-len */
40097
- const LServer = __webpack_require__(/*! vscode-languageserver-types */ "./node_modules/vscode-languageserver-types/lib/esm/main.js");
40178
+ const LServer = __webpack_require__(/*! vscode-languageserver-types */ "./node_modules/vscode-languageserver-types/lib/umd/main.js");
40098
40179
  const Statements = __webpack_require__(/*! ../abap/2_statements/statements */ "./node_modules/@abaplint/core/build/src/abap/2_statements/statements/index.js");
40099
40180
  const Expressions = __webpack_require__(/*! ../abap/2_statements/expressions */ "./node_modules/@abaplint/core/build/src/abap/2_statements/expressions/index.js");
40100
40181
  const syntax_1 = __webpack_require__(/*! ../abap/5_syntax/syntax */ "./node_modules/@abaplint/core/build/src/abap/5_syntax/syntax.js");
@@ -40451,7 +40532,7 @@ const nodes_1 = __webpack_require__(/*! ../abap/nodes */ "./node_modules/@abapli
40451
40532
  const _identifier_1 = __webpack_require__(/*! ../abap/4_file_information/_identifier */ "./node_modules/@abaplint/core/build/src/abap/4_file_information/_identifier.js");
40452
40533
  const _abap_object_1 = __webpack_require__(/*! ../objects/_abap_object */ "./node_modules/@abaplint/core/build/src/objects/_abap_object.js");
40453
40534
  const position_1 = __webpack_require__(/*! ../position */ "./node_modules/@abaplint/core/build/src/position.js");
40454
- const LServer = __webpack_require__(/*! vscode-languageserver-types */ "./node_modules/vscode-languageserver-types/lib/esm/main.js");
40535
+ const LServer = __webpack_require__(/*! vscode-languageserver-types */ "./node_modules/vscode-languageserver-types/lib/umd/main.js");
40455
40536
  class LSPUtils {
40456
40537
  static getABAPFile(reg, filename) {
40457
40538
  const file = reg.getFileByName(filename);
@@ -40536,7 +40617,7 @@ exports.LSPUtils = LSPUtils;
40536
40617
 
40537
40618
  Object.defineProperty(exports, "__esModule", ({ value: true }));
40538
40619
  exports.CodeActions = void 0;
40539
- const LServer = __webpack_require__(/*! vscode-languageserver-types */ "./node_modules/vscode-languageserver-types/lib/esm/main.js");
40620
+ const LServer = __webpack_require__(/*! vscode-languageserver-types */ "./node_modules/vscode-languageserver-types/lib/umd/main.js");
40540
40621
  const diagnostics_1 = __webpack_require__(/*! ./diagnostics */ "./node_modules/@abaplint/core/build/src/lsp/diagnostics.js");
40541
40622
  const position_1 = __webpack_require__(/*! ../position */ "./node_modules/@abaplint/core/build/src/position.js");
40542
40623
  const _edit_1 = __webpack_require__(/*! ./_edit */ "./node_modules/@abaplint/core/build/src/lsp/_edit.js");
@@ -40626,7 +40707,7 @@ exports.CodeActions = CodeActions;
40626
40707
 
40627
40708
  Object.defineProperty(exports, "__esModule", ({ value: true }));
40628
40709
  exports.CodeLens = void 0;
40629
- const LServer = __webpack_require__(/*! vscode-languageserver-types */ "./node_modules/vscode-languageserver-types/lib/esm/main.js");
40710
+ const LServer = __webpack_require__(/*! vscode-languageserver-types */ "./node_modules/vscode-languageserver-types/lib/umd/main.js");
40630
40711
  const _lsp_utils_1 = __webpack_require__(/*! ./_lsp_utils */ "./node_modules/@abaplint/core/build/src/lsp/_lsp_utils.js");
40631
40712
  const syntax_1 = __webpack_require__(/*! ../abap/5_syntax/syntax */ "./node_modules/@abaplint/core/build/src/abap/5_syntax/syntax.js");
40632
40713
  const _abap_object_1 = __webpack_require__(/*! ../objects/_abap_object */ "./node_modules/@abaplint/core/build/src/objects/_abap_object.js");
@@ -40774,7 +40855,7 @@ exports.Definition = Definition;
40774
40855
 
40775
40856
  Object.defineProperty(exports, "__esModule", ({ value: true }));
40776
40857
  exports.Diagnostics = void 0;
40777
- const LServer = __webpack_require__(/*! vscode-languageserver-types */ "./node_modules/vscode-languageserver-types/lib/esm/main.js");
40858
+ const LServer = __webpack_require__(/*! vscode-languageserver-types */ "./node_modules/vscode-languageserver-types/lib/umd/main.js");
40778
40859
  const _lsp_utils_1 = __webpack_require__(/*! ./_lsp_utils */ "./node_modules/@abaplint/core/build/src/lsp/_lsp_utils.js");
40779
40860
  const severity_1 = __webpack_require__(/*! ../severity */ "./node_modules/@abaplint/core/build/src/severity.js");
40780
40861
  class Diagnostics {
@@ -41273,7 +41354,7 @@ exports.Highlight = Highlight;
41273
41354
 
41274
41355
  Object.defineProperty(exports, "__esModule", ({ value: true }));
41275
41356
  exports.Hover = void 0;
41276
- const LServer = __webpack_require__(/*! vscode-languageserver-types */ "./node_modules/vscode-languageserver-types/lib/esm/main.js");
41357
+ const LServer = __webpack_require__(/*! vscode-languageserver-types */ "./node_modules/vscode-languageserver-types/lib/umd/main.js");
41277
41358
  const _abap_object_1 = __webpack_require__(/*! ../objects/_abap_object */ "./node_modules/@abaplint/core/build/src/objects/_abap_object.js");
41278
41359
  const _lsp_utils_1 = __webpack_require__(/*! ./_lsp_utils */ "./node_modules/@abaplint/core/build/src/lsp/_lsp_utils.js");
41279
41360
  const Tokens = __webpack_require__(/*! ../abap/1_lexer/tokens */ "./node_modules/@abaplint/core/build/src/abap/1_lexer/tokens/index.js");
@@ -41410,7 +41491,7 @@ exports.Implementation = Implementation;
41410
41491
 
41411
41492
  Object.defineProperty(exports, "__esModule", ({ value: true }));
41412
41493
  exports.InlayHints = void 0;
41413
- const LServer = __webpack_require__(/*! vscode-languageserver-types */ "./node_modules/vscode-languageserver-types/lib/esm/main.js");
41494
+ const LServer = __webpack_require__(/*! vscode-languageserver-types */ "./node_modules/vscode-languageserver-types/lib/umd/main.js");
41414
41495
  const _lsp_utils_1 = __webpack_require__(/*! ./_lsp_utils */ "./node_modules/@abaplint/core/build/src/lsp/_lsp_utils.js");
41415
41496
  const syntax_1 = __webpack_require__(/*! ../abap/5_syntax/syntax */ "./node_modules/@abaplint/core/build/src/abap/5_syntax/syntax.js");
41416
41497
  const _abap_object_1 = __webpack_require__(/*! ../objects/_abap_object */ "./node_modules/@abaplint/core/build/src/objects/_abap_object.js");
@@ -41485,7 +41566,7 @@ exports.InlayHints = InlayHints;
41485
41566
 
41486
41567
  Object.defineProperty(exports, "__esModule", ({ value: true }));
41487
41568
  exports.LanguageServer = void 0;
41488
- const LServer = __webpack_require__(/*! vscode-languageserver-types */ "./node_modules/vscode-languageserver-types/lib/esm/main.js");
41569
+ const LServer = __webpack_require__(/*! vscode-languageserver-types */ "./node_modules/vscode-languageserver-types/lib/umd/main.js");
41489
41570
  const symbols_1 = __webpack_require__(/*! ./symbols */ "./node_modules/@abaplint/core/build/src/lsp/symbols.js");
41490
41571
  const hover_1 = __webpack_require__(/*! ./hover */ "./node_modules/@abaplint/core/build/src/lsp/hover.js");
41491
41572
  const diagnostics_1 = __webpack_require__(/*! ./diagnostics */ "./node_modules/@abaplint/core/build/src/lsp/diagnostics.js");
@@ -41750,7 +41831,7 @@ exports.References = References;
41750
41831
 
41751
41832
  Object.defineProperty(exports, "__esModule", ({ value: true }));
41752
41833
  exports.Rename = exports.RenameType = void 0;
41753
- const LServer = __webpack_require__(/*! vscode-languageserver-types */ "./node_modules/vscode-languageserver-types/lib/esm/main.js");
41834
+ const LServer = __webpack_require__(/*! vscode-languageserver-types */ "./node_modules/vscode-languageserver-types/lib/umd/main.js");
41754
41835
  const _lsp_utils_1 = __webpack_require__(/*! ./_lsp_utils */ "./node_modules/@abaplint/core/build/src/lsp/_lsp_utils.js");
41755
41836
  const _abap_object_1 = __webpack_require__(/*! ../objects/_abap_object */ "./node_modules/@abaplint/core/build/src/objects/_abap_object.js");
41756
41837
  const _lookup_1 = __webpack_require__(/*! ./_lookup */ "./node_modules/@abaplint/core/build/src/lsp/_lookup.js");
@@ -41867,7 +41948,7 @@ exports.Rename = Rename;
41867
41948
 
41868
41949
  Object.defineProperty(exports, "__esModule", ({ value: true }));
41869
41950
  exports.SemanticHighlighting = void 0;
41870
- const LServer = __webpack_require__(/*! vscode-languageserver-types */ "./node_modules/vscode-languageserver-types/lib/esm/main.js");
41951
+ const LServer = __webpack_require__(/*! vscode-languageserver-types */ "./node_modules/vscode-languageserver-types/lib/umd/main.js");
41871
41952
  const position_1 = __webpack_require__(/*! ../position */ "./node_modules/@abaplint/core/build/src/position.js");
41872
41953
  const tokens_1 = __webpack_require__(/*! ../abap/1_lexer/tokens */ "./node_modules/@abaplint/core/build/src/abap/1_lexer/tokens/index.js");
41873
41954
  const nodes_1 = __webpack_require__(/*! ../abap/nodes */ "./node_modules/@abaplint/core/build/src/abap/nodes/index.js");
@@ -42009,8 +42090,10 @@ SemanticHighlighting.tokenTypes = [];
42009
42090
 
42010
42091
  Object.defineProperty(exports, "__esModule", ({ value: true }));
42011
42092
  exports.Symbols = void 0;
42012
- const LServer = __webpack_require__(/*! vscode-languageserver-types */ "./node_modules/vscode-languageserver-types/lib/esm/main.js");
42093
+ /* eslint-disable max-len */
42094
+ const LServer = __webpack_require__(/*! vscode-languageserver-types */ "./node_modules/vscode-languageserver-types/lib/umd/main.js");
42013
42095
  const _lsp_utils_1 = __webpack_require__(/*! ./_lsp_utils */ "./node_modules/@abaplint/core/build/src/lsp/_lsp_utils.js");
42096
+ const statements_1 = __webpack_require__(/*! ../abap/2_statements/statements */ "./node_modules/@abaplint/core/build/src/abap/2_statements/statements/index.js");
42014
42097
  class Symbols {
42015
42098
  constructor(reg) {
42016
42099
  this.reg = reg;
@@ -42035,6 +42118,16 @@ class Symbols {
42035
42118
  const end = identifer.getEnd();
42036
42119
  return LServer.Range.create(start.getRow() - 1, start.getCol() - 1, end.getRow() - 1, end.getCol() - 1);
42037
42120
  }
42121
+ newSymbolRanged(identifier, kind, children, range) {
42122
+ const symbol = {
42123
+ name: identifier.getName(),
42124
+ kind: kind,
42125
+ range: range,
42126
+ selectionRange: this.selectionRange(identifier),
42127
+ children,
42128
+ };
42129
+ return symbol;
42130
+ }
42038
42131
  newSymbol(identifier, kind, children) {
42039
42132
  const symbol = {
42040
42133
  name: identifier.getName(),
@@ -42058,22 +42151,36 @@ class Symbols {
42058
42151
  for (const cla of file.getInfo().listClassDefinitions()) {
42059
42152
  const children = [];
42060
42153
  children.push(...this.outputClassAttributes(cla.attributes));
42061
- children.push(...this.outputMethodDefinitions(cla.methods));
42062
42154
  const symbol = this.newSymbol(cla.identifier, LServer.SymbolKind.Class, children);
42063
42155
  ret.push(symbol);
42064
42156
  }
42065
42157
  for (const cla of file.getInfo().listClassImplementations()) {
42066
42158
  const children = [];
42067
- children.push(...this.outputMethodImplementations(cla.methods));
42159
+ children.push(...this.outputMethodImplementations(cla.methods, file));
42068
42160
  const symbol = this.newSymbol(cla.identifier, LServer.SymbolKind.Class, children);
42069
42161
  ret.push(symbol);
42070
42162
  }
42071
42163
  return ret;
42072
42164
  }
42073
- outputMethodImplementations(methods) {
42165
+ outputMethodImplementations(methods, file) {
42074
42166
  const ret = [];
42075
42167
  for (const method of methods) {
42076
- const symbol = this.newSymbol(method, LServer.SymbolKind.Method, []);
42168
+ const start = method.getStart();
42169
+ let end = undefined;
42170
+ for (const s of file.getStatements()) {
42171
+ if (s.getFirstToken().getStart().isBefore(start)) {
42172
+ continue;
42173
+ }
42174
+ if (s.get() instanceof statements_1.EndMethod) {
42175
+ end = s.getLastToken().getEnd();
42176
+ break;
42177
+ }
42178
+ }
42179
+ if (end === undefined) {
42180
+ continue;
42181
+ }
42182
+ const range = LServer.Range.create(start.getRow() - 1, start.getCol() - 1, end.getRow() - 1, end.getCol() - 1);
42183
+ const symbol = this.newSymbolRanged(method, LServer.SymbolKind.Method, [], range);
42077
42184
  ret.push(symbol);
42078
42185
  }
42079
42186
  return ret;
@@ -42089,13 +42196,6 @@ class Symbols {
42089
42196
  // todo, also add constants
42090
42197
  return ret;
42091
42198
  }
42092
- outputMethodDefinitions(methods) {
42093
- if (methods === undefined) {
42094
- return [];
42095
- }
42096
- // todo
42097
- return [];
42098
- }
42099
42199
  }
42100
42200
  exports.Symbols = Symbols;
42101
42201
  //# sourceMappingURL=symbols.js.map
@@ -46476,7 +46576,7 @@ Object.defineProperty(exports, "__esModule", ({ value: true }));
46476
46576
  exports.RenameGlobalClass = void 0;
46477
46577
  const Statements = __webpack_require__(/*! ../../abap/2_statements/statements */ "./node_modules/@abaplint/core/build/src/abap/2_statements/statements/index.js");
46478
46578
  const Expressions = __webpack_require__(/*! ../../abap/2_statements/expressions */ "./node_modules/@abaplint/core/build/src/abap/2_statements/expressions/index.js");
46479
- const vscode_languageserver_types_1 = __webpack_require__(/*! vscode-languageserver-types */ "./node_modules/vscode-languageserver-types/lib/esm/main.js");
46579
+ const vscode_languageserver_types_1 = __webpack_require__(/*! vscode-languageserver-types */ "./node_modules/vscode-languageserver-types/lib/umd/main.js");
46480
46580
  const __1 = __webpack_require__(/*! .. */ "./node_modules/@abaplint/core/build/src/objects/index.js");
46481
46581
  const _lsp_utils_1 = __webpack_require__(/*! ../../lsp/_lsp_utils */ "./node_modules/@abaplint/core/build/src/lsp/_lsp_utils.js");
46482
46582
  const renamer_helper_1 = __webpack_require__(/*! ./renamer_helper */ "./node_modules/@abaplint/core/build/src/objects/rename/renamer_helper.js");
@@ -46541,7 +46641,7 @@ Object.defineProperty(exports, "__esModule", ({ value: true }));
46541
46641
  exports.RenameGlobalInterface = void 0;
46542
46642
  const Statements = __webpack_require__(/*! ../../abap/2_statements/statements */ "./node_modules/@abaplint/core/build/src/abap/2_statements/statements/index.js");
46543
46643
  const Expressions = __webpack_require__(/*! ../../abap/2_statements/expressions */ "./node_modules/@abaplint/core/build/src/abap/2_statements/expressions/index.js");
46544
- const vscode_languageserver_types_1 = __webpack_require__(/*! vscode-languageserver-types */ "./node_modules/vscode-languageserver-types/lib/esm/main.js");
46644
+ const vscode_languageserver_types_1 = __webpack_require__(/*! vscode-languageserver-types */ "./node_modules/vscode-languageserver-types/lib/umd/main.js");
46545
46645
  const _lsp_utils_1 = __webpack_require__(/*! ../../lsp/_lsp_utils */ "./node_modules/@abaplint/core/build/src/lsp/_lsp_utils.js");
46546
46646
  const renamer_helper_1 = __webpack_require__(/*! ./renamer_helper */ "./node_modules/@abaplint/core/build/src/objects/rename/renamer_helper.js");
46547
46647
  const interface_1 = __webpack_require__(/*! ../interface */ "./node_modules/@abaplint/core/build/src/objects/interface.js");
@@ -46670,7 +46770,7 @@ exports.RenameTableType = RenameTableType;
46670
46770
 
46671
46771
  Object.defineProperty(exports, "__esModule", ({ value: true }));
46672
46772
  exports.Renamer = void 0;
46673
- const vscode_languageserver_types_1 = __webpack_require__(/*! vscode-languageserver-types */ "./node_modules/vscode-languageserver-types/lib/esm/main.js");
46773
+ const vscode_languageserver_types_1 = __webpack_require__(/*! vscode-languageserver-types */ "./node_modules/vscode-languageserver-types/lib/umd/main.js");
46674
46774
  const memory_file_1 = __webpack_require__(/*! ../../files/memory_file */ "./node_modules/@abaplint/core/build/src/files/memory_file.js");
46675
46775
  const rename_data_element_1 = __webpack_require__(/*! ./rename_data_element */ "./node_modules/@abaplint/core/build/src/objects/rename/rename_data_element.js");
46676
46776
  const rename_domain_1 = __webpack_require__(/*! ./rename_domain */ "./node_modules/@abaplint/core/build/src/objects/rename/rename_domain.js");
@@ -46802,7 +46902,7 @@ exports.Renamer = Renamer;
46802
46902
 
46803
46903
  Object.defineProperty(exports, "__esModule", ({ value: true }));
46804
46904
  exports.RenamerHelper = void 0;
46805
- const vscode_languageserver_types_1 = __webpack_require__(/*! vscode-languageserver-types */ "./node_modules/vscode-languageserver-types/lib/esm/main.js");
46905
+ const vscode_languageserver_types_1 = __webpack_require__(/*! vscode-languageserver-types */ "./node_modules/vscode-languageserver-types/lib/umd/main.js");
46806
46906
  const __1 = __webpack_require__(/*! ../.. */ "./node_modules/@abaplint/core/build/src/index.js");
46807
46907
  const syntax_1 = __webpack_require__(/*! ../../abap/5_syntax/syntax */ "./node_modules/@abaplint/core/build/src/abap/5_syntax/syntax.js");
46808
46908
  const _scope_type_1 = __webpack_require__(/*! ../../abap/5_syntax/_scope_type */ "./node_modules/@abaplint/core/build/src/abap/5_syntax/_scope_type.js");
@@ -48933,7 +49033,7 @@ class Registry {
48933
49033
  }
48934
49034
  static abaplintVersion() {
48935
49035
  // magic, see build script "version.sh"
48936
- return "2.102.46";
49036
+ return "2.102.47";
48937
49037
  }
48938
49038
  getDDICReferences() {
48939
49039
  return this.ddicReferences;
@@ -78237,2301 +78337,2307 @@ module.exports = toNumber
78237
78337
 
78238
78338
  /***/ }),
78239
78339
 
78240
- /***/ "./node_modules/vscode-languageserver-types/lib/esm/main.js":
78340
+ /***/ "./node_modules/vscode-languageserver-types/lib/umd/main.js":
78241
78341
  /*!******************************************************************!*\
78242
- !*** ./node_modules/vscode-languageserver-types/lib/esm/main.js ***!
78342
+ !*** ./node_modules/vscode-languageserver-types/lib/umd/main.js ***!
78243
78343
  \******************************************************************/
78244
- /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
78245
-
78246
- "use strict";
78247
- __webpack_require__.r(__webpack_exports__);
78248
- /* harmony export */ __webpack_require__.d(__webpack_exports__, {
78249
- /* harmony export */ AnnotatedTextEdit: () => (/* binding */ AnnotatedTextEdit),
78250
- /* harmony export */ ChangeAnnotation: () => (/* binding */ ChangeAnnotation),
78251
- /* harmony export */ ChangeAnnotationIdentifier: () => (/* binding */ ChangeAnnotationIdentifier),
78252
- /* harmony export */ CodeAction: () => (/* binding */ CodeAction),
78253
- /* harmony export */ CodeActionContext: () => (/* binding */ CodeActionContext),
78254
- /* harmony export */ CodeActionKind: () => (/* binding */ CodeActionKind),
78255
- /* harmony export */ CodeActionTriggerKind: () => (/* binding */ CodeActionTriggerKind),
78256
- /* harmony export */ CodeDescription: () => (/* binding */ CodeDescription),
78257
- /* harmony export */ CodeLens: () => (/* binding */ CodeLens),
78258
- /* harmony export */ Color: () => (/* binding */ Color),
78259
- /* harmony export */ ColorInformation: () => (/* binding */ ColorInformation),
78260
- /* harmony export */ ColorPresentation: () => (/* binding */ ColorPresentation),
78261
- /* harmony export */ Command: () => (/* binding */ Command),
78262
- /* harmony export */ CompletionItem: () => (/* binding */ CompletionItem),
78263
- /* harmony export */ CompletionItemKind: () => (/* binding */ CompletionItemKind),
78264
- /* harmony export */ CompletionItemLabelDetails: () => (/* binding */ CompletionItemLabelDetails),
78265
- /* harmony export */ CompletionItemTag: () => (/* binding */ CompletionItemTag),
78266
- /* harmony export */ CompletionList: () => (/* binding */ CompletionList),
78267
- /* harmony export */ CreateFile: () => (/* binding */ CreateFile),
78268
- /* harmony export */ DeleteFile: () => (/* binding */ DeleteFile),
78269
- /* harmony export */ Diagnostic: () => (/* binding */ Diagnostic),
78270
- /* harmony export */ DiagnosticRelatedInformation: () => (/* binding */ DiagnosticRelatedInformation),
78271
- /* harmony export */ DiagnosticSeverity: () => (/* binding */ DiagnosticSeverity),
78272
- /* harmony export */ DiagnosticTag: () => (/* binding */ DiagnosticTag),
78273
- /* harmony export */ DocumentHighlight: () => (/* binding */ DocumentHighlight),
78274
- /* harmony export */ DocumentHighlightKind: () => (/* binding */ DocumentHighlightKind),
78275
- /* harmony export */ DocumentLink: () => (/* binding */ DocumentLink),
78276
- /* harmony export */ DocumentSymbol: () => (/* binding */ DocumentSymbol),
78277
- /* harmony export */ DocumentUri: () => (/* binding */ DocumentUri),
78278
- /* harmony export */ EOL: () => (/* binding */ EOL),
78279
- /* harmony export */ FoldingRange: () => (/* binding */ FoldingRange),
78280
- /* harmony export */ FoldingRangeKind: () => (/* binding */ FoldingRangeKind),
78281
- /* harmony export */ FormattingOptions: () => (/* binding */ FormattingOptions),
78282
- /* harmony export */ Hover: () => (/* binding */ Hover),
78283
- /* harmony export */ InlayHint: () => (/* binding */ InlayHint),
78284
- /* harmony export */ InlayHintKind: () => (/* binding */ InlayHintKind),
78285
- /* harmony export */ InlayHintLabelPart: () => (/* binding */ InlayHintLabelPart),
78286
- /* harmony export */ InlineValueContext: () => (/* binding */ InlineValueContext),
78287
- /* harmony export */ InlineValueEvaluatableExpression: () => (/* binding */ InlineValueEvaluatableExpression),
78288
- /* harmony export */ InlineValueText: () => (/* binding */ InlineValueText),
78289
- /* harmony export */ InlineValueVariableLookup: () => (/* binding */ InlineValueVariableLookup),
78290
- /* harmony export */ InsertReplaceEdit: () => (/* binding */ InsertReplaceEdit),
78291
- /* harmony export */ InsertTextFormat: () => (/* binding */ InsertTextFormat),
78292
- /* harmony export */ InsertTextMode: () => (/* binding */ InsertTextMode),
78293
- /* harmony export */ Location: () => (/* binding */ Location),
78294
- /* harmony export */ LocationLink: () => (/* binding */ LocationLink),
78295
- /* harmony export */ MarkedString: () => (/* binding */ MarkedString),
78296
- /* harmony export */ MarkupContent: () => (/* binding */ MarkupContent),
78297
- /* harmony export */ MarkupKind: () => (/* binding */ MarkupKind),
78298
- /* harmony export */ OptionalVersionedTextDocumentIdentifier: () => (/* binding */ OptionalVersionedTextDocumentIdentifier),
78299
- /* harmony export */ ParameterInformation: () => (/* binding */ ParameterInformation),
78300
- /* harmony export */ Position: () => (/* binding */ Position),
78301
- /* harmony export */ Range: () => (/* binding */ Range),
78302
- /* harmony export */ RenameFile: () => (/* binding */ RenameFile),
78303
- /* harmony export */ SelectionRange: () => (/* binding */ SelectionRange),
78304
- /* harmony export */ SemanticTokenModifiers: () => (/* binding */ SemanticTokenModifiers),
78305
- /* harmony export */ SemanticTokenTypes: () => (/* binding */ SemanticTokenTypes),
78306
- /* harmony export */ SemanticTokens: () => (/* binding */ SemanticTokens),
78307
- /* harmony export */ SignatureInformation: () => (/* binding */ SignatureInformation),
78308
- /* harmony export */ SymbolInformation: () => (/* binding */ SymbolInformation),
78309
- /* harmony export */ SymbolKind: () => (/* binding */ SymbolKind),
78310
- /* harmony export */ SymbolTag: () => (/* binding */ SymbolTag),
78311
- /* harmony export */ TextDocument: () => (/* binding */ TextDocument),
78312
- /* harmony export */ TextDocumentEdit: () => (/* binding */ TextDocumentEdit),
78313
- /* harmony export */ TextDocumentIdentifier: () => (/* binding */ TextDocumentIdentifier),
78314
- /* harmony export */ TextDocumentItem: () => (/* binding */ TextDocumentItem),
78315
- /* harmony export */ TextEdit: () => (/* binding */ TextEdit),
78316
- /* harmony export */ URI: () => (/* binding */ URI),
78317
- /* harmony export */ VersionedTextDocumentIdentifier: () => (/* binding */ VersionedTextDocumentIdentifier),
78318
- /* harmony export */ WorkspaceChange: () => (/* binding */ WorkspaceChange),
78319
- /* harmony export */ WorkspaceEdit: () => (/* binding */ WorkspaceEdit),
78320
- /* harmony export */ WorkspaceFolder: () => (/* binding */ WorkspaceFolder),
78321
- /* harmony export */ WorkspaceSymbol: () => (/* binding */ WorkspaceSymbol),
78322
- /* harmony export */ integer: () => (/* binding */ integer),
78323
- /* harmony export */ uinteger: () => (/* binding */ uinteger)
78324
- /* harmony export */ });
78325
- /* --------------------------------------------------------------------------------------------
78326
- * Copyright (c) Microsoft Corporation. All rights reserved.
78327
- * Licensed under the MIT License. See License.txt in the project root for license information.
78328
- * ------------------------------------------------------------------------------------------ */
78329
-
78330
- var DocumentUri;
78331
- (function (DocumentUri) {
78332
- function is(value) {
78333
- return typeof value === 'string';
78334
- }
78335
- DocumentUri.is = is;
78336
- })(DocumentUri || (DocumentUri = {}));
78337
- var URI;
78338
- (function (URI) {
78339
- function is(value) {
78340
- return typeof value === 'string';
78341
- }
78342
- URI.is = is;
78343
- })(URI || (URI = {}));
78344
- var integer;
78345
- (function (integer) {
78346
- integer.MIN_VALUE = -2147483648;
78347
- integer.MAX_VALUE = 2147483647;
78348
- function is(value) {
78349
- return typeof value === 'number' && integer.MIN_VALUE <= value && value <= integer.MAX_VALUE;
78350
- }
78351
- integer.is = is;
78352
- })(integer || (integer = {}));
78353
- var uinteger;
78354
- (function (uinteger) {
78355
- uinteger.MIN_VALUE = 0;
78356
- uinteger.MAX_VALUE = 2147483647;
78357
- function is(value) {
78358
- return typeof value === 'number' && uinteger.MIN_VALUE <= value && value <= uinteger.MAX_VALUE;
78359
- }
78360
- uinteger.is = is;
78361
- })(uinteger || (uinteger = {}));
78362
- /**
78363
- * The Position namespace provides helper functions to work with
78364
- * {@link Position} literals.
78365
- */
78366
- var Position;
78367
- (function (Position) {
78344
+ /***/ ((module, exports, __webpack_require__) => {
78345
+
78346
+ var __WEBPACK_AMD_DEFINE_FACTORY__, __WEBPACK_AMD_DEFINE_ARRAY__, __WEBPACK_AMD_DEFINE_RESULT__;(function (factory) {
78347
+ if ( true && typeof module.exports === "object") {
78348
+ var v = factory(__webpack_require__("./node_modules/vscode-languageserver-types/lib/umd sync recursive"), exports);
78349
+ if (v !== undefined) module.exports = v;
78350
+ }
78351
+ else if (true) {
78352
+ !(__WEBPACK_AMD_DEFINE_ARRAY__ = [__webpack_require__, exports], __WEBPACK_AMD_DEFINE_FACTORY__ = (factory),
78353
+ __WEBPACK_AMD_DEFINE_RESULT__ = (typeof __WEBPACK_AMD_DEFINE_FACTORY__ === 'function' ?
78354
+ (__WEBPACK_AMD_DEFINE_FACTORY__.apply(exports, __WEBPACK_AMD_DEFINE_ARRAY__)) : __WEBPACK_AMD_DEFINE_FACTORY__),
78355
+ __WEBPACK_AMD_DEFINE_RESULT__ !== undefined && (module.exports = __WEBPACK_AMD_DEFINE_RESULT__));
78356
+ }
78357
+ })(function (require, exports) {
78358
+ /* --------------------------------------------------------------------------------------------
78359
+ * Copyright (c) Microsoft Corporation. All rights reserved.
78360
+ * Licensed under the MIT License. See License.txt in the project root for license information.
78361
+ * ------------------------------------------------------------------------------------------ */
78362
+ 'use strict';
78363
+ Object.defineProperty(exports, "__esModule", { value: true });
78364
+ exports.TextDocument = exports.EOL = exports.WorkspaceFolder = exports.InlineCompletionContext = exports.SelectedCompletionInfo = exports.InlineCompletionTriggerKind = exports.InlineCompletionList = exports.InlineCompletionItem = exports.StringValue = exports.InlayHint = exports.InlayHintLabelPart = exports.InlayHintKind = exports.InlineValueContext = exports.InlineValueEvaluatableExpression = exports.InlineValueVariableLookup = exports.InlineValueText = exports.SemanticTokens = exports.SemanticTokenModifiers = exports.SemanticTokenTypes = exports.SelectionRange = exports.DocumentLink = exports.FormattingOptions = exports.CodeLens = exports.CodeAction = exports.CodeActionContext = exports.CodeActionTriggerKind = exports.CodeActionKind = exports.DocumentSymbol = exports.WorkspaceSymbol = exports.SymbolInformation = exports.SymbolTag = exports.SymbolKind = exports.DocumentHighlight = exports.DocumentHighlightKind = exports.SignatureInformation = exports.ParameterInformation = exports.Hover = exports.MarkedString = exports.CompletionList = exports.CompletionItem = exports.CompletionItemLabelDetails = exports.InsertTextMode = exports.InsertReplaceEdit = exports.CompletionItemTag = exports.InsertTextFormat = exports.CompletionItemKind = exports.MarkupContent = exports.MarkupKind = exports.TextDocumentItem = exports.OptionalVersionedTextDocumentIdentifier = exports.VersionedTextDocumentIdentifier = exports.TextDocumentIdentifier = exports.WorkspaceChange = exports.WorkspaceEdit = exports.DeleteFile = exports.RenameFile = exports.CreateFile = exports.TextDocumentEdit = exports.AnnotatedTextEdit = exports.ChangeAnnotationIdentifier = exports.ChangeAnnotation = exports.TextEdit = exports.Command = exports.Diagnostic = exports.CodeDescription = exports.DiagnosticTag = exports.DiagnosticSeverity = exports.DiagnosticRelatedInformation = exports.FoldingRange = exports.FoldingRangeKind = exports.ColorPresentation = exports.ColorInformation = exports.Color = exports.LocationLink = exports.Location = exports.Range = exports.Position = exports.uinteger = exports.integer = exports.URI = exports.DocumentUri = void 0;
78365
+ var DocumentUri;
78366
+ (function (DocumentUri) {
78367
+ function is(value) {
78368
+ return typeof value === 'string';
78369
+ }
78370
+ DocumentUri.is = is;
78371
+ })(DocumentUri || (exports.DocumentUri = DocumentUri = {}));
78372
+ var URI;
78373
+ (function (URI) {
78374
+ function is(value) {
78375
+ return typeof value === 'string';
78376
+ }
78377
+ URI.is = is;
78378
+ })(URI || (exports.URI = URI = {}));
78379
+ var integer;
78380
+ (function (integer) {
78381
+ integer.MIN_VALUE = -2147483648;
78382
+ integer.MAX_VALUE = 2147483647;
78383
+ function is(value) {
78384
+ return typeof value === 'number' && integer.MIN_VALUE <= value && value <= integer.MAX_VALUE;
78385
+ }
78386
+ integer.is = is;
78387
+ })(integer || (exports.integer = integer = {}));
78388
+ var uinteger;
78389
+ (function (uinteger) {
78390
+ uinteger.MIN_VALUE = 0;
78391
+ uinteger.MAX_VALUE = 2147483647;
78392
+ function is(value) {
78393
+ return typeof value === 'number' && uinteger.MIN_VALUE <= value && value <= uinteger.MAX_VALUE;
78394
+ }
78395
+ uinteger.is = is;
78396
+ })(uinteger || (exports.uinteger = uinteger = {}));
78368
78397
  /**
78369
- * Creates a new Position literal from the given line and character.
78370
- * @param line The position's line.
78371
- * @param character The position's character.
78398
+ * The Position namespace provides helper functions to work with
78399
+ * {@link Position} literals.
78372
78400
  */
78373
- function create(line, character) {
78374
- if (line === Number.MAX_VALUE) {
78375
- line = uinteger.MAX_VALUE;
78401
+ var Position;
78402
+ (function (Position) {
78403
+ /**
78404
+ * Creates a new Position literal from the given line and character.
78405
+ * @param line The position's line.
78406
+ * @param character The position's character.
78407
+ */
78408
+ function create(line, character) {
78409
+ if (line === Number.MAX_VALUE) {
78410
+ line = uinteger.MAX_VALUE;
78411
+ }
78412
+ if (character === Number.MAX_VALUE) {
78413
+ character = uinteger.MAX_VALUE;
78414
+ }
78415
+ return { line: line, character: character };
78376
78416
  }
78377
- if (character === Number.MAX_VALUE) {
78378
- character = uinteger.MAX_VALUE;
78417
+ Position.create = create;
78418
+ /**
78419
+ * Checks whether the given literal conforms to the {@link Position} interface.
78420
+ */
78421
+ function is(value) {
78422
+ var candidate = value;
78423
+ return Is.objectLiteral(candidate) && Is.uinteger(candidate.line) && Is.uinteger(candidate.character);
78379
78424
  }
78380
- return { line: line, character: character };
78381
- }
78382
- Position.create = create;
78425
+ Position.is = is;
78426
+ })(Position || (exports.Position = Position = {}));
78383
78427
  /**
78384
- * Checks whether the given literal conforms to the {@link Position} interface.
78428
+ * The Range namespace provides helper functions to work with
78429
+ * {@link Range} literals.
78385
78430
  */
78386
- function is(value) {
78387
- var candidate = value;
78388
- return Is.objectLiteral(candidate) && Is.uinteger(candidate.line) && Is.uinteger(candidate.character);
78389
- }
78390
- Position.is = is;
78391
- })(Position || (Position = {}));
78392
- /**
78393
- * The Range namespace provides helper functions to work with
78394
- * {@link Range} literals.
78395
- */
78396
- var Range;
78397
- (function (Range) {
78398
- function create(one, two, three, four) {
78399
- if (Is.uinteger(one) && Is.uinteger(two) && Is.uinteger(three) && Is.uinteger(four)) {
78400
- return { start: Position.create(one, two), end: Position.create(three, four) };
78401
- }
78402
- else if (Position.is(one) && Position.is(two)) {
78403
- return { start: one, end: two };
78431
+ var Range;
78432
+ (function (Range) {
78433
+ function create(one, two, three, four) {
78434
+ if (Is.uinteger(one) && Is.uinteger(two) && Is.uinteger(three) && Is.uinteger(four)) {
78435
+ return { start: Position.create(one, two), end: Position.create(three, four) };
78436
+ }
78437
+ else if (Position.is(one) && Position.is(two)) {
78438
+ return { start: one, end: two };
78439
+ }
78440
+ else {
78441
+ throw new Error("Range#create called with invalid arguments[".concat(one, ", ").concat(two, ", ").concat(three, ", ").concat(four, "]"));
78442
+ }
78404
78443
  }
78405
- else {
78406
- throw new Error("Range#create called with invalid arguments[".concat(one, ", ").concat(two, ", ").concat(three, ", ").concat(four, "]"));
78444
+ Range.create = create;
78445
+ /**
78446
+ * Checks whether the given literal conforms to the {@link Range} interface.
78447
+ */
78448
+ function is(value) {
78449
+ var candidate = value;
78450
+ return Is.objectLiteral(candidate) && Position.is(candidate.start) && Position.is(candidate.end);
78407
78451
  }
78408
- }
78409
- Range.create = create;
78452
+ Range.is = is;
78453
+ })(Range || (exports.Range = Range = {}));
78410
78454
  /**
78411
- * Checks whether the given literal conforms to the {@link Range} interface.
78455
+ * The Location namespace provides helper functions to work with
78456
+ * {@link Location} literals.
78412
78457
  */
78413
- function is(value) {
78414
- var candidate = value;
78415
- return Is.objectLiteral(candidate) && Position.is(candidate.start) && Position.is(candidate.end);
78416
- }
78417
- Range.is = is;
78418
- })(Range || (Range = {}));
78419
- /**
78420
- * The Location namespace provides helper functions to work with
78421
- * {@link Location} literals.
78422
- */
78423
- var Location;
78424
- (function (Location) {
78458
+ var Location;
78459
+ (function (Location) {
78460
+ /**
78461
+ * Creates a Location literal.
78462
+ * @param uri The location's uri.
78463
+ * @param range The location's range.
78464
+ */
78465
+ function create(uri, range) {
78466
+ return { uri: uri, range: range };
78467
+ }
78468
+ Location.create = create;
78469
+ /**
78470
+ * Checks whether the given literal conforms to the {@link Location} interface.
78471
+ */
78472
+ function is(value) {
78473
+ var candidate = value;
78474
+ return Is.objectLiteral(candidate) && Range.is(candidate.range) && (Is.string(candidate.uri) || Is.undefined(candidate.uri));
78475
+ }
78476
+ Location.is = is;
78477
+ })(Location || (exports.Location = Location = {}));
78425
78478
  /**
78426
- * Creates a Location literal.
78427
- * @param uri The location's uri.
78428
- * @param range The location's range.
78479
+ * The LocationLink namespace provides helper functions to work with
78480
+ * {@link LocationLink} literals.
78429
78481
  */
78430
- function create(uri, range) {
78431
- return { uri: uri, range: range };
78432
- }
78433
- Location.create = create;
78482
+ var LocationLink;
78483
+ (function (LocationLink) {
78484
+ /**
78485
+ * Creates a LocationLink literal.
78486
+ * @param targetUri The definition's uri.
78487
+ * @param targetRange The full range of the definition.
78488
+ * @param targetSelectionRange The span of the symbol definition at the target.
78489
+ * @param originSelectionRange The span of the symbol being defined in the originating source file.
78490
+ */
78491
+ function create(targetUri, targetRange, targetSelectionRange, originSelectionRange) {
78492
+ return { targetUri: targetUri, targetRange: targetRange, targetSelectionRange: targetSelectionRange, originSelectionRange: originSelectionRange };
78493
+ }
78494
+ LocationLink.create = create;
78495
+ /**
78496
+ * Checks whether the given literal conforms to the {@link LocationLink} interface.
78497
+ */
78498
+ function is(value) {
78499
+ var candidate = value;
78500
+ return Is.objectLiteral(candidate) && Range.is(candidate.targetRange) && Is.string(candidate.targetUri)
78501
+ && Range.is(candidate.targetSelectionRange)
78502
+ && (Range.is(candidate.originSelectionRange) || Is.undefined(candidate.originSelectionRange));
78503
+ }
78504
+ LocationLink.is = is;
78505
+ })(LocationLink || (exports.LocationLink = LocationLink = {}));
78434
78506
  /**
78435
- * Checks whether the given literal conforms to the {@link Location} interface.
78507
+ * The Color namespace provides helper functions to work with
78508
+ * {@link Color} literals.
78436
78509
  */
78437
- function is(value) {
78438
- var candidate = value;
78439
- return Is.objectLiteral(candidate) && Range.is(candidate.range) && (Is.string(candidate.uri) || Is.undefined(candidate.uri));
78440
- }
78441
- Location.is = is;
78442
- })(Location || (Location = {}));
78443
- /**
78444
- * The LocationLink namespace provides helper functions to work with
78445
- * {@link LocationLink} literals.
78446
- */
78447
- var LocationLink;
78448
- (function (LocationLink) {
78510
+ var Color;
78511
+ (function (Color) {
78512
+ /**
78513
+ * Creates a new Color literal.
78514
+ */
78515
+ function create(red, green, blue, alpha) {
78516
+ return {
78517
+ red: red,
78518
+ green: green,
78519
+ blue: blue,
78520
+ alpha: alpha,
78521
+ };
78522
+ }
78523
+ Color.create = create;
78524
+ /**
78525
+ * Checks whether the given literal conforms to the {@link Color} interface.
78526
+ */
78527
+ function is(value) {
78528
+ var candidate = value;
78529
+ return Is.objectLiteral(candidate) && Is.numberRange(candidate.red, 0, 1)
78530
+ && Is.numberRange(candidate.green, 0, 1)
78531
+ && Is.numberRange(candidate.blue, 0, 1)
78532
+ && Is.numberRange(candidate.alpha, 0, 1);
78533
+ }
78534
+ Color.is = is;
78535
+ })(Color || (exports.Color = Color = {}));
78449
78536
  /**
78450
- * Creates a LocationLink literal.
78451
- * @param targetUri The definition's uri.
78452
- * @param targetRange The full range of the definition.
78453
- * @param targetSelectionRange The span of the symbol definition at the target.
78454
- * @param originSelectionRange The span of the symbol being defined in the originating source file.
78537
+ * The ColorInformation namespace provides helper functions to work with
78538
+ * {@link ColorInformation} literals.
78455
78539
  */
78456
- function create(targetUri, targetRange, targetSelectionRange, originSelectionRange) {
78457
- return { targetUri: targetUri, targetRange: targetRange, targetSelectionRange: targetSelectionRange, originSelectionRange: originSelectionRange };
78458
- }
78459
- LocationLink.create = create;
78540
+ var ColorInformation;
78541
+ (function (ColorInformation) {
78542
+ /**
78543
+ * Creates a new ColorInformation literal.
78544
+ */
78545
+ function create(range, color) {
78546
+ return {
78547
+ range: range,
78548
+ color: color,
78549
+ };
78550
+ }
78551
+ ColorInformation.create = create;
78552
+ /**
78553
+ * Checks whether the given literal conforms to the {@link ColorInformation} interface.
78554
+ */
78555
+ function is(value) {
78556
+ var candidate = value;
78557
+ return Is.objectLiteral(candidate) && Range.is(candidate.range) && Color.is(candidate.color);
78558
+ }
78559
+ ColorInformation.is = is;
78560
+ })(ColorInformation || (exports.ColorInformation = ColorInformation = {}));
78460
78561
  /**
78461
- * Checks whether the given literal conforms to the {@link LocationLink} interface.
78562
+ * The Color namespace provides helper functions to work with
78563
+ * {@link ColorPresentation} literals.
78462
78564
  */
78463
- function is(value) {
78464
- var candidate = value;
78465
- return Is.objectLiteral(candidate) && Range.is(candidate.targetRange) && Is.string(candidate.targetUri)
78466
- && Range.is(candidate.targetSelectionRange)
78467
- && (Range.is(candidate.originSelectionRange) || Is.undefined(candidate.originSelectionRange));
78468
- }
78469
- LocationLink.is = is;
78470
- })(LocationLink || (LocationLink = {}));
78471
- /**
78472
- * The Color namespace provides helper functions to work with
78473
- * {@link Color} literals.
78474
- */
78475
- var Color;
78476
- (function (Color) {
78565
+ var ColorPresentation;
78566
+ (function (ColorPresentation) {
78567
+ /**
78568
+ * Creates a new ColorInformation literal.
78569
+ */
78570
+ function create(label, textEdit, additionalTextEdits) {
78571
+ return {
78572
+ label: label,
78573
+ textEdit: textEdit,
78574
+ additionalTextEdits: additionalTextEdits,
78575
+ };
78576
+ }
78577
+ ColorPresentation.create = create;
78578
+ /**
78579
+ * Checks whether the given literal conforms to the {@link ColorInformation} interface.
78580
+ */
78581
+ function is(value) {
78582
+ var candidate = value;
78583
+ return Is.objectLiteral(candidate) && Is.string(candidate.label)
78584
+ && (Is.undefined(candidate.textEdit) || TextEdit.is(candidate))
78585
+ && (Is.undefined(candidate.additionalTextEdits) || Is.typedArray(candidate.additionalTextEdits, TextEdit.is));
78586
+ }
78587
+ ColorPresentation.is = is;
78588
+ })(ColorPresentation || (exports.ColorPresentation = ColorPresentation = {}));
78477
78589
  /**
78478
- * Creates a new Color literal.
78590
+ * A set of predefined range kinds.
78479
78591
  */
78480
- function create(red, green, blue, alpha) {
78481
- return {
78482
- red: red,
78483
- green: green,
78484
- blue: blue,
78485
- alpha: alpha,
78486
- };
78487
- }
78488
- Color.create = create;
78592
+ var FoldingRangeKind;
78593
+ (function (FoldingRangeKind) {
78594
+ /**
78595
+ * Folding range for a comment
78596
+ */
78597
+ FoldingRangeKind.Comment = 'comment';
78598
+ /**
78599
+ * Folding range for an import or include
78600
+ */
78601
+ FoldingRangeKind.Imports = 'imports';
78602
+ /**
78603
+ * Folding range for a region (e.g. `#region`)
78604
+ */
78605
+ FoldingRangeKind.Region = 'region';
78606
+ })(FoldingRangeKind || (exports.FoldingRangeKind = FoldingRangeKind = {}));
78489
78607
  /**
78490
- * Checks whether the given literal conforms to the {@link Color} interface.
78608
+ * The folding range namespace provides helper functions to work with
78609
+ * {@link FoldingRange} literals.
78491
78610
  */
78492
- function is(value) {
78493
- var candidate = value;
78494
- return Is.objectLiteral(candidate) && Is.numberRange(candidate.red, 0, 1)
78495
- && Is.numberRange(candidate.green, 0, 1)
78496
- && Is.numberRange(candidate.blue, 0, 1)
78497
- && Is.numberRange(candidate.alpha, 0, 1);
78498
- }
78499
- Color.is = is;
78500
- })(Color || (Color = {}));
78501
- /**
78502
- * The ColorInformation namespace provides helper functions to work with
78503
- * {@link ColorInformation} literals.
78504
- */
78505
- var ColorInformation;
78506
- (function (ColorInformation) {
78611
+ var FoldingRange;
78612
+ (function (FoldingRange) {
78613
+ /**
78614
+ * Creates a new FoldingRange literal.
78615
+ */
78616
+ function create(startLine, endLine, startCharacter, endCharacter, kind, collapsedText) {
78617
+ var result = {
78618
+ startLine: startLine,
78619
+ endLine: endLine
78620
+ };
78621
+ if (Is.defined(startCharacter)) {
78622
+ result.startCharacter = startCharacter;
78623
+ }
78624
+ if (Is.defined(endCharacter)) {
78625
+ result.endCharacter = endCharacter;
78626
+ }
78627
+ if (Is.defined(kind)) {
78628
+ result.kind = kind;
78629
+ }
78630
+ if (Is.defined(collapsedText)) {
78631
+ result.collapsedText = collapsedText;
78632
+ }
78633
+ return result;
78634
+ }
78635
+ FoldingRange.create = create;
78636
+ /**
78637
+ * Checks whether the given literal conforms to the {@link FoldingRange} interface.
78638
+ */
78639
+ function is(value) {
78640
+ var candidate = value;
78641
+ return Is.objectLiteral(candidate) && Is.uinteger(candidate.startLine) && Is.uinteger(candidate.startLine)
78642
+ && (Is.undefined(candidate.startCharacter) || Is.uinteger(candidate.startCharacter))
78643
+ && (Is.undefined(candidate.endCharacter) || Is.uinteger(candidate.endCharacter))
78644
+ && (Is.undefined(candidate.kind) || Is.string(candidate.kind));
78645
+ }
78646
+ FoldingRange.is = is;
78647
+ })(FoldingRange || (exports.FoldingRange = FoldingRange = {}));
78507
78648
  /**
78508
- * Creates a new ColorInformation literal.
78649
+ * The DiagnosticRelatedInformation namespace provides helper functions to work with
78650
+ * {@link DiagnosticRelatedInformation} literals.
78509
78651
  */
78510
- function create(range, color) {
78511
- return {
78512
- range: range,
78513
- color: color,
78514
- };
78515
- }
78516
- ColorInformation.create = create;
78652
+ var DiagnosticRelatedInformation;
78653
+ (function (DiagnosticRelatedInformation) {
78654
+ /**
78655
+ * Creates a new DiagnosticRelatedInformation literal.
78656
+ */
78657
+ function create(location, message) {
78658
+ return {
78659
+ location: location,
78660
+ message: message
78661
+ };
78662
+ }
78663
+ DiagnosticRelatedInformation.create = create;
78664
+ /**
78665
+ * Checks whether the given literal conforms to the {@link DiagnosticRelatedInformation} interface.
78666
+ */
78667
+ function is(value) {
78668
+ var candidate = value;
78669
+ return Is.defined(candidate) && Location.is(candidate.location) && Is.string(candidate.message);
78670
+ }
78671
+ DiagnosticRelatedInformation.is = is;
78672
+ })(DiagnosticRelatedInformation || (exports.DiagnosticRelatedInformation = DiagnosticRelatedInformation = {}));
78517
78673
  /**
78518
- * Checks whether the given literal conforms to the {@link ColorInformation} interface.
78674
+ * The diagnostic's severity.
78519
78675
  */
78520
- function is(value) {
78521
- var candidate = value;
78522
- return Is.objectLiteral(candidate) && Range.is(candidate.range) && Color.is(candidate.color);
78523
- }
78524
- ColorInformation.is = is;
78525
- })(ColorInformation || (ColorInformation = {}));
78526
- /**
78527
- * The Color namespace provides helper functions to work with
78528
- * {@link ColorPresentation} literals.
78529
- */
78530
- var ColorPresentation;
78531
- (function (ColorPresentation) {
78676
+ var DiagnosticSeverity;
78677
+ (function (DiagnosticSeverity) {
78678
+ /**
78679
+ * Reports an error.
78680
+ */
78681
+ DiagnosticSeverity.Error = 1;
78682
+ /**
78683
+ * Reports a warning.
78684
+ */
78685
+ DiagnosticSeverity.Warning = 2;
78686
+ /**
78687
+ * Reports an information.
78688
+ */
78689
+ DiagnosticSeverity.Information = 3;
78690
+ /**
78691
+ * Reports a hint.
78692
+ */
78693
+ DiagnosticSeverity.Hint = 4;
78694
+ })(DiagnosticSeverity || (exports.DiagnosticSeverity = DiagnosticSeverity = {}));
78532
78695
  /**
78533
- * Creates a new ColorInformation literal.
78696
+ * The diagnostic tags.
78697
+ *
78698
+ * @since 3.15.0
78534
78699
  */
78535
- function create(label, textEdit, additionalTextEdits) {
78536
- return {
78537
- label: label,
78538
- textEdit: textEdit,
78539
- additionalTextEdits: additionalTextEdits,
78540
- };
78541
- }
78542
- ColorPresentation.create = create;
78700
+ var DiagnosticTag;
78701
+ (function (DiagnosticTag) {
78702
+ /**
78703
+ * Unused or unnecessary code.
78704
+ *
78705
+ * Clients are allowed to render diagnostics with this tag faded out instead of having
78706
+ * an error squiggle.
78707
+ */
78708
+ DiagnosticTag.Unnecessary = 1;
78709
+ /**
78710
+ * Deprecated or obsolete code.
78711
+ *
78712
+ * Clients are allowed to rendered diagnostics with this tag strike through.
78713
+ */
78714
+ DiagnosticTag.Deprecated = 2;
78715
+ })(DiagnosticTag || (exports.DiagnosticTag = DiagnosticTag = {}));
78543
78716
  /**
78544
- * Checks whether the given literal conforms to the {@link ColorInformation} interface.
78717
+ * The CodeDescription namespace provides functions to deal with descriptions for diagnostic codes.
78718
+ *
78719
+ * @since 3.16.0
78545
78720
  */
78546
- function is(value) {
78547
- var candidate = value;
78548
- return Is.objectLiteral(candidate) && Is.string(candidate.label)
78549
- && (Is.undefined(candidate.textEdit) || TextEdit.is(candidate))
78550
- && (Is.undefined(candidate.additionalTextEdits) || Is.typedArray(candidate.additionalTextEdits, TextEdit.is));
78551
- }
78552
- ColorPresentation.is = is;
78553
- })(ColorPresentation || (ColorPresentation = {}));
78554
- /**
78555
- * A set of predefined range kinds.
78556
- */
78557
- var FoldingRangeKind;
78558
- (function (FoldingRangeKind) {
78721
+ var CodeDescription;
78722
+ (function (CodeDescription) {
78723
+ function is(value) {
78724
+ var candidate = value;
78725
+ return Is.objectLiteral(candidate) && Is.string(candidate.href);
78726
+ }
78727
+ CodeDescription.is = is;
78728
+ })(CodeDescription || (exports.CodeDescription = CodeDescription = {}));
78559
78729
  /**
78560
- * Folding range for a comment
78730
+ * The Diagnostic namespace provides helper functions to work with
78731
+ * {@link Diagnostic} literals.
78561
78732
  */
78562
- FoldingRangeKind.Comment = 'comment';
78733
+ var Diagnostic;
78734
+ (function (Diagnostic) {
78735
+ /**
78736
+ * Creates a new Diagnostic literal.
78737
+ */
78738
+ function create(range, message, severity, code, source, relatedInformation) {
78739
+ var result = { range: range, message: message };
78740
+ if (Is.defined(severity)) {
78741
+ result.severity = severity;
78742
+ }
78743
+ if (Is.defined(code)) {
78744
+ result.code = code;
78745
+ }
78746
+ if (Is.defined(source)) {
78747
+ result.source = source;
78748
+ }
78749
+ if (Is.defined(relatedInformation)) {
78750
+ result.relatedInformation = relatedInformation;
78751
+ }
78752
+ return result;
78753
+ }
78754
+ Diagnostic.create = create;
78755
+ /**
78756
+ * Checks whether the given literal conforms to the {@link Diagnostic} interface.
78757
+ */
78758
+ function is(value) {
78759
+ var _a;
78760
+ var candidate = value;
78761
+ return Is.defined(candidate)
78762
+ && Range.is(candidate.range)
78763
+ && Is.string(candidate.message)
78764
+ && (Is.number(candidate.severity) || Is.undefined(candidate.severity))
78765
+ && (Is.integer(candidate.code) || Is.string(candidate.code) || Is.undefined(candidate.code))
78766
+ && (Is.undefined(candidate.codeDescription) || (Is.string((_a = candidate.codeDescription) === null || _a === void 0 ? void 0 : _a.href)))
78767
+ && (Is.string(candidate.source) || Is.undefined(candidate.source))
78768
+ && (Is.undefined(candidate.relatedInformation) || Is.typedArray(candidate.relatedInformation, DiagnosticRelatedInformation.is));
78769
+ }
78770
+ Diagnostic.is = is;
78771
+ })(Diagnostic || (exports.Diagnostic = Diagnostic = {}));
78563
78772
  /**
78564
- * Folding range for an import or include
78773
+ * The Command namespace provides helper functions to work with
78774
+ * {@link Command} literals.
78565
78775
  */
78566
- FoldingRangeKind.Imports = 'imports';
78776
+ var Command;
78777
+ (function (Command) {
78778
+ /**
78779
+ * Creates a new Command literal.
78780
+ */
78781
+ function create(title, command) {
78782
+ var args = [];
78783
+ for (var _i = 2; _i < arguments.length; _i++) {
78784
+ args[_i - 2] = arguments[_i];
78785
+ }
78786
+ var result = { title: title, command: command };
78787
+ if (Is.defined(args) && args.length > 0) {
78788
+ result.arguments = args;
78789
+ }
78790
+ return result;
78791
+ }
78792
+ Command.create = create;
78793
+ /**
78794
+ * Checks whether the given literal conforms to the {@link Command} interface.
78795
+ */
78796
+ function is(value) {
78797
+ var candidate = value;
78798
+ return Is.defined(candidate) && Is.string(candidate.title) && Is.string(candidate.command);
78799
+ }
78800
+ Command.is = is;
78801
+ })(Command || (exports.Command = Command = {}));
78567
78802
  /**
78568
- * Folding range for a region (e.g. `#region`)
78803
+ * The TextEdit namespace provides helper function to create replace,
78804
+ * insert and delete edits more easily.
78569
78805
  */
78570
- FoldingRangeKind.Region = 'region';
78571
- })(FoldingRangeKind || (FoldingRangeKind = {}));
78572
- /**
78573
- * The folding range namespace provides helper functions to work with
78574
- * {@link FoldingRange} literals.
78575
- */
78576
- var FoldingRange;
78577
- (function (FoldingRange) {
78806
+ var TextEdit;
78807
+ (function (TextEdit) {
78808
+ /**
78809
+ * Creates a replace text edit.
78810
+ * @param range The range of text to be replaced.
78811
+ * @param newText The new text.
78812
+ */
78813
+ function replace(range, newText) {
78814
+ return { range: range, newText: newText };
78815
+ }
78816
+ TextEdit.replace = replace;
78817
+ /**
78818
+ * Creates an insert text edit.
78819
+ * @param position The position to insert the text at.
78820
+ * @param newText The text to be inserted.
78821
+ */
78822
+ function insert(position, newText) {
78823
+ return { range: { start: position, end: position }, newText: newText };
78824
+ }
78825
+ TextEdit.insert = insert;
78826
+ /**
78827
+ * Creates a delete text edit.
78828
+ * @param range The range of text to be deleted.
78829
+ */
78830
+ function del(range) {
78831
+ return { range: range, newText: '' };
78832
+ }
78833
+ TextEdit.del = del;
78834
+ function is(value) {
78835
+ var candidate = value;
78836
+ return Is.objectLiteral(candidate)
78837
+ && Is.string(candidate.newText)
78838
+ && Range.is(candidate.range);
78839
+ }
78840
+ TextEdit.is = is;
78841
+ })(TextEdit || (exports.TextEdit = TextEdit = {}));
78842
+ var ChangeAnnotation;
78843
+ (function (ChangeAnnotation) {
78844
+ function create(label, needsConfirmation, description) {
78845
+ var result = { label: label };
78846
+ if (needsConfirmation !== undefined) {
78847
+ result.needsConfirmation = needsConfirmation;
78848
+ }
78849
+ if (description !== undefined) {
78850
+ result.description = description;
78851
+ }
78852
+ return result;
78853
+ }
78854
+ ChangeAnnotation.create = create;
78855
+ function is(value) {
78856
+ var candidate = value;
78857
+ return Is.objectLiteral(candidate) && Is.string(candidate.label) &&
78858
+ (Is.boolean(candidate.needsConfirmation) || candidate.needsConfirmation === undefined) &&
78859
+ (Is.string(candidate.description) || candidate.description === undefined);
78860
+ }
78861
+ ChangeAnnotation.is = is;
78862
+ })(ChangeAnnotation || (exports.ChangeAnnotation = ChangeAnnotation = {}));
78863
+ var ChangeAnnotationIdentifier;
78864
+ (function (ChangeAnnotationIdentifier) {
78865
+ function is(value) {
78866
+ var candidate = value;
78867
+ return Is.string(candidate);
78868
+ }
78869
+ ChangeAnnotationIdentifier.is = is;
78870
+ })(ChangeAnnotationIdentifier || (exports.ChangeAnnotationIdentifier = ChangeAnnotationIdentifier = {}));
78871
+ var AnnotatedTextEdit;
78872
+ (function (AnnotatedTextEdit) {
78873
+ /**
78874
+ * Creates an annotated replace text edit.
78875
+ *
78876
+ * @param range The range of text to be replaced.
78877
+ * @param newText The new text.
78878
+ * @param annotation The annotation.
78879
+ */
78880
+ function replace(range, newText, annotation) {
78881
+ return { range: range, newText: newText, annotationId: annotation };
78882
+ }
78883
+ AnnotatedTextEdit.replace = replace;
78884
+ /**
78885
+ * Creates an annotated insert text edit.
78886
+ *
78887
+ * @param position The position to insert the text at.
78888
+ * @param newText The text to be inserted.
78889
+ * @param annotation The annotation.
78890
+ */
78891
+ function insert(position, newText, annotation) {
78892
+ return { range: { start: position, end: position }, newText: newText, annotationId: annotation };
78893
+ }
78894
+ AnnotatedTextEdit.insert = insert;
78895
+ /**
78896
+ * Creates an annotated delete text edit.
78897
+ *
78898
+ * @param range The range of text to be deleted.
78899
+ * @param annotation The annotation.
78900
+ */
78901
+ function del(range, annotation) {
78902
+ return { range: range, newText: '', annotationId: annotation };
78903
+ }
78904
+ AnnotatedTextEdit.del = del;
78905
+ function is(value) {
78906
+ var candidate = value;
78907
+ return TextEdit.is(candidate) && (ChangeAnnotation.is(candidate.annotationId) || ChangeAnnotationIdentifier.is(candidate.annotationId));
78908
+ }
78909
+ AnnotatedTextEdit.is = is;
78910
+ })(AnnotatedTextEdit || (exports.AnnotatedTextEdit = AnnotatedTextEdit = {}));
78578
78911
  /**
78579
- * Creates a new FoldingRange literal.
78912
+ * The TextDocumentEdit namespace provides helper function to create
78913
+ * an edit that manipulates a text document.
78580
78914
  */
78581
- function create(startLine, endLine, startCharacter, endCharacter, kind, collapsedText) {
78582
- var result = {
78583
- startLine: startLine,
78584
- endLine: endLine
78585
- };
78586
- if (Is.defined(startCharacter)) {
78587
- result.startCharacter = startCharacter;
78915
+ var TextDocumentEdit;
78916
+ (function (TextDocumentEdit) {
78917
+ /**
78918
+ * Creates a new `TextDocumentEdit`
78919
+ */
78920
+ function create(textDocument, edits) {
78921
+ return { textDocument: textDocument, edits: edits };
78922
+ }
78923
+ TextDocumentEdit.create = create;
78924
+ function is(value) {
78925
+ var candidate = value;
78926
+ return Is.defined(candidate)
78927
+ && OptionalVersionedTextDocumentIdentifier.is(candidate.textDocument)
78928
+ && Array.isArray(candidate.edits);
78929
+ }
78930
+ TextDocumentEdit.is = is;
78931
+ })(TextDocumentEdit || (exports.TextDocumentEdit = TextDocumentEdit = {}));
78932
+ var CreateFile;
78933
+ (function (CreateFile) {
78934
+ function create(uri, options, annotation) {
78935
+ var result = {
78936
+ kind: 'create',
78937
+ uri: uri
78938
+ };
78939
+ if (options !== undefined && (options.overwrite !== undefined || options.ignoreIfExists !== undefined)) {
78940
+ result.options = options;
78941
+ }
78942
+ if (annotation !== undefined) {
78943
+ result.annotationId = annotation;
78944
+ }
78945
+ return result;
78946
+ }
78947
+ CreateFile.create = create;
78948
+ function is(value) {
78949
+ var candidate = value;
78950
+ return candidate && candidate.kind === 'create' && Is.string(candidate.uri) && (candidate.options === undefined ||
78951
+ ((candidate.options.overwrite === undefined || Is.boolean(candidate.options.overwrite)) && (candidate.options.ignoreIfExists === undefined || Is.boolean(candidate.options.ignoreIfExists)))) && (candidate.annotationId === undefined || ChangeAnnotationIdentifier.is(candidate.annotationId));
78952
+ }
78953
+ CreateFile.is = is;
78954
+ })(CreateFile || (exports.CreateFile = CreateFile = {}));
78955
+ var RenameFile;
78956
+ (function (RenameFile) {
78957
+ function create(oldUri, newUri, options, annotation) {
78958
+ var result = {
78959
+ kind: 'rename',
78960
+ oldUri: oldUri,
78961
+ newUri: newUri
78962
+ };
78963
+ if (options !== undefined && (options.overwrite !== undefined || options.ignoreIfExists !== undefined)) {
78964
+ result.options = options;
78965
+ }
78966
+ if (annotation !== undefined) {
78967
+ result.annotationId = annotation;
78968
+ }
78969
+ return result;
78588
78970
  }
78589
- if (Is.defined(endCharacter)) {
78590
- result.endCharacter = endCharacter;
78971
+ RenameFile.create = create;
78972
+ function is(value) {
78973
+ var candidate = value;
78974
+ return candidate && candidate.kind === 'rename' && Is.string(candidate.oldUri) && Is.string(candidate.newUri) && (candidate.options === undefined ||
78975
+ ((candidate.options.overwrite === undefined || Is.boolean(candidate.options.overwrite)) && (candidate.options.ignoreIfExists === undefined || Is.boolean(candidate.options.ignoreIfExists)))) && (candidate.annotationId === undefined || ChangeAnnotationIdentifier.is(candidate.annotationId));
78976
+ }
78977
+ RenameFile.is = is;
78978
+ })(RenameFile || (exports.RenameFile = RenameFile = {}));
78979
+ var DeleteFile;
78980
+ (function (DeleteFile) {
78981
+ function create(uri, options, annotation) {
78982
+ var result = {
78983
+ kind: 'delete',
78984
+ uri: uri
78985
+ };
78986
+ if (options !== undefined && (options.recursive !== undefined || options.ignoreIfNotExists !== undefined)) {
78987
+ result.options = options;
78988
+ }
78989
+ if (annotation !== undefined) {
78990
+ result.annotationId = annotation;
78991
+ }
78992
+ return result;
78591
78993
  }
78592
- if (Is.defined(kind)) {
78593
- result.kind = kind;
78994
+ DeleteFile.create = create;
78995
+ function is(value) {
78996
+ var candidate = value;
78997
+ return candidate && candidate.kind === 'delete' && Is.string(candidate.uri) && (candidate.options === undefined ||
78998
+ ((candidate.options.recursive === undefined || Is.boolean(candidate.options.recursive)) && (candidate.options.ignoreIfNotExists === undefined || Is.boolean(candidate.options.ignoreIfNotExists)))) && (candidate.annotationId === undefined || ChangeAnnotationIdentifier.is(candidate.annotationId));
78999
+ }
79000
+ DeleteFile.is = is;
79001
+ })(DeleteFile || (exports.DeleteFile = DeleteFile = {}));
79002
+ var WorkspaceEdit;
79003
+ (function (WorkspaceEdit) {
79004
+ function is(value) {
79005
+ var candidate = value;
79006
+ return candidate &&
79007
+ (candidate.changes !== undefined || candidate.documentChanges !== undefined) &&
79008
+ (candidate.documentChanges === undefined || candidate.documentChanges.every(function (change) {
79009
+ if (Is.string(change.kind)) {
79010
+ return CreateFile.is(change) || RenameFile.is(change) || DeleteFile.is(change);
79011
+ }
79012
+ else {
79013
+ return TextDocumentEdit.is(change);
79014
+ }
79015
+ }));
78594
79016
  }
78595
- if (Is.defined(collapsedText)) {
78596
- result.collapsedText = collapsedText;
79017
+ WorkspaceEdit.is = is;
79018
+ })(WorkspaceEdit || (exports.WorkspaceEdit = WorkspaceEdit = {}));
79019
+ var TextEditChangeImpl = /** @class */ (function () {
79020
+ function TextEditChangeImpl(edits, changeAnnotations) {
79021
+ this.edits = edits;
79022
+ this.changeAnnotations = changeAnnotations;
78597
79023
  }
78598
- return result;
78599
- }
78600
- FoldingRange.create = create;
79024
+ TextEditChangeImpl.prototype.insert = function (position, newText, annotation) {
79025
+ var edit;
79026
+ var id;
79027
+ if (annotation === undefined) {
79028
+ edit = TextEdit.insert(position, newText);
79029
+ }
79030
+ else if (ChangeAnnotationIdentifier.is(annotation)) {
79031
+ id = annotation;
79032
+ edit = AnnotatedTextEdit.insert(position, newText, annotation);
79033
+ }
79034
+ else {
79035
+ this.assertChangeAnnotations(this.changeAnnotations);
79036
+ id = this.changeAnnotations.manage(annotation);
79037
+ edit = AnnotatedTextEdit.insert(position, newText, id);
79038
+ }
79039
+ this.edits.push(edit);
79040
+ if (id !== undefined) {
79041
+ return id;
79042
+ }
79043
+ };
79044
+ TextEditChangeImpl.prototype.replace = function (range, newText, annotation) {
79045
+ var edit;
79046
+ var id;
79047
+ if (annotation === undefined) {
79048
+ edit = TextEdit.replace(range, newText);
79049
+ }
79050
+ else if (ChangeAnnotationIdentifier.is(annotation)) {
79051
+ id = annotation;
79052
+ edit = AnnotatedTextEdit.replace(range, newText, annotation);
79053
+ }
79054
+ else {
79055
+ this.assertChangeAnnotations(this.changeAnnotations);
79056
+ id = this.changeAnnotations.manage(annotation);
79057
+ edit = AnnotatedTextEdit.replace(range, newText, id);
79058
+ }
79059
+ this.edits.push(edit);
79060
+ if (id !== undefined) {
79061
+ return id;
79062
+ }
79063
+ };
79064
+ TextEditChangeImpl.prototype.delete = function (range, annotation) {
79065
+ var edit;
79066
+ var id;
79067
+ if (annotation === undefined) {
79068
+ edit = TextEdit.del(range);
79069
+ }
79070
+ else if (ChangeAnnotationIdentifier.is(annotation)) {
79071
+ id = annotation;
79072
+ edit = AnnotatedTextEdit.del(range, annotation);
79073
+ }
79074
+ else {
79075
+ this.assertChangeAnnotations(this.changeAnnotations);
79076
+ id = this.changeAnnotations.manage(annotation);
79077
+ edit = AnnotatedTextEdit.del(range, id);
79078
+ }
79079
+ this.edits.push(edit);
79080
+ if (id !== undefined) {
79081
+ return id;
79082
+ }
79083
+ };
79084
+ TextEditChangeImpl.prototype.add = function (edit) {
79085
+ this.edits.push(edit);
79086
+ };
79087
+ TextEditChangeImpl.prototype.all = function () {
79088
+ return this.edits;
79089
+ };
79090
+ TextEditChangeImpl.prototype.clear = function () {
79091
+ this.edits.splice(0, this.edits.length);
79092
+ };
79093
+ TextEditChangeImpl.prototype.assertChangeAnnotations = function (value) {
79094
+ if (value === undefined) {
79095
+ throw new Error("Text edit change is not configured to manage change annotations.");
79096
+ }
79097
+ };
79098
+ return TextEditChangeImpl;
79099
+ }());
78601
79100
  /**
78602
- * Checks whether the given literal conforms to the {@link FoldingRange} interface.
79101
+ * A helper class
78603
79102
  */
78604
- function is(value) {
78605
- var candidate = value;
78606
- return Is.objectLiteral(candidate) && Is.uinteger(candidate.startLine) && Is.uinteger(candidate.startLine)
78607
- && (Is.undefined(candidate.startCharacter) || Is.uinteger(candidate.startCharacter))
78608
- && (Is.undefined(candidate.endCharacter) || Is.uinteger(candidate.endCharacter))
78609
- && (Is.undefined(candidate.kind) || Is.string(candidate.kind));
78610
- }
78611
- FoldingRange.is = is;
78612
- })(FoldingRange || (FoldingRange = {}));
78613
- /**
78614
- * The DiagnosticRelatedInformation namespace provides helper functions to work with
78615
- * {@link DiagnosticRelatedInformation} literals.
78616
- */
78617
- var DiagnosticRelatedInformation;
78618
- (function (DiagnosticRelatedInformation) {
79103
+ var ChangeAnnotations = /** @class */ (function () {
79104
+ function ChangeAnnotations(annotations) {
79105
+ this._annotations = annotations === undefined ? Object.create(null) : annotations;
79106
+ this._counter = 0;
79107
+ this._size = 0;
79108
+ }
79109
+ ChangeAnnotations.prototype.all = function () {
79110
+ return this._annotations;
79111
+ };
79112
+ Object.defineProperty(ChangeAnnotations.prototype, "size", {
79113
+ get: function () {
79114
+ return this._size;
79115
+ },
79116
+ enumerable: false,
79117
+ configurable: true
79118
+ });
79119
+ ChangeAnnotations.prototype.manage = function (idOrAnnotation, annotation) {
79120
+ var id;
79121
+ if (ChangeAnnotationIdentifier.is(idOrAnnotation)) {
79122
+ id = idOrAnnotation;
79123
+ }
79124
+ else {
79125
+ id = this.nextId();
79126
+ annotation = idOrAnnotation;
79127
+ }
79128
+ if (this._annotations[id] !== undefined) {
79129
+ throw new Error("Id ".concat(id, " is already in use."));
79130
+ }
79131
+ if (annotation === undefined) {
79132
+ throw new Error("No annotation provided for id ".concat(id));
79133
+ }
79134
+ this._annotations[id] = annotation;
79135
+ this._size++;
79136
+ return id;
79137
+ };
79138
+ ChangeAnnotations.prototype.nextId = function () {
79139
+ this._counter++;
79140
+ return this._counter.toString();
79141
+ };
79142
+ return ChangeAnnotations;
79143
+ }());
78619
79144
  /**
78620
- * Creates a new DiagnosticRelatedInformation literal.
79145
+ * A workspace change helps constructing changes to a workspace.
78621
79146
  */
78622
- function create(location, message) {
78623
- return {
78624
- location: location,
78625
- message: message
79147
+ var WorkspaceChange = /** @class */ (function () {
79148
+ function WorkspaceChange(workspaceEdit) {
79149
+ var _this = this;
79150
+ this._textEditChanges = Object.create(null);
79151
+ if (workspaceEdit !== undefined) {
79152
+ this._workspaceEdit = workspaceEdit;
79153
+ if (workspaceEdit.documentChanges) {
79154
+ this._changeAnnotations = new ChangeAnnotations(workspaceEdit.changeAnnotations);
79155
+ workspaceEdit.changeAnnotations = this._changeAnnotations.all();
79156
+ workspaceEdit.documentChanges.forEach(function (change) {
79157
+ if (TextDocumentEdit.is(change)) {
79158
+ var textEditChange = new TextEditChangeImpl(change.edits, _this._changeAnnotations);
79159
+ _this._textEditChanges[change.textDocument.uri] = textEditChange;
79160
+ }
79161
+ });
79162
+ }
79163
+ else if (workspaceEdit.changes) {
79164
+ Object.keys(workspaceEdit.changes).forEach(function (key) {
79165
+ var textEditChange = new TextEditChangeImpl(workspaceEdit.changes[key]);
79166
+ _this._textEditChanges[key] = textEditChange;
79167
+ });
79168
+ }
79169
+ }
79170
+ else {
79171
+ this._workspaceEdit = {};
79172
+ }
79173
+ }
79174
+ Object.defineProperty(WorkspaceChange.prototype, "edit", {
79175
+ /**
79176
+ * Returns the underlying {@link WorkspaceEdit} literal
79177
+ * use to be returned from a workspace edit operation like rename.
79178
+ */
79179
+ get: function () {
79180
+ this.initDocumentChanges();
79181
+ if (this._changeAnnotations !== undefined) {
79182
+ if (this._changeAnnotations.size === 0) {
79183
+ this._workspaceEdit.changeAnnotations = undefined;
79184
+ }
79185
+ else {
79186
+ this._workspaceEdit.changeAnnotations = this._changeAnnotations.all();
79187
+ }
79188
+ }
79189
+ return this._workspaceEdit;
79190
+ },
79191
+ enumerable: false,
79192
+ configurable: true
79193
+ });
79194
+ WorkspaceChange.prototype.getTextEditChange = function (key) {
79195
+ if (OptionalVersionedTextDocumentIdentifier.is(key)) {
79196
+ this.initDocumentChanges();
79197
+ if (this._workspaceEdit.documentChanges === undefined) {
79198
+ throw new Error('Workspace edit is not configured for document changes.');
79199
+ }
79200
+ var textDocument = { uri: key.uri, version: key.version };
79201
+ var result = this._textEditChanges[textDocument.uri];
79202
+ if (!result) {
79203
+ var edits = [];
79204
+ var textDocumentEdit = {
79205
+ textDocument: textDocument,
79206
+ edits: edits
79207
+ };
79208
+ this._workspaceEdit.documentChanges.push(textDocumentEdit);
79209
+ result = new TextEditChangeImpl(edits, this._changeAnnotations);
79210
+ this._textEditChanges[textDocument.uri] = result;
79211
+ }
79212
+ return result;
79213
+ }
79214
+ else {
79215
+ this.initChanges();
79216
+ if (this._workspaceEdit.changes === undefined) {
79217
+ throw new Error('Workspace edit is not configured for normal text edit changes.');
79218
+ }
79219
+ var result = this._textEditChanges[key];
79220
+ if (!result) {
79221
+ var edits = [];
79222
+ this._workspaceEdit.changes[key] = edits;
79223
+ result = new TextEditChangeImpl(edits);
79224
+ this._textEditChanges[key] = result;
79225
+ }
79226
+ return result;
79227
+ }
78626
79228
  };
78627
- }
78628
- DiagnosticRelatedInformation.create = create;
79229
+ WorkspaceChange.prototype.initDocumentChanges = function () {
79230
+ if (this._workspaceEdit.documentChanges === undefined && this._workspaceEdit.changes === undefined) {
79231
+ this._changeAnnotations = new ChangeAnnotations();
79232
+ this._workspaceEdit.documentChanges = [];
79233
+ this._workspaceEdit.changeAnnotations = this._changeAnnotations.all();
79234
+ }
79235
+ };
79236
+ WorkspaceChange.prototype.initChanges = function () {
79237
+ if (this._workspaceEdit.documentChanges === undefined && this._workspaceEdit.changes === undefined) {
79238
+ this._workspaceEdit.changes = Object.create(null);
79239
+ }
79240
+ };
79241
+ WorkspaceChange.prototype.createFile = function (uri, optionsOrAnnotation, options) {
79242
+ this.initDocumentChanges();
79243
+ if (this._workspaceEdit.documentChanges === undefined) {
79244
+ throw new Error('Workspace edit is not configured for document changes.');
79245
+ }
79246
+ var annotation;
79247
+ if (ChangeAnnotation.is(optionsOrAnnotation) || ChangeAnnotationIdentifier.is(optionsOrAnnotation)) {
79248
+ annotation = optionsOrAnnotation;
79249
+ }
79250
+ else {
79251
+ options = optionsOrAnnotation;
79252
+ }
79253
+ var operation;
79254
+ var id;
79255
+ if (annotation === undefined) {
79256
+ operation = CreateFile.create(uri, options);
79257
+ }
79258
+ else {
79259
+ id = ChangeAnnotationIdentifier.is(annotation) ? annotation : this._changeAnnotations.manage(annotation);
79260
+ operation = CreateFile.create(uri, options, id);
79261
+ }
79262
+ this._workspaceEdit.documentChanges.push(operation);
79263
+ if (id !== undefined) {
79264
+ return id;
79265
+ }
79266
+ };
79267
+ WorkspaceChange.prototype.renameFile = function (oldUri, newUri, optionsOrAnnotation, options) {
79268
+ this.initDocumentChanges();
79269
+ if (this._workspaceEdit.documentChanges === undefined) {
79270
+ throw new Error('Workspace edit is not configured for document changes.');
79271
+ }
79272
+ var annotation;
79273
+ if (ChangeAnnotation.is(optionsOrAnnotation) || ChangeAnnotationIdentifier.is(optionsOrAnnotation)) {
79274
+ annotation = optionsOrAnnotation;
79275
+ }
79276
+ else {
79277
+ options = optionsOrAnnotation;
79278
+ }
79279
+ var operation;
79280
+ var id;
79281
+ if (annotation === undefined) {
79282
+ operation = RenameFile.create(oldUri, newUri, options);
79283
+ }
79284
+ else {
79285
+ id = ChangeAnnotationIdentifier.is(annotation) ? annotation : this._changeAnnotations.manage(annotation);
79286
+ operation = RenameFile.create(oldUri, newUri, options, id);
79287
+ }
79288
+ this._workspaceEdit.documentChanges.push(operation);
79289
+ if (id !== undefined) {
79290
+ return id;
79291
+ }
79292
+ };
79293
+ WorkspaceChange.prototype.deleteFile = function (uri, optionsOrAnnotation, options) {
79294
+ this.initDocumentChanges();
79295
+ if (this._workspaceEdit.documentChanges === undefined) {
79296
+ throw new Error('Workspace edit is not configured for document changes.');
79297
+ }
79298
+ var annotation;
79299
+ if (ChangeAnnotation.is(optionsOrAnnotation) || ChangeAnnotationIdentifier.is(optionsOrAnnotation)) {
79300
+ annotation = optionsOrAnnotation;
79301
+ }
79302
+ else {
79303
+ options = optionsOrAnnotation;
79304
+ }
79305
+ var operation;
79306
+ var id;
79307
+ if (annotation === undefined) {
79308
+ operation = DeleteFile.create(uri, options);
79309
+ }
79310
+ else {
79311
+ id = ChangeAnnotationIdentifier.is(annotation) ? annotation : this._changeAnnotations.manage(annotation);
79312
+ operation = DeleteFile.create(uri, options, id);
79313
+ }
79314
+ this._workspaceEdit.documentChanges.push(operation);
79315
+ if (id !== undefined) {
79316
+ return id;
79317
+ }
79318
+ };
79319
+ return WorkspaceChange;
79320
+ }());
79321
+ exports.WorkspaceChange = WorkspaceChange;
78629
79322
  /**
78630
- * Checks whether the given literal conforms to the {@link DiagnosticRelatedInformation} interface.
79323
+ * The TextDocumentIdentifier namespace provides helper functions to work with
79324
+ * {@link TextDocumentIdentifier} literals.
78631
79325
  */
78632
- function is(value) {
78633
- var candidate = value;
78634
- return Is.defined(candidate) && Location.is(candidate.location) && Is.string(candidate.message);
78635
- }
78636
- DiagnosticRelatedInformation.is = is;
78637
- })(DiagnosticRelatedInformation || (DiagnosticRelatedInformation = {}));
78638
- /**
78639
- * The diagnostic's severity.
78640
- */
78641
- var DiagnosticSeverity;
78642
- (function (DiagnosticSeverity) {
79326
+ var TextDocumentIdentifier;
79327
+ (function (TextDocumentIdentifier) {
79328
+ /**
79329
+ * Creates a new TextDocumentIdentifier literal.
79330
+ * @param uri The document's uri.
79331
+ */
79332
+ function create(uri) {
79333
+ return { uri: uri };
79334
+ }
79335
+ TextDocumentIdentifier.create = create;
79336
+ /**
79337
+ * Checks whether the given literal conforms to the {@link TextDocumentIdentifier} interface.
79338
+ */
79339
+ function is(value) {
79340
+ var candidate = value;
79341
+ return Is.defined(candidate) && Is.string(candidate.uri);
79342
+ }
79343
+ TextDocumentIdentifier.is = is;
79344
+ })(TextDocumentIdentifier || (exports.TextDocumentIdentifier = TextDocumentIdentifier = {}));
79345
+ /**
79346
+ * The VersionedTextDocumentIdentifier namespace provides helper functions to work with
79347
+ * {@link VersionedTextDocumentIdentifier} literals.
79348
+ */
79349
+ var VersionedTextDocumentIdentifier;
79350
+ (function (VersionedTextDocumentIdentifier) {
79351
+ /**
79352
+ * Creates a new VersionedTextDocumentIdentifier literal.
79353
+ * @param uri The document's uri.
79354
+ * @param version The document's version.
79355
+ */
79356
+ function create(uri, version) {
79357
+ return { uri: uri, version: version };
79358
+ }
79359
+ VersionedTextDocumentIdentifier.create = create;
79360
+ /**
79361
+ * Checks whether the given literal conforms to the {@link VersionedTextDocumentIdentifier} interface.
79362
+ */
79363
+ function is(value) {
79364
+ var candidate = value;
79365
+ return Is.defined(candidate) && Is.string(candidate.uri) && Is.integer(candidate.version);
79366
+ }
79367
+ VersionedTextDocumentIdentifier.is = is;
79368
+ })(VersionedTextDocumentIdentifier || (exports.VersionedTextDocumentIdentifier = VersionedTextDocumentIdentifier = {}));
78643
79369
  /**
78644
- * Reports an error.
79370
+ * The OptionalVersionedTextDocumentIdentifier namespace provides helper functions to work with
79371
+ * {@link OptionalVersionedTextDocumentIdentifier} literals.
78645
79372
  */
78646
- DiagnosticSeverity.Error = 1;
79373
+ var OptionalVersionedTextDocumentIdentifier;
79374
+ (function (OptionalVersionedTextDocumentIdentifier) {
79375
+ /**
79376
+ * Creates a new OptionalVersionedTextDocumentIdentifier literal.
79377
+ * @param uri The document's uri.
79378
+ * @param version The document's version.
79379
+ */
79380
+ function create(uri, version) {
79381
+ return { uri: uri, version: version };
79382
+ }
79383
+ OptionalVersionedTextDocumentIdentifier.create = create;
79384
+ /**
79385
+ * Checks whether the given literal conforms to the {@link OptionalVersionedTextDocumentIdentifier} interface.
79386
+ */
79387
+ function is(value) {
79388
+ var candidate = value;
79389
+ return Is.defined(candidate) && Is.string(candidate.uri) && (candidate.version === null || Is.integer(candidate.version));
79390
+ }
79391
+ OptionalVersionedTextDocumentIdentifier.is = is;
79392
+ })(OptionalVersionedTextDocumentIdentifier || (exports.OptionalVersionedTextDocumentIdentifier = OptionalVersionedTextDocumentIdentifier = {}));
78647
79393
  /**
78648
- * Reports a warning.
79394
+ * The TextDocumentItem namespace provides helper functions to work with
79395
+ * {@link TextDocumentItem} literals.
78649
79396
  */
78650
- DiagnosticSeverity.Warning = 2;
79397
+ var TextDocumentItem;
79398
+ (function (TextDocumentItem) {
79399
+ /**
79400
+ * Creates a new TextDocumentItem literal.
79401
+ * @param uri The document's uri.
79402
+ * @param languageId The document's language identifier.
79403
+ * @param version The document's version number.
79404
+ * @param text The document's text.
79405
+ */
79406
+ function create(uri, languageId, version, text) {
79407
+ return { uri: uri, languageId: languageId, version: version, text: text };
79408
+ }
79409
+ TextDocumentItem.create = create;
79410
+ /**
79411
+ * Checks whether the given literal conforms to the {@link TextDocumentItem} interface.
79412
+ */
79413
+ function is(value) {
79414
+ var candidate = value;
79415
+ return Is.defined(candidate) && Is.string(candidate.uri) && Is.string(candidate.languageId) && Is.integer(candidate.version) && Is.string(candidate.text);
79416
+ }
79417
+ TextDocumentItem.is = is;
79418
+ })(TextDocumentItem || (exports.TextDocumentItem = TextDocumentItem = {}));
78651
79419
  /**
78652
- * Reports an information.
79420
+ * Describes the content type that a client supports in various
79421
+ * result literals like `Hover`, `ParameterInfo` or `CompletionItem`.
79422
+ *
79423
+ * Please note that `MarkupKinds` must not start with a `$`. This kinds
79424
+ * are reserved for internal usage.
78653
79425
  */
78654
- DiagnosticSeverity.Information = 3;
79426
+ var MarkupKind;
79427
+ (function (MarkupKind) {
79428
+ /**
79429
+ * Plain text is supported as a content format
79430
+ */
79431
+ MarkupKind.PlainText = 'plaintext';
79432
+ /**
79433
+ * Markdown is supported as a content format
79434
+ */
79435
+ MarkupKind.Markdown = 'markdown';
79436
+ /**
79437
+ * Checks whether the given value is a value of the {@link MarkupKind} type.
79438
+ */
79439
+ function is(value) {
79440
+ var candidate = value;
79441
+ return candidate === MarkupKind.PlainText || candidate === MarkupKind.Markdown;
79442
+ }
79443
+ MarkupKind.is = is;
79444
+ })(MarkupKind || (exports.MarkupKind = MarkupKind = {}));
79445
+ var MarkupContent;
79446
+ (function (MarkupContent) {
79447
+ /**
79448
+ * Checks whether the given value conforms to the {@link MarkupContent} interface.
79449
+ */
79450
+ function is(value) {
79451
+ var candidate = value;
79452
+ return Is.objectLiteral(value) && MarkupKind.is(candidate.kind) && Is.string(candidate.value);
79453
+ }
79454
+ MarkupContent.is = is;
79455
+ })(MarkupContent || (exports.MarkupContent = MarkupContent = {}));
78655
79456
  /**
78656
- * Reports a hint.
79457
+ * The kind of a completion entry.
78657
79458
  */
78658
- DiagnosticSeverity.Hint = 4;
78659
- })(DiagnosticSeverity || (DiagnosticSeverity = {}));
78660
- /**
78661
- * The diagnostic tags.
78662
- *
78663
- * @since 3.15.0
78664
- */
78665
- var DiagnosticTag;
78666
- (function (DiagnosticTag) {
79459
+ var CompletionItemKind;
79460
+ (function (CompletionItemKind) {
79461
+ CompletionItemKind.Text = 1;
79462
+ CompletionItemKind.Method = 2;
79463
+ CompletionItemKind.Function = 3;
79464
+ CompletionItemKind.Constructor = 4;
79465
+ CompletionItemKind.Field = 5;
79466
+ CompletionItemKind.Variable = 6;
79467
+ CompletionItemKind.Class = 7;
79468
+ CompletionItemKind.Interface = 8;
79469
+ CompletionItemKind.Module = 9;
79470
+ CompletionItemKind.Property = 10;
79471
+ CompletionItemKind.Unit = 11;
79472
+ CompletionItemKind.Value = 12;
79473
+ CompletionItemKind.Enum = 13;
79474
+ CompletionItemKind.Keyword = 14;
79475
+ CompletionItemKind.Snippet = 15;
79476
+ CompletionItemKind.Color = 16;
79477
+ CompletionItemKind.File = 17;
79478
+ CompletionItemKind.Reference = 18;
79479
+ CompletionItemKind.Folder = 19;
79480
+ CompletionItemKind.EnumMember = 20;
79481
+ CompletionItemKind.Constant = 21;
79482
+ CompletionItemKind.Struct = 22;
79483
+ CompletionItemKind.Event = 23;
79484
+ CompletionItemKind.Operator = 24;
79485
+ CompletionItemKind.TypeParameter = 25;
79486
+ })(CompletionItemKind || (exports.CompletionItemKind = CompletionItemKind = {}));
78667
79487
  /**
78668
- * Unused or unnecessary code.
78669
- *
78670
- * Clients are allowed to render diagnostics with this tag faded out instead of having
78671
- * an error squiggle.
79488
+ * Defines whether the insert text in a completion item should be interpreted as
79489
+ * plain text or a snippet.
78672
79490
  */
78673
- DiagnosticTag.Unnecessary = 1;
79491
+ var InsertTextFormat;
79492
+ (function (InsertTextFormat) {
79493
+ /**
79494
+ * The primary text to be inserted is treated as a plain string.
79495
+ */
79496
+ InsertTextFormat.PlainText = 1;
79497
+ /**
79498
+ * The primary text to be inserted is treated as a snippet.
79499
+ *
79500
+ * A snippet can define tab stops and placeholders with `$1`, `$2`
79501
+ * and `${3:foo}`. `$0` defines the final tab stop, it defaults to
79502
+ * the end of the snippet. Placeholders with equal identifiers are linked,
79503
+ * that is typing in one will update others too.
79504
+ *
79505
+ * See also: https://microsoft.github.io/language-server-protocol/specifications/specification-current/#snippet_syntax
79506
+ */
79507
+ InsertTextFormat.Snippet = 2;
79508
+ })(InsertTextFormat || (exports.InsertTextFormat = InsertTextFormat = {}));
78674
79509
  /**
78675
- * Deprecated or obsolete code.
79510
+ * Completion item tags are extra annotations that tweak the rendering of a completion
79511
+ * item.
78676
79512
  *
78677
- * Clients are allowed to rendered diagnostics with this tag strike through.
79513
+ * @since 3.15.0
78678
79514
  */
78679
- DiagnosticTag.Deprecated = 2;
78680
- })(DiagnosticTag || (DiagnosticTag = {}));
78681
- /**
78682
- * The CodeDescription namespace provides functions to deal with descriptions for diagnostic codes.
78683
- *
78684
- * @since 3.16.0
78685
- */
78686
- var CodeDescription;
78687
- (function (CodeDescription) {
78688
- function is(value) {
78689
- var candidate = value;
78690
- return Is.objectLiteral(candidate) && Is.string(candidate.href);
78691
- }
78692
- CodeDescription.is = is;
78693
- })(CodeDescription || (CodeDescription = {}));
78694
- /**
78695
- * The Diagnostic namespace provides helper functions to work with
78696
- * {@link Diagnostic} literals.
78697
- */
78698
- var Diagnostic;
78699
- (function (Diagnostic) {
79515
+ var CompletionItemTag;
79516
+ (function (CompletionItemTag) {
79517
+ /**
79518
+ * Render a completion as obsolete, usually using a strike-out.
79519
+ */
79520
+ CompletionItemTag.Deprecated = 1;
79521
+ })(CompletionItemTag || (exports.CompletionItemTag = CompletionItemTag = {}));
78700
79522
  /**
78701
- * Creates a new Diagnostic literal.
79523
+ * The InsertReplaceEdit namespace provides functions to deal with insert / replace edits.
79524
+ *
79525
+ * @since 3.16.0
78702
79526
  */
78703
- function create(range, message, severity, code, source, relatedInformation) {
78704
- var result = { range: range, message: message };
78705
- if (Is.defined(severity)) {
78706
- result.severity = severity;
78707
- }
78708
- if (Is.defined(code)) {
78709
- result.code = code;
78710
- }
78711
- if (Is.defined(source)) {
78712
- result.source = source;
79527
+ var InsertReplaceEdit;
79528
+ (function (InsertReplaceEdit) {
79529
+ /**
79530
+ * Creates a new insert / replace edit
79531
+ */
79532
+ function create(newText, insert, replace) {
79533
+ return { newText: newText, insert: insert, replace: replace };
78713
79534
  }
78714
- if (Is.defined(relatedInformation)) {
78715
- result.relatedInformation = relatedInformation;
79535
+ InsertReplaceEdit.create = create;
79536
+ /**
79537
+ * Checks whether the given literal conforms to the {@link InsertReplaceEdit} interface.
79538
+ */
79539
+ function is(value) {
79540
+ var candidate = value;
79541
+ return candidate && Is.string(candidate.newText) && Range.is(candidate.insert) && Range.is(candidate.replace);
78716
79542
  }
78717
- return result;
78718
- }
78719
- Diagnostic.create = create;
79543
+ InsertReplaceEdit.is = is;
79544
+ })(InsertReplaceEdit || (exports.InsertReplaceEdit = InsertReplaceEdit = {}));
78720
79545
  /**
78721
- * Checks whether the given literal conforms to the {@link Diagnostic} interface.
79546
+ * How whitespace and indentation is handled during completion
79547
+ * item insertion.
79548
+ *
79549
+ * @since 3.16.0
78722
79550
  */
78723
- function is(value) {
78724
- var _a;
78725
- var candidate = value;
78726
- return Is.defined(candidate)
78727
- && Range.is(candidate.range)
78728
- && Is.string(candidate.message)
78729
- && (Is.number(candidate.severity) || Is.undefined(candidate.severity))
78730
- && (Is.integer(candidate.code) || Is.string(candidate.code) || Is.undefined(candidate.code))
78731
- && (Is.undefined(candidate.codeDescription) || (Is.string((_a = candidate.codeDescription) === null || _a === void 0 ? void 0 : _a.href)))
78732
- && (Is.string(candidate.source) || Is.undefined(candidate.source))
78733
- && (Is.undefined(candidate.relatedInformation) || Is.typedArray(candidate.relatedInformation, DiagnosticRelatedInformation.is));
78734
- }
78735
- Diagnostic.is = is;
78736
- })(Diagnostic || (Diagnostic = {}));
78737
- /**
78738
- * The Command namespace provides helper functions to work with
78739
- * {@link Command} literals.
78740
- */
78741
- var Command;
78742
- (function (Command) {
79551
+ var InsertTextMode;
79552
+ (function (InsertTextMode) {
79553
+ /**
79554
+ * The insertion or replace strings is taken as it is. If the
79555
+ * value is multi line the lines below the cursor will be
79556
+ * inserted using the indentation defined in the string value.
79557
+ * The client will not apply any kind of adjustments to the
79558
+ * string.
79559
+ */
79560
+ InsertTextMode.asIs = 1;
79561
+ /**
79562
+ * The editor adjusts leading whitespace of new lines so that
79563
+ * they match the indentation up to the cursor of the line for
79564
+ * which the item is accepted.
79565
+ *
79566
+ * Consider a line like this: <2tabs><cursor><3tabs>foo. Accepting a
79567
+ * multi line completion item is indented using 2 tabs and all
79568
+ * following lines inserted will be indented using 2 tabs as well.
79569
+ */
79570
+ InsertTextMode.adjustIndentation = 2;
79571
+ })(InsertTextMode || (exports.InsertTextMode = InsertTextMode = {}));
79572
+ var CompletionItemLabelDetails;
79573
+ (function (CompletionItemLabelDetails) {
79574
+ function is(value) {
79575
+ var candidate = value;
79576
+ return candidate && (Is.string(candidate.detail) || candidate.detail === undefined) &&
79577
+ (Is.string(candidate.description) || candidate.description === undefined);
79578
+ }
79579
+ CompletionItemLabelDetails.is = is;
79580
+ })(CompletionItemLabelDetails || (exports.CompletionItemLabelDetails = CompletionItemLabelDetails = {}));
78743
79581
  /**
78744
- * Creates a new Command literal.
79582
+ * The CompletionItem namespace provides functions to deal with
79583
+ * completion items.
78745
79584
  */
78746
- function create(title, command) {
78747
- var args = [];
78748
- for (var _i = 2; _i < arguments.length; _i++) {
78749
- args[_i - 2] = arguments[_i];
79585
+ var CompletionItem;
79586
+ (function (CompletionItem) {
79587
+ /**
79588
+ * Create a completion item and seed it with a label.
79589
+ * @param label The completion item's label
79590
+ */
79591
+ function create(label) {
79592
+ return { label: label };
78750
79593
  }
78751
- var result = { title: title, command: command };
78752
- if (Is.defined(args) && args.length > 0) {
78753
- result.arguments = args;
79594
+ CompletionItem.create = create;
79595
+ })(CompletionItem || (exports.CompletionItem = CompletionItem = {}));
79596
+ /**
79597
+ * The CompletionList namespace provides functions to deal with
79598
+ * completion lists.
79599
+ */
79600
+ var CompletionList;
79601
+ (function (CompletionList) {
79602
+ /**
79603
+ * Creates a new completion list.
79604
+ *
79605
+ * @param items The completion items.
79606
+ * @param isIncomplete The list is not complete.
79607
+ */
79608
+ function create(items, isIncomplete) {
79609
+ return { items: items ? items : [], isIncomplete: !!isIncomplete };
78754
79610
  }
78755
- return result;
78756
- }
78757
- Command.create = create;
79611
+ CompletionList.create = create;
79612
+ })(CompletionList || (exports.CompletionList = CompletionList = {}));
79613
+ var MarkedString;
79614
+ (function (MarkedString) {
79615
+ /**
79616
+ * Creates a marked string from plain text.
79617
+ *
79618
+ * @param plainText The plain text.
79619
+ */
79620
+ function fromPlainText(plainText) {
79621
+ return plainText.replace(/[\\`*_{}[\]()#+\-.!]/g, '\\$&'); // escape markdown syntax tokens: http://daringfireball.net/projects/markdown/syntax#backslash
79622
+ }
79623
+ MarkedString.fromPlainText = fromPlainText;
79624
+ /**
79625
+ * Checks whether the given value conforms to the {@link MarkedString} type.
79626
+ */
79627
+ function is(value) {
79628
+ var candidate = value;
79629
+ return Is.string(candidate) || (Is.objectLiteral(candidate) && Is.string(candidate.language) && Is.string(candidate.value));
79630
+ }
79631
+ MarkedString.is = is;
79632
+ })(MarkedString || (exports.MarkedString = MarkedString = {}));
79633
+ var Hover;
79634
+ (function (Hover) {
79635
+ /**
79636
+ * Checks whether the given value conforms to the {@link Hover} interface.
79637
+ */
79638
+ function is(value) {
79639
+ var candidate = value;
79640
+ return !!candidate && Is.objectLiteral(candidate) && (MarkupContent.is(candidate.contents) ||
79641
+ MarkedString.is(candidate.contents) ||
79642
+ Is.typedArray(candidate.contents, MarkedString.is)) && (value.range === undefined || Range.is(value.range));
79643
+ }
79644
+ Hover.is = is;
79645
+ })(Hover || (exports.Hover = Hover = {}));
78758
79646
  /**
78759
- * Checks whether the given literal conforms to the {@link Command} interface.
79647
+ * The ParameterInformation namespace provides helper functions to work with
79648
+ * {@link ParameterInformation} literals.
78760
79649
  */
78761
- function is(value) {
78762
- var candidate = value;
78763
- return Is.defined(candidate) && Is.string(candidate.title) && Is.string(candidate.command);
78764
- }
78765
- Command.is = is;
78766
- })(Command || (Command = {}));
78767
- /**
78768
- * The TextEdit namespace provides helper function to create replace,
78769
- * insert and delete edits more easily.
78770
- */
78771
- var TextEdit;
78772
- (function (TextEdit) {
79650
+ var ParameterInformation;
79651
+ (function (ParameterInformation) {
79652
+ /**
79653
+ * Creates a new parameter information literal.
79654
+ *
79655
+ * @param label A label string.
79656
+ * @param documentation A doc string.
79657
+ */
79658
+ function create(label, documentation) {
79659
+ return documentation ? { label: label, documentation: documentation } : { label: label };
79660
+ }
79661
+ ParameterInformation.create = create;
79662
+ })(ParameterInformation || (exports.ParameterInformation = ParameterInformation = {}));
78773
79663
  /**
78774
- * Creates a replace text edit.
78775
- * @param range The range of text to be replaced.
78776
- * @param newText The new text.
79664
+ * The SignatureInformation namespace provides helper functions to work with
79665
+ * {@link SignatureInformation} literals.
78777
79666
  */
78778
- function replace(range, newText) {
78779
- return { range: range, newText: newText };
78780
- }
78781
- TextEdit.replace = replace;
79667
+ var SignatureInformation;
79668
+ (function (SignatureInformation) {
79669
+ function create(label, documentation) {
79670
+ var parameters = [];
79671
+ for (var _i = 2; _i < arguments.length; _i++) {
79672
+ parameters[_i - 2] = arguments[_i];
79673
+ }
79674
+ var result = { label: label };
79675
+ if (Is.defined(documentation)) {
79676
+ result.documentation = documentation;
79677
+ }
79678
+ if (Is.defined(parameters)) {
79679
+ result.parameters = parameters;
79680
+ }
79681
+ else {
79682
+ result.parameters = [];
79683
+ }
79684
+ return result;
79685
+ }
79686
+ SignatureInformation.create = create;
79687
+ })(SignatureInformation || (exports.SignatureInformation = SignatureInformation = {}));
78782
79688
  /**
78783
- * Creates an insert text edit.
78784
- * @param position The position to insert the text at.
78785
- * @param newText The text to be inserted.
79689
+ * A document highlight kind.
78786
79690
  */
78787
- function insert(position, newText) {
78788
- return { range: { start: position, end: position }, newText: newText };
78789
- }
78790
- TextEdit.insert = insert;
79691
+ var DocumentHighlightKind;
79692
+ (function (DocumentHighlightKind) {
79693
+ /**
79694
+ * A textual occurrence.
79695
+ */
79696
+ DocumentHighlightKind.Text = 1;
79697
+ /**
79698
+ * Read-access of a symbol, like reading a variable.
79699
+ */
79700
+ DocumentHighlightKind.Read = 2;
79701
+ /**
79702
+ * Write-access of a symbol, like writing to a variable.
79703
+ */
79704
+ DocumentHighlightKind.Write = 3;
79705
+ })(DocumentHighlightKind || (exports.DocumentHighlightKind = DocumentHighlightKind = {}));
78791
79706
  /**
78792
- * Creates a delete text edit.
78793
- * @param range The range of text to be deleted.
79707
+ * DocumentHighlight namespace to provide helper functions to work with
79708
+ * {@link DocumentHighlight} literals.
78794
79709
  */
78795
- function del(range) {
78796
- return { range: range, newText: '' };
78797
- }
78798
- TextEdit.del = del;
78799
- function is(value) {
78800
- var candidate = value;
78801
- return Is.objectLiteral(candidate)
78802
- && Is.string(candidate.newText)
78803
- && Range.is(candidate.range);
78804
- }
78805
- TextEdit.is = is;
78806
- })(TextEdit || (TextEdit = {}));
78807
- var ChangeAnnotation;
78808
- (function (ChangeAnnotation) {
78809
- function create(label, needsConfirmation, description) {
78810
- var result = { label: label };
78811
- if (needsConfirmation !== undefined) {
78812
- result.needsConfirmation = needsConfirmation;
78813
- }
78814
- if (description !== undefined) {
78815
- result.description = description;
79710
+ var DocumentHighlight;
79711
+ (function (DocumentHighlight) {
79712
+ /**
79713
+ * Create a DocumentHighlight object.
79714
+ * @param range The range the highlight applies to.
79715
+ * @param kind The highlight kind
79716
+ */
79717
+ function create(range, kind) {
79718
+ var result = { range: range };
79719
+ if (Is.number(kind)) {
79720
+ result.kind = kind;
79721
+ }
79722
+ return result;
78816
79723
  }
78817
- return result;
78818
- }
78819
- ChangeAnnotation.create = create;
78820
- function is(value) {
78821
- var candidate = value;
78822
- return Is.objectLiteral(candidate) && Is.string(candidate.label) &&
78823
- (Is.boolean(candidate.needsConfirmation) || candidate.needsConfirmation === undefined) &&
78824
- (Is.string(candidate.description) || candidate.description === undefined);
78825
- }
78826
- ChangeAnnotation.is = is;
78827
- })(ChangeAnnotation || (ChangeAnnotation = {}));
78828
- var ChangeAnnotationIdentifier;
78829
- (function (ChangeAnnotationIdentifier) {
78830
- function is(value) {
78831
- var candidate = value;
78832
- return Is.string(candidate);
78833
- }
78834
- ChangeAnnotationIdentifier.is = is;
78835
- })(ChangeAnnotationIdentifier || (ChangeAnnotationIdentifier = {}));
78836
- var AnnotatedTextEdit;
78837
- (function (AnnotatedTextEdit) {
79724
+ DocumentHighlight.create = create;
79725
+ })(DocumentHighlight || (exports.DocumentHighlight = DocumentHighlight = {}));
78838
79726
  /**
78839
- * Creates an annotated replace text edit.
78840
- *
78841
- * @param range The range of text to be replaced.
78842
- * @param newText The new text.
78843
- * @param annotation The annotation.
79727
+ * A symbol kind.
78844
79728
  */
78845
- function replace(range, newText, annotation) {
78846
- return { range: range, newText: newText, annotationId: annotation };
78847
- }
78848
- AnnotatedTextEdit.replace = replace;
79729
+ var SymbolKind;
79730
+ (function (SymbolKind) {
79731
+ SymbolKind.File = 1;
79732
+ SymbolKind.Module = 2;
79733
+ SymbolKind.Namespace = 3;
79734
+ SymbolKind.Package = 4;
79735
+ SymbolKind.Class = 5;
79736
+ SymbolKind.Method = 6;
79737
+ SymbolKind.Property = 7;
79738
+ SymbolKind.Field = 8;
79739
+ SymbolKind.Constructor = 9;
79740
+ SymbolKind.Enum = 10;
79741
+ SymbolKind.Interface = 11;
79742
+ SymbolKind.Function = 12;
79743
+ SymbolKind.Variable = 13;
79744
+ SymbolKind.Constant = 14;
79745
+ SymbolKind.String = 15;
79746
+ SymbolKind.Number = 16;
79747
+ SymbolKind.Boolean = 17;
79748
+ SymbolKind.Array = 18;
79749
+ SymbolKind.Object = 19;
79750
+ SymbolKind.Key = 20;
79751
+ SymbolKind.Null = 21;
79752
+ SymbolKind.EnumMember = 22;
79753
+ SymbolKind.Struct = 23;
79754
+ SymbolKind.Event = 24;
79755
+ SymbolKind.Operator = 25;
79756
+ SymbolKind.TypeParameter = 26;
79757
+ })(SymbolKind || (exports.SymbolKind = SymbolKind = {}));
78849
79758
  /**
78850
- * Creates an annotated insert text edit.
79759
+ * Symbol tags are extra annotations that tweak the rendering of a symbol.
78851
79760
  *
78852
- * @param position The position to insert the text at.
78853
- * @param newText The text to be inserted.
78854
- * @param annotation The annotation.
79761
+ * @since 3.16
78855
79762
  */
78856
- function insert(position, newText, annotation) {
78857
- return { range: { start: position, end: position }, newText: newText, annotationId: annotation };
78858
- }
78859
- AnnotatedTextEdit.insert = insert;
79763
+ var SymbolTag;
79764
+ (function (SymbolTag) {
79765
+ /**
79766
+ * Render a symbol as obsolete, usually using a strike-out.
79767
+ */
79768
+ SymbolTag.Deprecated = 1;
79769
+ })(SymbolTag || (exports.SymbolTag = SymbolTag = {}));
79770
+ var SymbolInformation;
79771
+ (function (SymbolInformation) {
79772
+ /**
79773
+ * Creates a new symbol information literal.
79774
+ *
79775
+ * @param name The name of the symbol.
79776
+ * @param kind The kind of the symbol.
79777
+ * @param range The range of the location of the symbol.
79778
+ * @param uri The resource of the location of symbol.
79779
+ * @param containerName The name of the symbol containing the symbol.
79780
+ */
79781
+ function create(name, kind, range, uri, containerName) {
79782
+ var result = {
79783
+ name: name,
79784
+ kind: kind,
79785
+ location: { uri: uri, range: range }
79786
+ };
79787
+ if (containerName) {
79788
+ result.containerName = containerName;
79789
+ }
79790
+ return result;
79791
+ }
79792
+ SymbolInformation.create = create;
79793
+ })(SymbolInformation || (exports.SymbolInformation = SymbolInformation = {}));
79794
+ var WorkspaceSymbol;
79795
+ (function (WorkspaceSymbol) {
79796
+ /**
79797
+ * Create a new workspace symbol.
79798
+ *
79799
+ * @param name The name of the symbol.
79800
+ * @param kind The kind of the symbol.
79801
+ * @param uri The resource of the location of the symbol.
79802
+ * @param range An options range of the location.
79803
+ * @returns A WorkspaceSymbol.
79804
+ */
79805
+ function create(name, kind, uri, range) {
79806
+ return range !== undefined
79807
+ ? { name: name, kind: kind, location: { uri: uri, range: range } }
79808
+ : { name: name, kind: kind, location: { uri: uri } };
79809
+ }
79810
+ WorkspaceSymbol.create = create;
79811
+ })(WorkspaceSymbol || (exports.WorkspaceSymbol = WorkspaceSymbol = {}));
79812
+ var DocumentSymbol;
79813
+ (function (DocumentSymbol) {
79814
+ /**
79815
+ * Creates a new symbol information literal.
79816
+ *
79817
+ * @param name The name of the symbol.
79818
+ * @param detail The detail of the symbol.
79819
+ * @param kind The kind of the symbol.
79820
+ * @param range The range of the symbol.
79821
+ * @param selectionRange The selectionRange of the symbol.
79822
+ * @param children Children of the symbol.
79823
+ */
79824
+ function create(name, detail, kind, range, selectionRange, children) {
79825
+ var result = {
79826
+ name: name,
79827
+ detail: detail,
79828
+ kind: kind,
79829
+ range: range,
79830
+ selectionRange: selectionRange
79831
+ };
79832
+ if (children !== undefined) {
79833
+ result.children = children;
79834
+ }
79835
+ return result;
79836
+ }
79837
+ DocumentSymbol.create = create;
79838
+ /**
79839
+ * Checks whether the given literal conforms to the {@link DocumentSymbol} interface.
79840
+ */
79841
+ function is(value) {
79842
+ var candidate = value;
79843
+ return candidate &&
79844
+ Is.string(candidate.name) && Is.number(candidate.kind) &&
79845
+ Range.is(candidate.range) && Range.is(candidate.selectionRange) &&
79846
+ (candidate.detail === undefined || Is.string(candidate.detail)) &&
79847
+ (candidate.deprecated === undefined || Is.boolean(candidate.deprecated)) &&
79848
+ (candidate.children === undefined || Array.isArray(candidate.children)) &&
79849
+ (candidate.tags === undefined || Array.isArray(candidate.tags));
79850
+ }
79851
+ DocumentSymbol.is = is;
79852
+ })(DocumentSymbol || (exports.DocumentSymbol = DocumentSymbol = {}));
78860
79853
  /**
78861
- * Creates an annotated delete text edit.
78862
- *
78863
- * @param range The range of text to be deleted.
78864
- * @param annotation The annotation.
79854
+ * A set of predefined code action kinds
78865
79855
  */
78866
- function del(range, annotation) {
78867
- return { range: range, newText: '', annotationId: annotation };
78868
- }
78869
- AnnotatedTextEdit.del = del;
78870
- function is(value) {
78871
- var candidate = value;
78872
- return TextEdit.is(candidate) && (ChangeAnnotation.is(candidate.annotationId) || ChangeAnnotationIdentifier.is(candidate.annotationId));
78873
- }
78874
- AnnotatedTextEdit.is = is;
78875
- })(AnnotatedTextEdit || (AnnotatedTextEdit = {}));
78876
- /**
78877
- * The TextDocumentEdit namespace provides helper function to create
78878
- * an edit that manipulates a text document.
78879
- */
78880
- var TextDocumentEdit;
78881
- (function (TextDocumentEdit) {
79856
+ var CodeActionKind;
79857
+ (function (CodeActionKind) {
79858
+ /**
79859
+ * Empty kind.
79860
+ */
79861
+ CodeActionKind.Empty = '';
79862
+ /**
79863
+ * Base kind for quickfix actions: 'quickfix'
79864
+ */
79865
+ CodeActionKind.QuickFix = 'quickfix';
79866
+ /**
79867
+ * Base kind for refactoring actions: 'refactor'
79868
+ */
79869
+ CodeActionKind.Refactor = 'refactor';
79870
+ /**
79871
+ * Base kind for refactoring extraction actions: 'refactor.extract'
79872
+ *
79873
+ * Example extract actions:
79874
+ *
79875
+ * - Extract method
79876
+ * - Extract function
79877
+ * - Extract variable
79878
+ * - Extract interface from class
79879
+ * - ...
79880
+ */
79881
+ CodeActionKind.RefactorExtract = 'refactor.extract';
79882
+ /**
79883
+ * Base kind for refactoring inline actions: 'refactor.inline'
79884
+ *
79885
+ * Example inline actions:
79886
+ *
79887
+ * - Inline function
79888
+ * - Inline variable
79889
+ * - Inline constant
79890
+ * - ...
79891
+ */
79892
+ CodeActionKind.RefactorInline = 'refactor.inline';
79893
+ /**
79894
+ * Base kind for refactoring rewrite actions: 'refactor.rewrite'
79895
+ *
79896
+ * Example rewrite actions:
79897
+ *
79898
+ * - Convert JavaScript function to class
79899
+ * - Add or remove parameter
79900
+ * - Encapsulate field
79901
+ * - Make method static
79902
+ * - Move method to base class
79903
+ * - ...
79904
+ */
79905
+ CodeActionKind.RefactorRewrite = 'refactor.rewrite';
79906
+ /**
79907
+ * Base kind for source actions: `source`
79908
+ *
79909
+ * Source code actions apply to the entire file.
79910
+ */
79911
+ CodeActionKind.Source = 'source';
79912
+ /**
79913
+ * Base kind for an organize imports source action: `source.organizeImports`
79914
+ */
79915
+ CodeActionKind.SourceOrganizeImports = 'source.organizeImports';
79916
+ /**
79917
+ * Base kind for auto-fix source actions: `source.fixAll`.
79918
+ *
79919
+ * Fix all actions automatically fix errors that have a clear fix that do not require user input.
79920
+ * They should not suppress errors or perform unsafe fixes such as generating new types or classes.
79921
+ *
79922
+ * @since 3.15.0
79923
+ */
79924
+ CodeActionKind.SourceFixAll = 'source.fixAll';
79925
+ })(CodeActionKind || (exports.CodeActionKind = CodeActionKind = {}));
78882
79926
  /**
78883
- * Creates a new `TextDocumentEdit`
79927
+ * The reason why code actions were requested.
79928
+ *
79929
+ * @since 3.17.0
78884
79930
  */
78885
- function create(textDocument, edits) {
78886
- return { textDocument: textDocument, edits: edits };
78887
- }
78888
- TextDocumentEdit.create = create;
78889
- function is(value) {
78890
- var candidate = value;
78891
- return Is.defined(candidate)
78892
- && OptionalVersionedTextDocumentIdentifier.is(candidate.textDocument)
78893
- && Array.isArray(candidate.edits);
78894
- }
78895
- TextDocumentEdit.is = is;
78896
- })(TextDocumentEdit || (TextDocumentEdit = {}));
78897
- var CreateFile;
78898
- (function (CreateFile) {
78899
- function create(uri, options, annotation) {
78900
- var result = {
78901
- kind: 'create',
78902
- uri: uri
78903
- };
78904
- if (options !== undefined && (options.overwrite !== undefined || options.ignoreIfExists !== undefined)) {
78905
- result.options = options;
78906
- }
78907
- if (annotation !== undefined) {
78908
- result.annotationId = annotation;
78909
- }
78910
- return result;
78911
- }
78912
- CreateFile.create = create;
78913
- function is(value) {
78914
- var candidate = value;
78915
- return candidate && candidate.kind === 'create' && Is.string(candidate.uri) && (candidate.options === undefined ||
78916
- ((candidate.options.overwrite === undefined || Is.boolean(candidate.options.overwrite)) && (candidate.options.ignoreIfExists === undefined || Is.boolean(candidate.options.ignoreIfExists)))) && (candidate.annotationId === undefined || ChangeAnnotationIdentifier.is(candidate.annotationId));
78917
- }
78918
- CreateFile.is = is;
78919
- })(CreateFile || (CreateFile = {}));
78920
- var RenameFile;
78921
- (function (RenameFile) {
78922
- function create(oldUri, newUri, options, annotation) {
78923
- var result = {
78924
- kind: 'rename',
78925
- oldUri: oldUri,
78926
- newUri: newUri
78927
- };
78928
- if (options !== undefined && (options.overwrite !== undefined || options.ignoreIfExists !== undefined)) {
78929
- result.options = options;
78930
- }
78931
- if (annotation !== undefined) {
78932
- result.annotationId = annotation;
78933
- }
78934
- return result;
78935
- }
78936
- RenameFile.create = create;
78937
- function is(value) {
78938
- var candidate = value;
78939
- return candidate && candidate.kind === 'rename' && Is.string(candidate.oldUri) && Is.string(candidate.newUri) && (candidate.options === undefined ||
78940
- ((candidate.options.overwrite === undefined || Is.boolean(candidate.options.overwrite)) && (candidate.options.ignoreIfExists === undefined || Is.boolean(candidate.options.ignoreIfExists)))) && (candidate.annotationId === undefined || ChangeAnnotationIdentifier.is(candidate.annotationId));
78941
- }
78942
- RenameFile.is = is;
78943
- })(RenameFile || (RenameFile = {}));
78944
- var DeleteFile;
78945
- (function (DeleteFile) {
78946
- function create(uri, options, annotation) {
78947
- var result = {
78948
- kind: 'delete',
78949
- uri: uri
78950
- };
78951
- if (options !== undefined && (options.recursive !== undefined || options.ignoreIfNotExists !== undefined)) {
78952
- result.options = options;
78953
- }
78954
- if (annotation !== undefined) {
78955
- result.annotationId = annotation;
78956
- }
78957
- return result;
78958
- }
78959
- DeleteFile.create = create;
78960
- function is(value) {
78961
- var candidate = value;
78962
- return candidate && candidate.kind === 'delete' && Is.string(candidate.uri) && (candidate.options === undefined ||
78963
- ((candidate.options.recursive === undefined || Is.boolean(candidate.options.recursive)) && (candidate.options.ignoreIfNotExists === undefined || Is.boolean(candidate.options.ignoreIfNotExists)))) && (candidate.annotationId === undefined || ChangeAnnotationIdentifier.is(candidate.annotationId));
78964
- }
78965
- DeleteFile.is = is;
78966
- })(DeleteFile || (DeleteFile = {}));
78967
- var WorkspaceEdit;
78968
- (function (WorkspaceEdit) {
78969
- function is(value) {
78970
- var candidate = value;
78971
- return candidate &&
78972
- (candidate.changes !== undefined || candidate.documentChanges !== undefined) &&
78973
- (candidate.documentChanges === undefined || candidate.documentChanges.every(function (change) {
78974
- if (Is.string(change.kind)) {
78975
- return CreateFile.is(change) || RenameFile.is(change) || DeleteFile.is(change);
78976
- }
78977
- else {
78978
- return TextDocumentEdit.is(change);
78979
- }
78980
- }));
78981
- }
78982
- WorkspaceEdit.is = is;
78983
- })(WorkspaceEdit || (WorkspaceEdit = {}));
78984
- var TextEditChangeImpl = /** @class */ (function () {
78985
- function TextEditChangeImpl(edits, changeAnnotations) {
78986
- this.edits = edits;
78987
- this.changeAnnotations = changeAnnotations;
78988
- }
78989
- TextEditChangeImpl.prototype.insert = function (position, newText, annotation) {
78990
- var edit;
78991
- var id;
78992
- if (annotation === undefined) {
78993
- edit = TextEdit.insert(position, newText);
78994
- }
78995
- else if (ChangeAnnotationIdentifier.is(annotation)) {
78996
- id = annotation;
78997
- edit = AnnotatedTextEdit.insert(position, newText, annotation);
78998
- }
78999
- else {
79000
- this.assertChangeAnnotations(this.changeAnnotations);
79001
- id = this.changeAnnotations.manage(annotation);
79002
- edit = AnnotatedTextEdit.insert(position, newText, id);
79003
- }
79004
- this.edits.push(edit);
79005
- if (id !== undefined) {
79006
- return id;
79007
- }
79008
- };
79009
- TextEditChangeImpl.prototype.replace = function (range, newText, annotation) {
79010
- var edit;
79011
- var id;
79012
- if (annotation === undefined) {
79013
- edit = TextEdit.replace(range, newText);
79014
- }
79015
- else if (ChangeAnnotationIdentifier.is(annotation)) {
79016
- id = annotation;
79017
- edit = AnnotatedTextEdit.replace(range, newText, annotation);
79018
- }
79019
- else {
79020
- this.assertChangeAnnotations(this.changeAnnotations);
79021
- id = this.changeAnnotations.manage(annotation);
79022
- edit = AnnotatedTextEdit.replace(range, newText, id);
79023
- }
79024
- this.edits.push(edit);
79025
- if (id !== undefined) {
79026
- return id;
79027
- }
79028
- };
79029
- TextEditChangeImpl.prototype.delete = function (range, annotation) {
79030
- var edit;
79031
- var id;
79032
- if (annotation === undefined) {
79033
- edit = TextEdit.del(range);
79034
- }
79035
- else if (ChangeAnnotationIdentifier.is(annotation)) {
79036
- id = annotation;
79037
- edit = AnnotatedTextEdit.del(range, annotation);
79038
- }
79039
- else {
79040
- this.assertChangeAnnotations(this.changeAnnotations);
79041
- id = this.changeAnnotations.manage(annotation);
79042
- edit = AnnotatedTextEdit.del(range, id);
79043
- }
79044
- this.edits.push(edit);
79045
- if (id !== undefined) {
79046
- return id;
79047
- }
79048
- };
79049
- TextEditChangeImpl.prototype.add = function (edit) {
79050
- this.edits.push(edit);
79051
- };
79052
- TextEditChangeImpl.prototype.all = function () {
79053
- return this.edits;
79054
- };
79055
- TextEditChangeImpl.prototype.clear = function () {
79056
- this.edits.splice(0, this.edits.length);
79057
- };
79058
- TextEditChangeImpl.prototype.assertChangeAnnotations = function (value) {
79059
- if (value === undefined) {
79060
- throw new Error("Text edit change is not configured to manage change annotations.");
79061
- }
79062
- };
79063
- return TextEditChangeImpl;
79064
- }());
79065
- /**
79066
- * A helper class
79067
- */
79068
- var ChangeAnnotations = /** @class */ (function () {
79069
- function ChangeAnnotations(annotations) {
79070
- this._annotations = annotations === undefined ? Object.create(null) : annotations;
79071
- this._counter = 0;
79072
- this._size = 0;
79073
- }
79074
- ChangeAnnotations.prototype.all = function () {
79075
- return this._annotations;
79076
- };
79077
- Object.defineProperty(ChangeAnnotations.prototype, "size", {
79078
- get: function () {
79079
- return this._size;
79080
- },
79081
- enumerable: false,
79082
- configurable: true
79083
- });
79084
- ChangeAnnotations.prototype.manage = function (idOrAnnotation, annotation) {
79085
- var id;
79086
- if (ChangeAnnotationIdentifier.is(idOrAnnotation)) {
79087
- id = idOrAnnotation;
79088
- }
79089
- else {
79090
- id = this.nextId();
79091
- annotation = idOrAnnotation;
79092
- }
79093
- if (this._annotations[id] !== undefined) {
79094
- throw new Error("Id ".concat(id, " is already in use."));
79095
- }
79096
- if (annotation === undefined) {
79097
- throw new Error("No annotation provided for id ".concat(id));
79098
- }
79099
- this._annotations[id] = annotation;
79100
- this._size++;
79101
- return id;
79102
- };
79103
- ChangeAnnotations.prototype.nextId = function () {
79104
- this._counter++;
79105
- return this._counter.toString();
79106
- };
79107
- return ChangeAnnotations;
79108
- }());
79109
- /**
79110
- * A workspace change helps constructing changes to a workspace.
79111
- */
79112
- var WorkspaceChange = /** @class */ (function () {
79113
- function WorkspaceChange(workspaceEdit) {
79114
- var _this = this;
79115
- this._textEditChanges = Object.create(null);
79116
- if (workspaceEdit !== undefined) {
79117
- this._workspaceEdit = workspaceEdit;
79118
- if (workspaceEdit.documentChanges) {
79119
- this._changeAnnotations = new ChangeAnnotations(workspaceEdit.changeAnnotations);
79120
- workspaceEdit.changeAnnotations = this._changeAnnotations.all();
79121
- workspaceEdit.documentChanges.forEach(function (change) {
79122
- if (TextDocumentEdit.is(change)) {
79123
- var textEditChange = new TextEditChangeImpl(change.edits, _this._changeAnnotations);
79124
- _this._textEditChanges[change.textDocument.uri] = textEditChange;
79125
- }
79126
- });
79931
+ var CodeActionTriggerKind;
79932
+ (function (CodeActionTriggerKind) {
79933
+ /**
79934
+ * Code actions were explicitly requested by the user or by an extension.
79935
+ */
79936
+ CodeActionTriggerKind.Invoked = 1;
79937
+ /**
79938
+ * Code actions were requested automatically.
79939
+ *
79940
+ * This typically happens when current selection in a file changes, but can
79941
+ * also be triggered when file content changes.
79942
+ */
79943
+ CodeActionTriggerKind.Automatic = 2;
79944
+ })(CodeActionTriggerKind || (exports.CodeActionTriggerKind = CodeActionTriggerKind = {}));
79945
+ /**
79946
+ * The CodeActionContext namespace provides helper functions to work with
79947
+ * {@link CodeActionContext} literals.
79948
+ */
79949
+ var CodeActionContext;
79950
+ (function (CodeActionContext) {
79951
+ /**
79952
+ * Creates a new CodeActionContext literal.
79953
+ */
79954
+ function create(diagnostics, only, triggerKind) {
79955
+ var result = { diagnostics: diagnostics };
79956
+ if (only !== undefined && only !== null) {
79957
+ result.only = only;
79127
79958
  }
79128
- else if (workspaceEdit.changes) {
79129
- Object.keys(workspaceEdit.changes).forEach(function (key) {
79130
- var textEditChange = new TextEditChangeImpl(workspaceEdit.changes[key]);
79131
- _this._textEditChanges[key] = textEditChange;
79132
- });
79959
+ if (triggerKind !== undefined && triggerKind !== null) {
79960
+ result.triggerKind = triggerKind;
79133
79961
  }
79962
+ return result;
79134
79963
  }
79135
- else {
79136
- this._workspaceEdit = {};
79137
- }
79138
- }
79139
- Object.defineProperty(WorkspaceChange.prototype, "edit", {
79964
+ CodeActionContext.create = create;
79140
79965
  /**
79141
- * Returns the underlying {@link WorkspaceEdit} literal
79142
- * use to be returned from a workspace edit operation like rename.
79966
+ * Checks whether the given literal conforms to the {@link CodeActionContext} interface.
79143
79967
  */
79144
- get: function () {
79145
- this.initDocumentChanges();
79146
- if (this._changeAnnotations !== undefined) {
79147
- if (this._changeAnnotations.size === 0) {
79148
- this._workspaceEdit.changeAnnotations = undefined;
79149
- }
79150
- else {
79151
- this._workspaceEdit.changeAnnotations = this._changeAnnotations.all();
79152
- }
79968
+ function is(value) {
79969
+ var candidate = value;
79970
+ return Is.defined(candidate) && Is.typedArray(candidate.diagnostics, Diagnostic.is)
79971
+ && (candidate.only === undefined || Is.typedArray(candidate.only, Is.string))
79972
+ && (candidate.triggerKind === undefined || candidate.triggerKind === CodeActionTriggerKind.Invoked || candidate.triggerKind === CodeActionTriggerKind.Automatic);
79973
+ }
79974
+ CodeActionContext.is = is;
79975
+ })(CodeActionContext || (exports.CodeActionContext = CodeActionContext = {}));
79976
+ var CodeAction;
79977
+ (function (CodeAction) {
79978
+ function create(title, kindOrCommandOrEdit, kind) {
79979
+ var result = { title: title };
79980
+ var checkKind = true;
79981
+ if (typeof kindOrCommandOrEdit === 'string') {
79982
+ checkKind = false;
79983
+ result.kind = kindOrCommandOrEdit;
79984
+ }
79985
+ else if (Command.is(kindOrCommandOrEdit)) {
79986
+ result.command = kindOrCommandOrEdit;
79153
79987
  }
79154
- return this._workspaceEdit;
79155
- },
79156
- enumerable: false,
79157
- configurable: true
79158
- });
79159
- WorkspaceChange.prototype.getTextEditChange = function (key) {
79160
- if (OptionalVersionedTextDocumentIdentifier.is(key)) {
79161
- this.initDocumentChanges();
79162
- if (this._workspaceEdit.documentChanges === undefined) {
79163
- throw new Error('Workspace edit is not configured for document changes.');
79988
+ else {
79989
+ result.edit = kindOrCommandOrEdit;
79164
79990
  }
79165
- var textDocument = { uri: key.uri, version: key.version };
79166
- var result = this._textEditChanges[textDocument.uri];
79167
- if (!result) {
79168
- var edits = [];
79169
- var textDocumentEdit = {
79170
- textDocument: textDocument,
79171
- edits: edits
79172
- };
79173
- this._workspaceEdit.documentChanges.push(textDocumentEdit);
79174
- result = new TextEditChangeImpl(edits, this._changeAnnotations);
79175
- this._textEditChanges[textDocument.uri] = result;
79991
+ if (checkKind && kind !== undefined) {
79992
+ result.kind = kind;
79176
79993
  }
79177
79994
  return result;
79178
79995
  }
79179
- else {
79180
- this.initChanges();
79181
- if (this._workspaceEdit.changes === undefined) {
79182
- throw new Error('Workspace edit is not configured for normal text edit changes.');
79183
- }
79184
- var result = this._textEditChanges[key];
79185
- if (!result) {
79186
- var edits = [];
79187
- this._workspaceEdit.changes[key] = edits;
79188
- result = new TextEditChangeImpl(edits);
79189
- this._textEditChanges[key] = result;
79996
+ CodeAction.create = create;
79997
+ function is(value) {
79998
+ var candidate = value;
79999
+ return candidate && Is.string(candidate.title) &&
80000
+ (candidate.diagnostics === undefined || Is.typedArray(candidate.diagnostics, Diagnostic.is)) &&
80001
+ (candidate.kind === undefined || Is.string(candidate.kind)) &&
80002
+ (candidate.edit !== undefined || candidate.command !== undefined) &&
80003
+ (candidate.command === undefined || Command.is(candidate.command)) &&
80004
+ (candidate.isPreferred === undefined || Is.boolean(candidate.isPreferred)) &&
80005
+ (candidate.edit === undefined || WorkspaceEdit.is(candidate.edit));
80006
+ }
80007
+ CodeAction.is = is;
80008
+ })(CodeAction || (exports.CodeAction = CodeAction = {}));
80009
+ /**
80010
+ * The CodeLens namespace provides helper functions to work with
80011
+ * {@link CodeLens} literals.
80012
+ */
80013
+ var CodeLens;
80014
+ (function (CodeLens) {
80015
+ /**
80016
+ * Creates a new CodeLens literal.
80017
+ */
80018
+ function create(range, data) {
80019
+ var result = { range: range };
80020
+ if (Is.defined(data)) {
80021
+ result.data = data;
79190
80022
  }
79191
80023
  return result;
79192
80024
  }
79193
- };
79194
- WorkspaceChange.prototype.initDocumentChanges = function () {
79195
- if (this._workspaceEdit.documentChanges === undefined && this._workspaceEdit.changes === undefined) {
79196
- this._changeAnnotations = new ChangeAnnotations();
79197
- this._workspaceEdit.documentChanges = [];
79198
- this._workspaceEdit.changeAnnotations = this._changeAnnotations.all();
79199
- }
79200
- };
79201
- WorkspaceChange.prototype.initChanges = function () {
79202
- if (this._workspaceEdit.documentChanges === undefined && this._workspaceEdit.changes === undefined) {
79203
- this._workspaceEdit.changes = Object.create(null);
79204
- }
79205
- };
79206
- WorkspaceChange.prototype.createFile = function (uri, optionsOrAnnotation, options) {
79207
- this.initDocumentChanges();
79208
- if (this._workspaceEdit.documentChanges === undefined) {
79209
- throw new Error('Workspace edit is not configured for document changes.');
79210
- }
79211
- var annotation;
79212
- if (ChangeAnnotation.is(optionsOrAnnotation) || ChangeAnnotationIdentifier.is(optionsOrAnnotation)) {
79213
- annotation = optionsOrAnnotation;
79214
- }
79215
- else {
79216
- options = optionsOrAnnotation;
79217
- }
79218
- var operation;
79219
- var id;
79220
- if (annotation === undefined) {
79221
- operation = CreateFile.create(uri, options);
79222
- }
79223
- else {
79224
- id = ChangeAnnotationIdentifier.is(annotation) ? annotation : this._changeAnnotations.manage(annotation);
79225
- operation = CreateFile.create(uri, options, id);
79226
- }
79227
- this._workspaceEdit.documentChanges.push(operation);
79228
- if (id !== undefined) {
79229
- return id;
79230
- }
79231
- };
79232
- WorkspaceChange.prototype.renameFile = function (oldUri, newUri, optionsOrAnnotation, options) {
79233
- this.initDocumentChanges();
79234
- if (this._workspaceEdit.documentChanges === undefined) {
79235
- throw new Error('Workspace edit is not configured for document changes.');
79236
- }
79237
- var annotation;
79238
- if (ChangeAnnotation.is(optionsOrAnnotation) || ChangeAnnotationIdentifier.is(optionsOrAnnotation)) {
79239
- annotation = optionsOrAnnotation;
79240
- }
79241
- else {
79242
- options = optionsOrAnnotation;
79243
- }
79244
- var operation;
79245
- var id;
79246
- if (annotation === undefined) {
79247
- operation = RenameFile.create(oldUri, newUri, options);
79248
- }
79249
- else {
79250
- id = ChangeAnnotationIdentifier.is(annotation) ? annotation : this._changeAnnotations.manage(annotation);
79251
- operation = RenameFile.create(oldUri, newUri, options, id);
79252
- }
79253
- this._workspaceEdit.documentChanges.push(operation);
79254
- if (id !== undefined) {
79255
- return id;
79256
- }
79257
- };
79258
- WorkspaceChange.prototype.deleteFile = function (uri, optionsOrAnnotation, options) {
79259
- this.initDocumentChanges();
79260
- if (this._workspaceEdit.documentChanges === undefined) {
79261
- throw new Error('Workspace edit is not configured for document changes.');
79262
- }
79263
- var annotation;
79264
- if (ChangeAnnotation.is(optionsOrAnnotation) || ChangeAnnotationIdentifier.is(optionsOrAnnotation)) {
79265
- annotation = optionsOrAnnotation;
79266
- }
79267
- else {
79268
- options = optionsOrAnnotation;
79269
- }
79270
- var operation;
79271
- var id;
79272
- if (annotation === undefined) {
79273
- operation = DeleteFile.create(uri, options);
79274
- }
79275
- else {
79276
- id = ChangeAnnotationIdentifier.is(annotation) ? annotation : this._changeAnnotations.manage(annotation);
79277
- operation = DeleteFile.create(uri, options, id);
79278
- }
79279
- this._workspaceEdit.documentChanges.push(operation);
79280
- if (id !== undefined) {
79281
- return id;
80025
+ CodeLens.create = create;
80026
+ /**
80027
+ * Checks whether the given literal conforms to the {@link CodeLens} interface.
80028
+ */
80029
+ function is(value) {
80030
+ var candidate = value;
80031
+ return Is.defined(candidate) && Range.is(candidate.range) && (Is.undefined(candidate.command) || Command.is(candidate.command));
79282
80032
  }
79283
- };
79284
- return WorkspaceChange;
79285
- }());
79286
-
79287
- /**
79288
- * The TextDocumentIdentifier namespace provides helper functions to work with
79289
- * {@link TextDocumentIdentifier} literals.
79290
- */
79291
- var TextDocumentIdentifier;
79292
- (function (TextDocumentIdentifier) {
79293
- /**
79294
- * Creates a new TextDocumentIdentifier literal.
79295
- * @param uri The document's uri.
79296
- */
79297
- function create(uri) {
79298
- return { uri: uri };
79299
- }
79300
- TextDocumentIdentifier.create = create;
79301
- /**
79302
- * Checks whether the given literal conforms to the {@link TextDocumentIdentifier} interface.
79303
- */
79304
- function is(value) {
79305
- var candidate = value;
79306
- return Is.defined(candidate) && Is.string(candidate.uri);
79307
- }
79308
- TextDocumentIdentifier.is = is;
79309
- })(TextDocumentIdentifier || (TextDocumentIdentifier = {}));
79310
- /**
79311
- * The VersionedTextDocumentIdentifier namespace provides helper functions to work with
79312
- * {@link VersionedTextDocumentIdentifier} literals.
79313
- */
79314
- var VersionedTextDocumentIdentifier;
79315
- (function (VersionedTextDocumentIdentifier) {
80033
+ CodeLens.is = is;
80034
+ })(CodeLens || (exports.CodeLens = CodeLens = {}));
79316
80035
  /**
79317
- * Creates a new VersionedTextDocumentIdentifier literal.
79318
- * @param uri The document's uri.
79319
- * @param version The document's version.
80036
+ * The FormattingOptions namespace provides helper functions to work with
80037
+ * {@link FormattingOptions} literals.
79320
80038
  */
79321
- function create(uri, version) {
79322
- return { uri: uri, version: version };
79323
- }
79324
- VersionedTextDocumentIdentifier.create = create;
79325
- /**
79326
- * Checks whether the given literal conforms to the {@link VersionedTextDocumentIdentifier} interface.
79327
- */
79328
- function is(value) {
79329
- var candidate = value;
79330
- return Is.defined(candidate) && Is.string(candidate.uri) && Is.integer(candidate.version);
79331
- }
79332
- VersionedTextDocumentIdentifier.is = is;
79333
- })(VersionedTextDocumentIdentifier || (VersionedTextDocumentIdentifier = {}));
79334
- /**
79335
- * The OptionalVersionedTextDocumentIdentifier namespace provides helper functions to work with
79336
- * {@link OptionalVersionedTextDocumentIdentifier} literals.
79337
- */
79338
- var OptionalVersionedTextDocumentIdentifier;
79339
- (function (OptionalVersionedTextDocumentIdentifier) {
79340
- /**
79341
- * Creates a new OptionalVersionedTextDocumentIdentifier literal.
79342
- * @param uri The document's uri.
79343
- * @param version The document's version.
79344
- */
79345
- function create(uri, version) {
79346
- return { uri: uri, version: version };
79347
- }
79348
- OptionalVersionedTextDocumentIdentifier.create = create;
79349
- /**
79350
- * Checks whether the given literal conforms to the {@link OptionalVersionedTextDocumentIdentifier} interface.
79351
- */
79352
- function is(value) {
79353
- var candidate = value;
79354
- return Is.defined(candidate) && Is.string(candidate.uri) && (candidate.version === null || Is.integer(candidate.version));
79355
- }
79356
- OptionalVersionedTextDocumentIdentifier.is = is;
79357
- })(OptionalVersionedTextDocumentIdentifier || (OptionalVersionedTextDocumentIdentifier = {}));
79358
- /**
79359
- * The TextDocumentItem namespace provides helper functions to work with
79360
- * {@link TextDocumentItem} literals.
79361
- */
79362
- var TextDocumentItem;
79363
- (function (TextDocumentItem) {
79364
- /**
79365
- * Creates a new TextDocumentItem literal.
79366
- * @param uri The document's uri.
79367
- * @param languageId The document's language identifier.
79368
- * @param version The document's version number.
79369
- * @param text The document's text.
79370
- */
79371
- function create(uri, languageId, version, text) {
79372
- return { uri: uri, languageId: languageId, version: version, text: text };
79373
- }
79374
- TextDocumentItem.create = create;
79375
- /**
79376
- * Checks whether the given literal conforms to the {@link TextDocumentItem} interface.
79377
- */
79378
- function is(value) {
79379
- var candidate = value;
79380
- return Is.defined(candidate) && Is.string(candidate.uri) && Is.string(candidate.languageId) && Is.integer(candidate.version) && Is.string(candidate.text);
79381
- }
79382
- TextDocumentItem.is = is;
79383
- })(TextDocumentItem || (TextDocumentItem = {}));
79384
- /**
79385
- * Describes the content type that a client supports in various
79386
- * result literals like `Hover`, `ParameterInfo` or `CompletionItem`.
79387
- *
79388
- * Please note that `MarkupKinds` must not start with a `$`. This kinds
79389
- * are reserved for internal usage.
79390
- */
79391
- var MarkupKind;
79392
- (function (MarkupKind) {
79393
- /**
79394
- * Plain text is supported as a content format
79395
- */
79396
- MarkupKind.PlainText = 'plaintext';
79397
- /**
79398
- * Markdown is supported as a content format
79399
- */
79400
- MarkupKind.Markdown = 'markdown';
79401
- /**
79402
- * Checks whether the given value is a value of the {@link MarkupKind} type.
79403
- */
79404
- function is(value) {
79405
- var candidate = value;
79406
- return candidate === MarkupKind.PlainText || candidate === MarkupKind.Markdown;
79407
- }
79408
- MarkupKind.is = is;
79409
- })(MarkupKind || (MarkupKind = {}));
79410
- var MarkupContent;
79411
- (function (MarkupContent) {
79412
- /**
79413
- * Checks whether the given value conforms to the {@link MarkupContent} interface.
79414
- */
79415
- function is(value) {
79416
- var candidate = value;
79417
- return Is.objectLiteral(value) && MarkupKind.is(candidate.kind) && Is.string(candidate.value);
79418
- }
79419
- MarkupContent.is = is;
79420
- })(MarkupContent || (MarkupContent = {}));
79421
- /**
79422
- * The kind of a completion entry.
79423
- */
79424
- var CompletionItemKind;
79425
- (function (CompletionItemKind) {
79426
- CompletionItemKind.Text = 1;
79427
- CompletionItemKind.Method = 2;
79428
- CompletionItemKind.Function = 3;
79429
- CompletionItemKind.Constructor = 4;
79430
- CompletionItemKind.Field = 5;
79431
- CompletionItemKind.Variable = 6;
79432
- CompletionItemKind.Class = 7;
79433
- CompletionItemKind.Interface = 8;
79434
- CompletionItemKind.Module = 9;
79435
- CompletionItemKind.Property = 10;
79436
- CompletionItemKind.Unit = 11;
79437
- CompletionItemKind.Value = 12;
79438
- CompletionItemKind.Enum = 13;
79439
- CompletionItemKind.Keyword = 14;
79440
- CompletionItemKind.Snippet = 15;
79441
- CompletionItemKind.Color = 16;
79442
- CompletionItemKind.File = 17;
79443
- CompletionItemKind.Reference = 18;
79444
- CompletionItemKind.Folder = 19;
79445
- CompletionItemKind.EnumMember = 20;
79446
- CompletionItemKind.Constant = 21;
79447
- CompletionItemKind.Struct = 22;
79448
- CompletionItemKind.Event = 23;
79449
- CompletionItemKind.Operator = 24;
79450
- CompletionItemKind.TypeParameter = 25;
79451
- })(CompletionItemKind || (CompletionItemKind = {}));
79452
- /**
79453
- * Defines whether the insert text in a completion item should be interpreted as
79454
- * plain text or a snippet.
79455
- */
79456
- var InsertTextFormat;
79457
- (function (InsertTextFormat) {
79458
- /**
79459
- * The primary text to be inserted is treated as a plain string.
79460
- */
79461
- InsertTextFormat.PlainText = 1;
79462
- /**
79463
- * The primary text to be inserted is treated as a snippet.
79464
- *
79465
- * A snippet can define tab stops and placeholders with `$1`, `$2`
79466
- * and `${3:foo}`. `$0` defines the final tab stop, it defaults to
79467
- * the end of the snippet. Placeholders with equal identifiers are linked,
79468
- * that is typing in one will update others too.
79469
- *
79470
- * See also: https://microsoft.github.io/language-server-protocol/specifications/specification-current/#snippet_syntax
79471
- */
79472
- InsertTextFormat.Snippet = 2;
79473
- })(InsertTextFormat || (InsertTextFormat = {}));
79474
- /**
79475
- * Completion item tags are extra annotations that tweak the rendering of a completion
79476
- * item.
79477
- *
79478
- * @since 3.15.0
79479
- */
79480
- var CompletionItemTag;
79481
- (function (CompletionItemTag) {
79482
- /**
79483
- * Render a completion as obsolete, usually using a strike-out.
79484
- */
79485
- CompletionItemTag.Deprecated = 1;
79486
- })(CompletionItemTag || (CompletionItemTag = {}));
79487
- /**
79488
- * The InsertReplaceEdit namespace provides functions to deal with insert / replace edits.
79489
- *
79490
- * @since 3.16.0
79491
- */
79492
- var InsertReplaceEdit;
79493
- (function (InsertReplaceEdit) {
79494
- /**
79495
- * Creates a new insert / replace edit
79496
- */
79497
- function create(newText, insert, replace) {
79498
- return { newText: newText, insert: insert, replace: replace };
79499
- }
79500
- InsertReplaceEdit.create = create;
79501
- /**
79502
- * Checks whether the given literal conforms to the {@link InsertReplaceEdit} interface.
79503
- */
79504
- function is(value) {
79505
- var candidate = value;
79506
- return candidate && Is.string(candidate.newText) && Range.is(candidate.insert) && Range.is(candidate.replace);
79507
- }
79508
- InsertReplaceEdit.is = is;
79509
- })(InsertReplaceEdit || (InsertReplaceEdit = {}));
79510
- /**
79511
- * How whitespace and indentation is handled during completion
79512
- * item insertion.
79513
- *
79514
- * @since 3.16.0
79515
- */
79516
- var InsertTextMode;
79517
- (function (InsertTextMode) {
79518
- /**
79519
- * The insertion or replace strings is taken as it is. If the
79520
- * value is multi line the lines below the cursor will be
79521
- * inserted using the indentation defined in the string value.
79522
- * The client will not apply any kind of adjustments to the
79523
- * string.
79524
- */
79525
- InsertTextMode.asIs = 1;
79526
- /**
79527
- * The editor adjusts leading whitespace of new lines so that
79528
- * they match the indentation up to the cursor of the line for
79529
- * which the item is accepted.
79530
- *
79531
- * Consider a line like this: <2tabs><cursor><3tabs>foo. Accepting a
79532
- * multi line completion item is indented using 2 tabs and all
79533
- * following lines inserted will be indented using 2 tabs as well.
79534
- */
79535
- InsertTextMode.adjustIndentation = 2;
79536
- })(InsertTextMode || (InsertTextMode = {}));
79537
- var CompletionItemLabelDetails;
79538
- (function (CompletionItemLabelDetails) {
79539
- function is(value) {
79540
- var candidate = value;
79541
- return candidate && (Is.string(candidate.detail) || candidate.detail === undefined) &&
79542
- (Is.string(candidate.description) || candidate.description === undefined);
79543
- }
79544
- CompletionItemLabelDetails.is = is;
79545
- })(CompletionItemLabelDetails || (CompletionItemLabelDetails = {}));
79546
- /**
79547
- * The CompletionItem namespace provides functions to deal with
79548
- * completion items.
79549
- */
79550
- var CompletionItem;
79551
- (function (CompletionItem) {
79552
- /**
79553
- * Create a completion item and seed it with a label.
79554
- * @param label The completion item's label
79555
- */
79556
- function create(label) {
79557
- return { label: label };
79558
- }
79559
- CompletionItem.create = create;
79560
- })(CompletionItem || (CompletionItem = {}));
79561
- /**
79562
- * The CompletionList namespace provides functions to deal with
79563
- * completion lists.
79564
- */
79565
- var CompletionList;
79566
- (function (CompletionList) {
79567
- /**
79568
- * Creates a new completion list.
79569
- *
79570
- * @param items The completion items.
79571
- * @param isIncomplete The list is not complete.
79572
- */
79573
- function create(items, isIncomplete) {
79574
- return { items: items ? items : [], isIncomplete: !!isIncomplete };
79575
- }
79576
- CompletionList.create = create;
79577
- })(CompletionList || (CompletionList = {}));
79578
- var MarkedString;
79579
- (function (MarkedString) {
79580
- /**
79581
- * Creates a marked string from plain text.
79582
- *
79583
- * @param plainText The plain text.
79584
- */
79585
- function fromPlainText(plainText) {
79586
- return plainText.replace(/[\\`*_{}[\]()#+\-.!]/g, '\\$&'); // escape markdown syntax tokens: http://daringfireball.net/projects/markdown/syntax#backslash
79587
- }
79588
- MarkedString.fromPlainText = fromPlainText;
79589
- /**
79590
- * Checks whether the given value conforms to the {@link MarkedString} type.
79591
- */
79592
- function is(value) {
79593
- var candidate = value;
79594
- return Is.string(candidate) || (Is.objectLiteral(candidate) && Is.string(candidate.language) && Is.string(candidate.value));
79595
- }
79596
- MarkedString.is = is;
79597
- })(MarkedString || (MarkedString = {}));
79598
- var Hover;
79599
- (function (Hover) {
79600
- /**
79601
- * Checks whether the given value conforms to the {@link Hover} interface.
79602
- */
79603
- function is(value) {
79604
- var candidate = value;
79605
- return !!candidate && Is.objectLiteral(candidate) && (MarkupContent.is(candidate.contents) ||
79606
- MarkedString.is(candidate.contents) ||
79607
- Is.typedArray(candidate.contents, MarkedString.is)) && (value.range === undefined || Range.is(value.range));
79608
- }
79609
- Hover.is = is;
79610
- })(Hover || (Hover = {}));
79611
- /**
79612
- * The ParameterInformation namespace provides helper functions to work with
79613
- * {@link ParameterInformation} literals.
79614
- */
79615
- var ParameterInformation;
79616
- (function (ParameterInformation) {
79617
- /**
79618
- * Creates a new parameter information literal.
79619
- *
79620
- * @param label A label string.
79621
- * @param documentation A doc string.
79622
- */
79623
- function create(label, documentation) {
79624
- return documentation ? { label: label, documentation: documentation } : { label: label };
79625
- }
79626
- ParameterInformation.create = create;
79627
- })(ParameterInformation || (ParameterInformation = {}));
79628
- /**
79629
- * The SignatureInformation namespace provides helper functions to work with
79630
- * {@link SignatureInformation} literals.
79631
- */
79632
- var SignatureInformation;
79633
- (function (SignatureInformation) {
79634
- function create(label, documentation) {
79635
- var parameters = [];
79636
- for (var _i = 2; _i < arguments.length; _i++) {
79637
- parameters[_i - 2] = arguments[_i];
79638
- }
79639
- var result = { label: label };
79640
- if (Is.defined(documentation)) {
79641
- result.documentation = documentation;
79642
- }
79643
- if (Is.defined(parameters)) {
79644
- result.parameters = parameters;
80039
+ var FormattingOptions;
80040
+ (function (FormattingOptions) {
80041
+ /**
80042
+ * Creates a new FormattingOptions literal.
80043
+ */
80044
+ function create(tabSize, insertSpaces) {
80045
+ return { tabSize: tabSize, insertSpaces: insertSpaces };
79645
80046
  }
79646
- else {
79647
- result.parameters = [];
80047
+ FormattingOptions.create = create;
80048
+ /**
80049
+ * Checks whether the given literal conforms to the {@link FormattingOptions} interface.
80050
+ */
80051
+ function is(value) {
80052
+ var candidate = value;
80053
+ return Is.defined(candidate) && Is.uinteger(candidate.tabSize) && Is.boolean(candidate.insertSpaces);
79648
80054
  }
79649
- return result;
79650
- }
79651
- SignatureInformation.create = create;
79652
- })(SignatureInformation || (SignatureInformation = {}));
79653
- /**
79654
- * A document highlight kind.
79655
- */
79656
- var DocumentHighlightKind;
79657
- (function (DocumentHighlightKind) {
80055
+ FormattingOptions.is = is;
80056
+ })(FormattingOptions || (exports.FormattingOptions = FormattingOptions = {}));
79658
80057
  /**
79659
- * A textual occurrence.
80058
+ * The DocumentLink namespace provides helper functions to work with
80059
+ * {@link DocumentLink} literals.
79660
80060
  */
79661
- DocumentHighlightKind.Text = 1;
79662
- /**
79663
- * Read-access of a symbol, like reading a variable.
79664
- */
79665
- DocumentHighlightKind.Read = 2;
79666
- /**
79667
- * Write-access of a symbol, like writing to a variable.
79668
- */
79669
- DocumentHighlightKind.Write = 3;
79670
- })(DocumentHighlightKind || (DocumentHighlightKind = {}));
79671
- /**
79672
- * DocumentHighlight namespace to provide helper functions to work with
79673
- * {@link DocumentHighlight} literals.
79674
- */
79675
- var DocumentHighlight;
79676
- (function (DocumentHighlight) {
79677
- /**
79678
- * Create a DocumentHighlight object.
79679
- * @param range The range the highlight applies to.
79680
- * @param kind The highlight kind
79681
- */
79682
- function create(range, kind) {
79683
- var result = { range: range };
79684
- if (Is.number(kind)) {
79685
- result.kind = kind;
80061
+ var DocumentLink;
80062
+ (function (DocumentLink) {
80063
+ /**
80064
+ * Creates a new DocumentLink literal.
80065
+ */
80066
+ function create(range, target, data) {
80067
+ return { range: range, target: target, data: data };
79686
80068
  }
79687
- return result;
79688
- }
79689
- DocumentHighlight.create = create;
79690
- })(DocumentHighlight || (DocumentHighlight = {}));
79691
- /**
79692
- * A symbol kind.
79693
- */
79694
- var SymbolKind;
79695
- (function (SymbolKind) {
79696
- SymbolKind.File = 1;
79697
- SymbolKind.Module = 2;
79698
- SymbolKind.Namespace = 3;
79699
- SymbolKind.Package = 4;
79700
- SymbolKind.Class = 5;
79701
- SymbolKind.Method = 6;
79702
- SymbolKind.Property = 7;
79703
- SymbolKind.Field = 8;
79704
- SymbolKind.Constructor = 9;
79705
- SymbolKind.Enum = 10;
79706
- SymbolKind.Interface = 11;
79707
- SymbolKind.Function = 12;
79708
- SymbolKind.Variable = 13;
79709
- SymbolKind.Constant = 14;
79710
- SymbolKind.String = 15;
79711
- SymbolKind.Number = 16;
79712
- SymbolKind.Boolean = 17;
79713
- SymbolKind.Array = 18;
79714
- SymbolKind.Object = 19;
79715
- SymbolKind.Key = 20;
79716
- SymbolKind.Null = 21;
79717
- SymbolKind.EnumMember = 22;
79718
- SymbolKind.Struct = 23;
79719
- SymbolKind.Event = 24;
79720
- SymbolKind.Operator = 25;
79721
- SymbolKind.TypeParameter = 26;
79722
- })(SymbolKind || (SymbolKind = {}));
79723
- /**
79724
- * Symbol tags are extra annotations that tweak the rendering of a symbol.
79725
- *
79726
- * @since 3.16
79727
- */
79728
- var SymbolTag;
79729
- (function (SymbolTag) {
79730
- /**
79731
- * Render a symbol as obsolete, usually using a strike-out.
79732
- */
79733
- SymbolTag.Deprecated = 1;
79734
- })(SymbolTag || (SymbolTag = {}));
79735
- var SymbolInformation;
79736
- (function (SymbolInformation) {
79737
- /**
79738
- * Creates a new symbol information literal.
79739
- *
79740
- * @param name The name of the symbol.
79741
- * @param kind The kind of the symbol.
79742
- * @param range The range of the location of the symbol.
79743
- * @param uri The resource of the location of symbol.
79744
- * @param containerName The name of the symbol containing the symbol.
79745
- */
79746
- function create(name, kind, range, uri, containerName) {
79747
- var result = {
79748
- name: name,
79749
- kind: kind,
79750
- location: { uri: uri, range: range }
79751
- };
79752
- if (containerName) {
79753
- result.containerName = containerName;
80069
+ DocumentLink.create = create;
80070
+ /**
80071
+ * Checks whether the given literal conforms to the {@link DocumentLink} interface.
80072
+ */
80073
+ function is(value) {
80074
+ var candidate = value;
80075
+ return Is.defined(candidate) && Range.is(candidate.range) && (Is.undefined(candidate.target) || Is.string(candidate.target));
79754
80076
  }
79755
- return result;
79756
- }
79757
- SymbolInformation.create = create;
79758
- })(SymbolInformation || (SymbolInformation = {}));
79759
- var WorkspaceSymbol;
79760
- (function (WorkspaceSymbol) {
79761
- /**
79762
- * Create a new workspace symbol.
79763
- *
79764
- * @param name The name of the symbol.
79765
- * @param kind The kind of the symbol.
79766
- * @param uri The resource of the location of the symbol.
79767
- * @param range An options range of the location.
79768
- * @returns A WorkspaceSymbol.
79769
- */
79770
- function create(name, kind, uri, range) {
79771
- return range !== undefined
79772
- ? { name: name, kind: kind, location: { uri: uri, range: range } }
79773
- : { name: name, kind: kind, location: { uri: uri } };
79774
- }
79775
- WorkspaceSymbol.create = create;
79776
- })(WorkspaceSymbol || (WorkspaceSymbol = {}));
79777
- var DocumentSymbol;
79778
- (function (DocumentSymbol) {
80077
+ DocumentLink.is = is;
80078
+ })(DocumentLink || (exports.DocumentLink = DocumentLink = {}));
79779
80079
  /**
79780
- * Creates a new symbol information literal.
79781
- *
79782
- * @param name The name of the symbol.
79783
- * @param detail The detail of the symbol.
79784
- * @param kind The kind of the symbol.
79785
- * @param range The range of the symbol.
79786
- * @param selectionRange The selectionRange of the symbol.
79787
- * @param children Children of the symbol.
80080
+ * The SelectionRange namespace provides helper function to work with
80081
+ * SelectionRange literals.
79788
80082
  */
79789
- function create(name, detail, kind, range, selectionRange, children) {
79790
- var result = {
79791
- name: name,
79792
- detail: detail,
79793
- kind: kind,
79794
- range: range,
79795
- selectionRange: selectionRange
79796
- };
79797
- if (children !== undefined) {
79798
- result.children = children;
80083
+ var SelectionRange;
80084
+ (function (SelectionRange) {
80085
+ /**
80086
+ * Creates a new SelectionRange
80087
+ * @param range the range.
80088
+ * @param parent an optional parent.
80089
+ */
80090
+ function create(range, parent) {
80091
+ return { range: range, parent: parent };
79799
80092
  }
79800
- return result;
79801
- }
79802
- DocumentSymbol.create = create;
79803
- /**
79804
- * Checks whether the given literal conforms to the {@link DocumentSymbol} interface.
79805
- */
79806
- function is(value) {
79807
- var candidate = value;
79808
- return candidate &&
79809
- Is.string(candidate.name) && Is.number(candidate.kind) &&
79810
- Range.is(candidate.range) && Range.is(candidate.selectionRange) &&
79811
- (candidate.detail === undefined || Is.string(candidate.detail)) &&
79812
- (candidate.deprecated === undefined || Is.boolean(candidate.deprecated)) &&
79813
- (candidate.children === undefined || Array.isArray(candidate.children)) &&
79814
- (candidate.tags === undefined || Array.isArray(candidate.tags));
79815
- }
79816
- DocumentSymbol.is = is;
79817
- })(DocumentSymbol || (DocumentSymbol = {}));
79818
- /**
79819
- * A set of predefined code action kinds
79820
- */
79821
- var CodeActionKind;
79822
- (function (CodeActionKind) {
79823
- /**
79824
- * Empty kind.
79825
- */
79826
- CodeActionKind.Empty = '';
79827
- /**
79828
- * Base kind for quickfix actions: 'quickfix'
79829
- */
79830
- CodeActionKind.QuickFix = 'quickfix';
79831
- /**
79832
- * Base kind for refactoring actions: 'refactor'
79833
- */
79834
- CodeActionKind.Refactor = 'refactor';
79835
- /**
79836
- * Base kind for refactoring extraction actions: 'refactor.extract'
79837
- *
79838
- * Example extract actions:
79839
- *
79840
- * - Extract method
79841
- * - Extract function
79842
- * - Extract variable
79843
- * - Extract interface from class
79844
- * - ...
79845
- */
79846
- CodeActionKind.RefactorExtract = 'refactor.extract';
79847
- /**
79848
- * Base kind for refactoring inline actions: 'refactor.inline'
79849
- *
79850
- * Example inline actions:
79851
- *
79852
- * - Inline function
79853
- * - Inline variable
79854
- * - Inline constant
79855
- * - ...
79856
- */
79857
- CodeActionKind.RefactorInline = 'refactor.inline';
80093
+ SelectionRange.create = create;
80094
+ function is(value) {
80095
+ var candidate = value;
80096
+ return Is.objectLiteral(candidate) && Range.is(candidate.range) && (candidate.parent === undefined || SelectionRange.is(candidate.parent));
80097
+ }
80098
+ SelectionRange.is = is;
80099
+ })(SelectionRange || (exports.SelectionRange = SelectionRange = {}));
79858
80100
  /**
79859
- * Base kind for refactoring rewrite actions: 'refactor.rewrite'
79860
- *
79861
- * Example rewrite actions:
80101
+ * A set of predefined token types. This set is not fixed
80102
+ * an clients can specify additional token types via the
80103
+ * corresponding client capabilities.
79862
80104
  *
79863
- * - Convert JavaScript function to class
79864
- * - Add or remove parameter
79865
- * - Encapsulate field
79866
- * - Make method static
79867
- * - Move method to base class
79868
- * - ...
80105
+ * @since 3.16.0
79869
80106
  */
79870
- CodeActionKind.RefactorRewrite = 'refactor.rewrite';
80107
+ var SemanticTokenTypes;
80108
+ (function (SemanticTokenTypes) {
80109
+ SemanticTokenTypes["namespace"] = "namespace";
80110
+ /**
80111
+ * Represents a generic type. Acts as a fallback for types which can't be mapped to
80112
+ * a specific type like class or enum.
80113
+ */
80114
+ SemanticTokenTypes["type"] = "type";
80115
+ SemanticTokenTypes["class"] = "class";
80116
+ SemanticTokenTypes["enum"] = "enum";
80117
+ SemanticTokenTypes["interface"] = "interface";
80118
+ SemanticTokenTypes["struct"] = "struct";
80119
+ SemanticTokenTypes["typeParameter"] = "typeParameter";
80120
+ SemanticTokenTypes["parameter"] = "parameter";
80121
+ SemanticTokenTypes["variable"] = "variable";
80122
+ SemanticTokenTypes["property"] = "property";
80123
+ SemanticTokenTypes["enumMember"] = "enumMember";
80124
+ SemanticTokenTypes["event"] = "event";
80125
+ SemanticTokenTypes["function"] = "function";
80126
+ SemanticTokenTypes["method"] = "method";
80127
+ SemanticTokenTypes["macro"] = "macro";
80128
+ SemanticTokenTypes["keyword"] = "keyword";
80129
+ SemanticTokenTypes["modifier"] = "modifier";
80130
+ SemanticTokenTypes["comment"] = "comment";
80131
+ SemanticTokenTypes["string"] = "string";
80132
+ SemanticTokenTypes["number"] = "number";
80133
+ SemanticTokenTypes["regexp"] = "regexp";
80134
+ SemanticTokenTypes["operator"] = "operator";
80135
+ /**
80136
+ * @since 3.17.0
80137
+ */
80138
+ SemanticTokenTypes["decorator"] = "decorator";
80139
+ })(SemanticTokenTypes || (exports.SemanticTokenTypes = SemanticTokenTypes = {}));
79871
80140
  /**
79872
- * Base kind for source actions: `source`
80141
+ * A set of predefined token modifiers. This set is not fixed
80142
+ * an clients can specify additional token types via the
80143
+ * corresponding client capabilities.
79873
80144
  *
79874
- * Source code actions apply to the entire file.
80145
+ * @since 3.16.0
79875
80146
  */
79876
- CodeActionKind.Source = 'source';
80147
+ var SemanticTokenModifiers;
80148
+ (function (SemanticTokenModifiers) {
80149
+ SemanticTokenModifiers["declaration"] = "declaration";
80150
+ SemanticTokenModifiers["definition"] = "definition";
80151
+ SemanticTokenModifiers["readonly"] = "readonly";
80152
+ SemanticTokenModifiers["static"] = "static";
80153
+ SemanticTokenModifiers["deprecated"] = "deprecated";
80154
+ SemanticTokenModifiers["abstract"] = "abstract";
80155
+ SemanticTokenModifiers["async"] = "async";
80156
+ SemanticTokenModifiers["modification"] = "modification";
80157
+ SemanticTokenModifiers["documentation"] = "documentation";
80158
+ SemanticTokenModifiers["defaultLibrary"] = "defaultLibrary";
80159
+ })(SemanticTokenModifiers || (exports.SemanticTokenModifiers = SemanticTokenModifiers = {}));
79877
80160
  /**
79878
- * Base kind for an organize imports source action: `source.organizeImports`
80161
+ * @since 3.16.0
79879
80162
  */
79880
- CodeActionKind.SourceOrganizeImports = 'source.organizeImports';
80163
+ var SemanticTokens;
80164
+ (function (SemanticTokens) {
80165
+ function is(value) {
80166
+ var candidate = value;
80167
+ return Is.objectLiteral(candidate) && (candidate.resultId === undefined || typeof candidate.resultId === 'string') &&
80168
+ Array.isArray(candidate.data) && (candidate.data.length === 0 || typeof candidate.data[0] === 'number');
80169
+ }
80170
+ SemanticTokens.is = is;
80171
+ })(SemanticTokens || (exports.SemanticTokens = SemanticTokens = {}));
79881
80172
  /**
79882
- * Base kind for auto-fix source actions: `source.fixAll`.
80173
+ * The InlineValueText namespace provides functions to deal with InlineValueTexts.
79883
80174
  *
79884
- * Fix all actions automatically fix errors that have a clear fix that do not require user input.
79885
- * They should not suppress errors or perform unsafe fixes such as generating new types or classes.
79886
- *
79887
- * @since 3.15.0
79888
- */
79889
- CodeActionKind.SourceFixAll = 'source.fixAll';
79890
- })(CodeActionKind || (CodeActionKind = {}));
79891
- /**
79892
- * The reason why code actions were requested.
79893
- *
79894
- * @since 3.17.0
79895
- */
79896
- var CodeActionTriggerKind;
79897
- (function (CodeActionTriggerKind) {
79898
- /**
79899
- * Code actions were explicitly requested by the user or by an extension.
80175
+ * @since 3.17.0
79900
80176
  */
79901
- CodeActionTriggerKind.Invoked = 1;
80177
+ var InlineValueText;
80178
+ (function (InlineValueText) {
80179
+ /**
80180
+ * Creates a new InlineValueText literal.
80181
+ */
80182
+ function create(range, text) {
80183
+ return { range: range, text: text };
80184
+ }
80185
+ InlineValueText.create = create;
80186
+ function is(value) {
80187
+ var candidate = value;
80188
+ return candidate !== undefined && candidate !== null && Range.is(candidate.range) && Is.string(candidate.text);
80189
+ }
80190
+ InlineValueText.is = is;
80191
+ })(InlineValueText || (exports.InlineValueText = InlineValueText = {}));
79902
80192
  /**
79903
- * Code actions were requested automatically.
80193
+ * The InlineValueVariableLookup namespace provides functions to deal with InlineValueVariableLookups.
79904
80194
  *
79905
- * This typically happens when current selection in a file changes, but can
79906
- * also be triggered when file content changes.
79907
- */
79908
- CodeActionTriggerKind.Automatic = 2;
79909
- })(CodeActionTriggerKind || (CodeActionTriggerKind = {}));
79910
- /**
79911
- * The CodeActionContext namespace provides helper functions to work with
79912
- * {@link CodeActionContext} literals.
79913
- */
79914
- var CodeActionContext;
79915
- (function (CodeActionContext) {
79916
- /**
79917
- * Creates a new CodeActionContext literal.
80195
+ * @since 3.17.0
79918
80196
  */
79919
- function create(diagnostics, only, triggerKind) {
79920
- var result = { diagnostics: diagnostics };
79921
- if (only !== undefined && only !== null) {
79922
- result.only = only;
80197
+ var InlineValueVariableLookup;
80198
+ (function (InlineValueVariableLookup) {
80199
+ /**
80200
+ * Creates a new InlineValueText literal.
80201
+ */
80202
+ function create(range, variableName, caseSensitiveLookup) {
80203
+ return { range: range, variableName: variableName, caseSensitiveLookup: caseSensitiveLookup };
79923
80204
  }
79924
- if (triggerKind !== undefined && triggerKind !== null) {
79925
- result.triggerKind = triggerKind;
80205
+ InlineValueVariableLookup.create = create;
80206
+ function is(value) {
80207
+ var candidate = value;
80208
+ return candidate !== undefined && candidate !== null && Range.is(candidate.range) && Is.boolean(candidate.caseSensitiveLookup)
80209
+ && (Is.string(candidate.variableName) || candidate.variableName === undefined);
79926
80210
  }
79927
- return result;
79928
- }
79929
- CodeActionContext.create = create;
80211
+ InlineValueVariableLookup.is = is;
80212
+ })(InlineValueVariableLookup || (exports.InlineValueVariableLookup = InlineValueVariableLookup = {}));
79930
80213
  /**
79931
- * Checks whether the given literal conforms to the {@link CodeActionContext} interface.
80214
+ * The InlineValueEvaluatableExpression namespace provides functions to deal with InlineValueEvaluatableExpression.
80215
+ *
80216
+ * @since 3.17.0
79932
80217
  */
79933
- function is(value) {
79934
- var candidate = value;
79935
- return Is.defined(candidate) && Is.typedArray(candidate.diagnostics, Diagnostic.is)
79936
- && (candidate.only === undefined || Is.typedArray(candidate.only, Is.string))
79937
- && (candidate.triggerKind === undefined || candidate.triggerKind === CodeActionTriggerKind.Invoked || candidate.triggerKind === CodeActionTriggerKind.Automatic);
79938
- }
79939
- CodeActionContext.is = is;
79940
- })(CodeActionContext || (CodeActionContext = {}));
79941
- var CodeAction;
79942
- (function (CodeAction) {
79943
- function create(title, kindOrCommandOrEdit, kind) {
79944
- var result = { title: title };
79945
- var checkKind = true;
79946
- if (typeof kindOrCommandOrEdit === 'string') {
79947
- checkKind = false;
79948
- result.kind = kindOrCommandOrEdit;
79949
- }
79950
- else if (Command.is(kindOrCommandOrEdit)) {
79951
- result.command = kindOrCommandOrEdit;
79952
- }
79953
- else {
79954
- result.edit = kindOrCommandOrEdit;
80218
+ var InlineValueEvaluatableExpression;
80219
+ (function (InlineValueEvaluatableExpression) {
80220
+ /**
80221
+ * Creates a new InlineValueEvaluatableExpression literal.
80222
+ */
80223
+ function create(range, expression) {
80224
+ return { range: range, expression: expression };
79955
80225
  }
79956
- if (checkKind && kind !== undefined) {
79957
- result.kind = kind;
80226
+ InlineValueEvaluatableExpression.create = create;
80227
+ function is(value) {
80228
+ var candidate = value;
80229
+ return candidate !== undefined && candidate !== null && Range.is(candidate.range)
80230
+ && (Is.string(candidate.expression) || candidate.expression === undefined);
79958
80231
  }
79959
- return result;
79960
- }
79961
- CodeAction.create = create;
79962
- function is(value) {
79963
- var candidate = value;
79964
- return candidate && Is.string(candidate.title) &&
79965
- (candidate.diagnostics === undefined || Is.typedArray(candidate.diagnostics, Diagnostic.is)) &&
79966
- (candidate.kind === undefined || Is.string(candidate.kind)) &&
79967
- (candidate.edit !== undefined || candidate.command !== undefined) &&
79968
- (candidate.command === undefined || Command.is(candidate.command)) &&
79969
- (candidate.isPreferred === undefined || Is.boolean(candidate.isPreferred)) &&
79970
- (candidate.edit === undefined || WorkspaceEdit.is(candidate.edit));
79971
- }
79972
- CodeAction.is = is;
79973
- })(CodeAction || (CodeAction = {}));
79974
- /**
79975
- * The CodeLens namespace provides helper functions to work with
79976
- * {@link CodeLens} literals.
79977
- */
79978
- var CodeLens;
79979
- (function (CodeLens) {
80232
+ InlineValueEvaluatableExpression.is = is;
80233
+ })(InlineValueEvaluatableExpression || (exports.InlineValueEvaluatableExpression = InlineValueEvaluatableExpression = {}));
79980
80234
  /**
79981
- * Creates a new CodeLens literal.
80235
+ * The InlineValueContext namespace provides helper functions to work with
80236
+ * {@link InlineValueContext} literals.
80237
+ *
80238
+ * @since 3.17.0
79982
80239
  */
79983
- function create(range, data) {
79984
- var result = { range: range };
79985
- if (Is.defined(data)) {
79986
- result.data = data;
80240
+ var InlineValueContext;
80241
+ (function (InlineValueContext) {
80242
+ /**
80243
+ * Creates a new InlineValueContext literal.
80244
+ */
80245
+ function create(frameId, stoppedLocation) {
80246
+ return { frameId: frameId, stoppedLocation: stoppedLocation };
79987
80247
  }
79988
- return result;
79989
- }
79990
- CodeLens.create = create;
79991
- /**
79992
- * Checks whether the given literal conforms to the {@link CodeLens} interface.
79993
- */
79994
- function is(value) {
79995
- var candidate = value;
79996
- return Is.defined(candidate) && Range.is(candidate.range) && (Is.undefined(candidate.command) || Command.is(candidate.command));
79997
- }
79998
- CodeLens.is = is;
79999
- })(CodeLens || (CodeLens = {}));
80000
- /**
80001
- * The FormattingOptions namespace provides helper functions to work with
80002
- * {@link FormattingOptions} literals.
80003
- */
80004
- var FormattingOptions;
80005
- (function (FormattingOptions) {
80006
- /**
80007
- * Creates a new FormattingOptions literal.
80008
- */
80009
- function create(tabSize, insertSpaces) {
80010
- return { tabSize: tabSize, insertSpaces: insertSpaces };
80011
- }
80012
- FormattingOptions.create = create;
80013
- /**
80014
- * Checks whether the given literal conforms to the {@link FormattingOptions} interface.
80015
- */
80016
- function is(value) {
80017
- var candidate = value;
80018
- return Is.defined(candidate) && Is.uinteger(candidate.tabSize) && Is.boolean(candidate.insertSpaces);
80019
- }
80020
- FormattingOptions.is = is;
80021
- })(FormattingOptions || (FormattingOptions = {}));
80022
- /**
80023
- * The DocumentLink namespace provides helper functions to work with
80024
- * {@link DocumentLink} literals.
80025
- */
80026
- var DocumentLink;
80027
- (function (DocumentLink) {
80028
- /**
80029
- * Creates a new DocumentLink literal.
80030
- */
80031
- function create(range, target, data) {
80032
- return { range: range, target: target, data: data };
80033
- }
80034
- DocumentLink.create = create;
80035
- /**
80036
- * Checks whether the given literal conforms to the {@link DocumentLink} interface.
80037
- */
80038
- function is(value) {
80039
- var candidate = value;
80040
- return Is.defined(candidate) && Range.is(candidate.range) && (Is.undefined(candidate.target) || Is.string(candidate.target));
80041
- }
80042
- DocumentLink.is = is;
80043
- })(DocumentLink || (DocumentLink = {}));
80044
- /**
80045
- * The SelectionRange namespace provides helper function to work with
80046
- * SelectionRange literals.
80047
- */
80048
- var SelectionRange;
80049
- (function (SelectionRange) {
80050
- /**
80051
- * Creates a new SelectionRange
80052
- * @param range the range.
80053
- * @param parent an optional parent.
80054
- */
80055
- function create(range, parent) {
80056
- return { range: range, parent: parent };
80057
- }
80058
- SelectionRange.create = create;
80059
- function is(value) {
80060
- var candidate = value;
80061
- return Is.objectLiteral(candidate) && Range.is(candidate.range) && (candidate.parent === undefined || SelectionRange.is(candidate.parent));
80062
- }
80063
- SelectionRange.is = is;
80064
- })(SelectionRange || (SelectionRange = {}));
80065
- /**
80066
- * A set of predefined token types. This set is not fixed
80067
- * an clients can specify additional token types via the
80068
- * corresponding client capabilities.
80069
- *
80070
- * @since 3.16.0
80071
- */
80072
- var SemanticTokenTypes;
80073
- (function (SemanticTokenTypes) {
80074
- SemanticTokenTypes["namespace"] = "namespace";
80075
- /**
80076
- * Represents a generic type. Acts as a fallback for types which can't be mapped to
80077
- * a specific type like class or enum.
80078
- */
80079
- SemanticTokenTypes["type"] = "type";
80080
- SemanticTokenTypes["class"] = "class";
80081
- SemanticTokenTypes["enum"] = "enum";
80082
- SemanticTokenTypes["interface"] = "interface";
80083
- SemanticTokenTypes["struct"] = "struct";
80084
- SemanticTokenTypes["typeParameter"] = "typeParameter";
80085
- SemanticTokenTypes["parameter"] = "parameter";
80086
- SemanticTokenTypes["variable"] = "variable";
80087
- SemanticTokenTypes["property"] = "property";
80088
- SemanticTokenTypes["enumMember"] = "enumMember";
80089
- SemanticTokenTypes["event"] = "event";
80090
- SemanticTokenTypes["function"] = "function";
80091
- SemanticTokenTypes["method"] = "method";
80092
- SemanticTokenTypes["macro"] = "macro";
80093
- SemanticTokenTypes["keyword"] = "keyword";
80094
- SemanticTokenTypes["modifier"] = "modifier";
80095
- SemanticTokenTypes["comment"] = "comment";
80096
- SemanticTokenTypes["string"] = "string";
80097
- SemanticTokenTypes["number"] = "number";
80098
- SemanticTokenTypes["regexp"] = "regexp";
80099
- SemanticTokenTypes["operator"] = "operator";
80248
+ InlineValueContext.create = create;
80249
+ /**
80250
+ * Checks whether the given literal conforms to the {@link InlineValueContext} interface.
80251
+ */
80252
+ function is(value) {
80253
+ var candidate = value;
80254
+ return Is.defined(candidate) && Range.is(value.stoppedLocation);
80255
+ }
80256
+ InlineValueContext.is = is;
80257
+ })(InlineValueContext || (exports.InlineValueContext = InlineValueContext = {}));
80100
80258
  /**
80259
+ * Inlay hint kinds.
80260
+ *
80101
80261
  * @since 3.17.0
80102
80262
  */
80103
- SemanticTokenTypes["decorator"] = "decorator";
80104
- })(SemanticTokenTypes || (SemanticTokenTypes = {}));
80105
- /**
80106
- * A set of predefined token modifiers. This set is not fixed
80107
- * an clients can specify additional token types via the
80108
- * corresponding client capabilities.
80109
- *
80110
- * @since 3.16.0
80111
- */
80112
- var SemanticTokenModifiers;
80113
- (function (SemanticTokenModifiers) {
80114
- SemanticTokenModifiers["declaration"] = "declaration";
80115
- SemanticTokenModifiers["definition"] = "definition";
80116
- SemanticTokenModifiers["readonly"] = "readonly";
80117
- SemanticTokenModifiers["static"] = "static";
80118
- SemanticTokenModifiers["deprecated"] = "deprecated";
80119
- SemanticTokenModifiers["abstract"] = "abstract";
80120
- SemanticTokenModifiers["async"] = "async";
80121
- SemanticTokenModifiers["modification"] = "modification";
80122
- SemanticTokenModifiers["documentation"] = "documentation";
80123
- SemanticTokenModifiers["defaultLibrary"] = "defaultLibrary";
80124
- })(SemanticTokenModifiers || (SemanticTokenModifiers = {}));
80125
- /**
80126
- * @since 3.16.0
80127
- */
80128
- var SemanticTokens;
80129
- (function (SemanticTokens) {
80130
- function is(value) {
80131
- var candidate = value;
80132
- return Is.objectLiteral(candidate) && (candidate.resultId === undefined || typeof candidate.resultId === 'string') &&
80133
- Array.isArray(candidate.data) && (candidate.data.length === 0 || typeof candidate.data[0] === 'number');
80134
- }
80135
- SemanticTokens.is = is;
80136
- })(SemanticTokens || (SemanticTokens = {}));
80137
- /**
80138
- * The InlineValueText namespace provides functions to deal with InlineValueTexts.
80139
- *
80140
- * @since 3.17.0
80141
- */
80142
- var InlineValueText;
80143
- (function (InlineValueText) {
80144
- /**
80145
- * Creates a new InlineValueText literal.
80146
- */
80147
- function create(range, text) {
80148
- return { range: range, text: text };
80149
- }
80150
- InlineValueText.create = create;
80151
- function is(value) {
80152
- var candidate = value;
80153
- return candidate !== undefined && candidate !== null && Range.is(candidate.range) && Is.string(candidate.text);
80154
- }
80155
- InlineValueText.is = is;
80156
- })(InlineValueText || (InlineValueText = {}));
80157
- /**
80158
- * The InlineValueVariableLookup namespace provides functions to deal with InlineValueVariableLookups.
80159
- *
80160
- * @since 3.17.0
80161
- */
80162
- var InlineValueVariableLookup;
80163
- (function (InlineValueVariableLookup) {
80164
- /**
80165
- * Creates a new InlineValueText literal.
80166
- */
80167
- function create(range, variableName, caseSensitiveLookup) {
80168
- return { range: range, variableName: variableName, caseSensitiveLookup: caseSensitiveLookup };
80169
- }
80170
- InlineValueVariableLookup.create = create;
80171
- function is(value) {
80172
- var candidate = value;
80173
- return candidate !== undefined && candidate !== null && Range.is(candidate.range) && Is.boolean(candidate.caseSensitiveLookup)
80174
- && (Is.string(candidate.variableName) || candidate.variableName === undefined);
80175
- }
80176
- InlineValueVariableLookup.is = is;
80177
- })(InlineValueVariableLookup || (InlineValueVariableLookup = {}));
80178
- /**
80179
- * The InlineValueEvaluatableExpression namespace provides functions to deal with InlineValueEvaluatableExpression.
80180
- *
80181
- * @since 3.17.0
80182
- */
80183
- var InlineValueEvaluatableExpression;
80184
- (function (InlineValueEvaluatableExpression) {
80185
- /**
80186
- * Creates a new InlineValueEvaluatableExpression literal.
80187
- */
80188
- function create(range, expression) {
80189
- return { range: range, expression: expression };
80190
- }
80191
- InlineValueEvaluatableExpression.create = create;
80192
- function is(value) {
80193
- var candidate = value;
80194
- return candidate !== undefined && candidate !== null && Range.is(candidate.range)
80195
- && (Is.string(candidate.expression) || candidate.expression === undefined);
80196
- }
80197
- InlineValueEvaluatableExpression.is = is;
80198
- })(InlineValueEvaluatableExpression || (InlineValueEvaluatableExpression = {}));
80199
- /**
80200
- * The InlineValueContext namespace provides helper functions to work with
80201
- * {@link InlineValueContext} literals.
80202
- *
80203
- * @since 3.17.0
80204
- */
80205
- var InlineValueContext;
80206
- (function (InlineValueContext) {
80207
- /**
80208
- * Creates a new InlineValueContext literal.
80209
- */
80210
- function create(frameId, stoppedLocation) {
80211
- return { frameId: frameId, stoppedLocation: stoppedLocation };
80212
- }
80213
- InlineValueContext.create = create;
80214
- /**
80215
- * Checks whether the given literal conforms to the {@link InlineValueContext} interface.
80216
- */
80217
- function is(value) {
80218
- var candidate = value;
80219
- return Is.defined(candidate) && Range.is(value.stoppedLocation);
80220
- }
80221
- InlineValueContext.is = is;
80222
- })(InlineValueContext || (InlineValueContext = {}));
80223
- /**
80224
- * Inlay hint kinds.
80225
- *
80226
- * @since 3.17.0
80227
- */
80228
- var InlayHintKind;
80229
- (function (InlayHintKind) {
80230
- /**
80231
- * An inlay hint that for a type annotation.
80232
- */
80233
- InlayHintKind.Type = 1;
80234
- /**
80235
- * An inlay hint that is for a parameter.
80236
- */
80237
- InlayHintKind.Parameter = 2;
80238
- function is(value) {
80239
- return value === 1 || value === 2;
80240
- }
80241
- InlayHintKind.is = is;
80242
- })(InlayHintKind || (InlayHintKind = {}));
80243
- var InlayHintLabelPart;
80244
- (function (InlayHintLabelPart) {
80245
- function create(value) {
80246
- return { value: value };
80247
- }
80248
- InlayHintLabelPart.create = create;
80249
- function is(value) {
80250
- var candidate = value;
80251
- return Is.objectLiteral(candidate)
80252
- && (candidate.tooltip === undefined || Is.string(candidate.tooltip) || MarkupContent.is(candidate.tooltip))
80253
- && (candidate.location === undefined || Location.is(candidate.location))
80254
- && (candidate.command === undefined || Command.is(candidate.command));
80255
- }
80256
- InlayHintLabelPart.is = is;
80257
- })(InlayHintLabelPart || (InlayHintLabelPart = {}));
80258
- var InlayHint;
80259
- (function (InlayHint) {
80260
- function create(position, label, kind) {
80261
- var result = { position: position, label: label };
80262
- if (kind !== undefined) {
80263
- result.kind = kind;
80263
+ var InlayHintKind;
80264
+ (function (InlayHintKind) {
80265
+ /**
80266
+ * An inlay hint that for a type annotation.
80267
+ */
80268
+ InlayHintKind.Type = 1;
80269
+ /**
80270
+ * An inlay hint that is for a parameter.
80271
+ */
80272
+ InlayHintKind.Parameter = 2;
80273
+ function is(value) {
80274
+ return value === 1 || value === 2;
80275
+ }
80276
+ InlayHintKind.is = is;
80277
+ })(InlayHintKind || (exports.InlayHintKind = InlayHintKind = {}));
80278
+ var InlayHintLabelPart;
80279
+ (function (InlayHintLabelPart) {
80280
+ function create(value) {
80281
+ return { value: value };
80282
+ }
80283
+ InlayHintLabelPart.create = create;
80284
+ function is(value) {
80285
+ var candidate = value;
80286
+ return Is.objectLiteral(candidate)
80287
+ && (candidate.tooltip === undefined || Is.string(candidate.tooltip) || MarkupContent.is(candidate.tooltip))
80288
+ && (candidate.location === undefined || Location.is(candidate.location))
80289
+ && (candidate.command === undefined || Command.is(candidate.command));
80290
+ }
80291
+ InlayHintLabelPart.is = is;
80292
+ })(InlayHintLabelPart || (exports.InlayHintLabelPart = InlayHintLabelPart = {}));
80293
+ var InlayHint;
80294
+ (function (InlayHint) {
80295
+ function create(position, label, kind) {
80296
+ var result = { position: position, label: label };
80297
+ if (kind !== undefined) {
80298
+ result.kind = kind;
80299
+ }
80300
+ return result;
80264
80301
  }
80265
- return result;
80266
- }
80267
- InlayHint.create = create;
80268
- function is(value) {
80269
- var candidate = value;
80270
- return Is.objectLiteral(candidate) && Position.is(candidate.position)
80271
- && (Is.string(candidate.label) || Is.typedArray(candidate.label, InlayHintLabelPart.is))
80272
- && (candidate.kind === undefined || InlayHintKind.is(candidate.kind))
80273
- && (candidate.textEdits === undefined) || Is.typedArray(candidate.textEdits, TextEdit.is)
80274
- && (candidate.tooltip === undefined || Is.string(candidate.tooltip) || MarkupContent.is(candidate.tooltip))
80275
- && (candidate.paddingLeft === undefined || Is.boolean(candidate.paddingLeft))
80276
- && (candidate.paddingRight === undefined || Is.boolean(candidate.paddingRight));
80277
- }
80278
- InlayHint.is = is;
80279
- })(InlayHint || (InlayHint = {}));
80280
- var WorkspaceFolder;
80281
- (function (WorkspaceFolder) {
80282
- function is(value) {
80283
- var candidate = value;
80284
- return Is.objectLiteral(candidate) && URI.is(candidate.uri) && Is.string(candidate.name);
80285
- }
80286
- WorkspaceFolder.is = is;
80287
- })(WorkspaceFolder || (WorkspaceFolder = {}));
80288
- var EOL = ['\n', '\r\n', '\r'];
80289
- /**
80290
- * @deprecated Use the text document from the new vscode-languageserver-textdocument package.
80291
- */
80292
- var TextDocument;
80293
- (function (TextDocument) {
80302
+ InlayHint.create = create;
80303
+ function is(value) {
80304
+ var candidate = value;
80305
+ return Is.objectLiteral(candidate) && Position.is(candidate.position)
80306
+ && (Is.string(candidate.label) || Is.typedArray(candidate.label, InlayHintLabelPart.is))
80307
+ && (candidate.kind === undefined || InlayHintKind.is(candidate.kind))
80308
+ && (candidate.textEdits === undefined) || Is.typedArray(candidate.textEdits, TextEdit.is)
80309
+ && (candidate.tooltip === undefined || Is.string(candidate.tooltip) || MarkupContent.is(candidate.tooltip))
80310
+ && (candidate.paddingLeft === undefined || Is.boolean(candidate.paddingLeft))
80311
+ && (candidate.paddingRight === undefined || Is.boolean(candidate.paddingRight));
80312
+ }
80313
+ InlayHint.is = is;
80314
+ })(InlayHint || (exports.InlayHint = InlayHint = {}));
80315
+ var StringValue;
80316
+ (function (StringValue) {
80317
+ function createSnippet(value) {
80318
+ return { kind: 'snippet', value: value };
80319
+ }
80320
+ StringValue.createSnippet = createSnippet;
80321
+ })(StringValue || (exports.StringValue = StringValue = {}));
80322
+ var InlineCompletionItem;
80323
+ (function (InlineCompletionItem) {
80324
+ function create(insertText, filterText, range, command) {
80325
+ return { insertText: insertText, filterText: filterText, range: range, command: command };
80326
+ }
80327
+ InlineCompletionItem.create = create;
80328
+ })(InlineCompletionItem || (exports.InlineCompletionItem = InlineCompletionItem = {}));
80329
+ var InlineCompletionList;
80330
+ (function (InlineCompletionList) {
80331
+ function create(items) {
80332
+ return { items: items };
80333
+ }
80334
+ InlineCompletionList.create = create;
80335
+ })(InlineCompletionList || (exports.InlineCompletionList = InlineCompletionList = {}));
80294
80336
  /**
80295
- * Creates a new ITextDocument literal from the given uri and content.
80296
- * @param uri The document's uri.
80297
- * @param languageId The document's language Id.
80298
- * @param version The document's version.
80299
- * @param content The document's content.
80337
+ * Describes how an {@link InlineCompletionItemProvider inline completion provider} was triggered.
80338
+ *
80339
+ * @since 3.18.0
80340
+ * @proposed
80300
80341
  */
80301
- function create(uri, languageId, version, content) {
80302
- return new FullTextDocument(uri, languageId, version, content);
80303
- }
80304
- TextDocument.create = create;
80342
+ var InlineCompletionTriggerKind;
80343
+ (function (InlineCompletionTriggerKind) {
80344
+ /**
80345
+ * Completion was triggered explicitly by a user gesture.
80346
+ */
80347
+ InlineCompletionTriggerKind.Invoked = 0;
80348
+ /**
80349
+ * Completion was triggered automatically while editing.
80350
+ */
80351
+ InlineCompletionTriggerKind.Automatic = 1;
80352
+ })(InlineCompletionTriggerKind || (exports.InlineCompletionTriggerKind = InlineCompletionTriggerKind = {}));
80353
+ var SelectedCompletionInfo;
80354
+ (function (SelectedCompletionInfo) {
80355
+ function create(range, text) {
80356
+ return { range: range, text: text };
80357
+ }
80358
+ SelectedCompletionInfo.create = create;
80359
+ })(SelectedCompletionInfo || (exports.SelectedCompletionInfo = SelectedCompletionInfo = {}));
80360
+ var InlineCompletionContext;
80361
+ (function (InlineCompletionContext) {
80362
+ function create(triggerKind, selectedCompletionInfo) {
80363
+ return { triggerKind: triggerKind, selectedCompletionInfo: selectedCompletionInfo };
80364
+ }
80365
+ InlineCompletionContext.create = create;
80366
+ })(InlineCompletionContext || (exports.InlineCompletionContext = InlineCompletionContext = {}));
80367
+ var WorkspaceFolder;
80368
+ (function (WorkspaceFolder) {
80369
+ function is(value) {
80370
+ var candidate = value;
80371
+ return Is.objectLiteral(candidate) && URI.is(candidate.uri) && Is.string(candidate.name);
80372
+ }
80373
+ WorkspaceFolder.is = is;
80374
+ })(WorkspaceFolder || (exports.WorkspaceFolder = WorkspaceFolder = {}));
80375
+ exports.EOL = ['\n', '\r\n', '\r'];
80305
80376
  /**
80306
- * Checks whether the given literal conforms to the {@link ITextDocument} interface.
80377
+ * @deprecated Use the text document from the new vscode-languageserver-textdocument package.
80307
80378
  */
80308
- function is(value) {
80309
- var candidate = value;
80310
- return Is.defined(candidate) && Is.string(candidate.uri) && (Is.undefined(candidate.languageId) || Is.string(candidate.languageId)) && Is.uinteger(candidate.lineCount)
80311
- && Is.func(candidate.getText) && Is.func(candidate.positionAt) && Is.func(candidate.offsetAt) ? true : false;
80312
- }
80313
- TextDocument.is = is;
80314
- function applyEdits(document, edits) {
80315
- var text = document.getText();
80316
- var sortedEdits = mergeSort(edits, function (a, b) {
80317
- var diff = a.range.start.line - b.range.start.line;
80318
- if (diff === 0) {
80319
- return a.range.start.character - b.range.start.character;
80320
- }
80321
- return diff;
80322
- });
80323
- var lastModifiedOffset = text.length;
80324
- for (var i = sortedEdits.length - 1; i >= 0; i--) {
80325
- var e = sortedEdits[i];
80326
- var startOffset = document.offsetAt(e.range.start);
80327
- var endOffset = document.offsetAt(e.range.end);
80328
- if (endOffset <= lastModifiedOffset) {
80329
- text = text.substring(0, startOffset) + e.newText + text.substring(endOffset, text.length);
80330
- }
80331
- else {
80332
- throw new Error('Overlapping edit');
80333
- }
80334
- lastModifiedOffset = startOffset;
80335
- }
80336
- return text;
80337
- }
80338
- TextDocument.applyEdits = applyEdits;
80339
- function mergeSort(data, compare) {
80340
- if (data.length <= 1) {
80341
- // sorted
80342
- return data;
80379
+ var TextDocument;
80380
+ (function (TextDocument) {
80381
+ /**
80382
+ * Creates a new ITextDocument literal from the given uri and content.
80383
+ * @param uri The document's uri.
80384
+ * @param languageId The document's language Id.
80385
+ * @param version The document's version.
80386
+ * @param content The document's content.
80387
+ */
80388
+ function create(uri, languageId, version, content) {
80389
+ return new FullTextDocument(uri, languageId, version, content);
80343
80390
  }
80344
- var p = (data.length / 2) | 0;
80345
- var left = data.slice(0, p);
80346
- var right = data.slice(p);
80347
- mergeSort(left, compare);
80348
- mergeSort(right, compare);
80349
- var leftIdx = 0;
80350
- var rightIdx = 0;
80351
- var i = 0;
80352
- while (leftIdx < left.length && rightIdx < right.length) {
80353
- var ret = compare(left[leftIdx], right[rightIdx]);
80354
- if (ret <= 0) {
80355
- // smaller_equal -> take left to preserve order
80391
+ TextDocument.create = create;
80392
+ /**
80393
+ * Checks whether the given literal conforms to the {@link ITextDocument} interface.
80394
+ */
80395
+ function is(value) {
80396
+ var candidate = value;
80397
+ return Is.defined(candidate) && Is.string(candidate.uri) && (Is.undefined(candidate.languageId) || Is.string(candidate.languageId)) && Is.uinteger(candidate.lineCount)
80398
+ && Is.func(candidate.getText) && Is.func(candidate.positionAt) && Is.func(candidate.offsetAt) ? true : false;
80399
+ }
80400
+ TextDocument.is = is;
80401
+ function applyEdits(document, edits) {
80402
+ var text = document.getText();
80403
+ var sortedEdits = mergeSort(edits, function (a, b) {
80404
+ var diff = a.range.start.line - b.range.start.line;
80405
+ if (diff === 0) {
80406
+ return a.range.start.character - b.range.start.character;
80407
+ }
80408
+ return diff;
80409
+ });
80410
+ var lastModifiedOffset = text.length;
80411
+ for (var i = sortedEdits.length - 1; i >= 0; i--) {
80412
+ var e = sortedEdits[i];
80413
+ var startOffset = document.offsetAt(e.range.start);
80414
+ var endOffset = document.offsetAt(e.range.end);
80415
+ if (endOffset <= lastModifiedOffset) {
80416
+ text = text.substring(0, startOffset) + e.newText + text.substring(endOffset, text.length);
80417
+ }
80418
+ else {
80419
+ throw new Error('Overlapping edit');
80420
+ }
80421
+ lastModifiedOffset = startOffset;
80422
+ }
80423
+ return text;
80424
+ }
80425
+ TextDocument.applyEdits = applyEdits;
80426
+ function mergeSort(data, compare) {
80427
+ if (data.length <= 1) {
80428
+ // sorted
80429
+ return data;
80430
+ }
80431
+ var p = (data.length / 2) | 0;
80432
+ var left = data.slice(0, p);
80433
+ var right = data.slice(p);
80434
+ mergeSort(left, compare);
80435
+ mergeSort(right, compare);
80436
+ var leftIdx = 0;
80437
+ var rightIdx = 0;
80438
+ var i = 0;
80439
+ while (leftIdx < left.length && rightIdx < right.length) {
80440
+ var ret = compare(left[leftIdx], right[rightIdx]);
80441
+ if (ret <= 0) {
80442
+ // smaller_equal -> take left to preserve order
80443
+ data[i++] = left[leftIdx++];
80444
+ }
80445
+ else {
80446
+ // greater -> take right
80447
+ data[i++] = right[rightIdx++];
80448
+ }
80449
+ }
80450
+ while (leftIdx < left.length) {
80356
80451
  data[i++] = left[leftIdx++];
80357
80452
  }
80358
- else {
80359
- // greater -> take right
80453
+ while (rightIdx < right.length) {
80360
80454
  data[i++] = right[rightIdx++];
80361
80455
  }
80456
+ return data;
80362
80457
  }
80363
- while (leftIdx < left.length) {
80364
- data[i++] = left[leftIdx++];
80365
- }
80366
- while (rightIdx < right.length) {
80367
- data[i++] = right[rightIdx++];
80368
- }
80369
- return data;
80370
- }
80371
- })(TextDocument || (TextDocument = {}));
80372
- /**
80373
- * @deprecated Use the text document from the new vscode-languageserver-textdocument package.
80374
- */
80375
- var FullTextDocument = /** @class */ (function () {
80376
- function FullTextDocument(uri, languageId, version, content) {
80377
- this._uri = uri;
80378
- this._languageId = languageId;
80379
- this._version = version;
80380
- this._content = content;
80381
- this._lineOffsets = undefined;
80382
- }
80383
- Object.defineProperty(FullTextDocument.prototype, "uri", {
80384
- get: function () {
80385
- return this._uri;
80386
- },
80387
- enumerable: false,
80388
- configurable: true
80389
- });
80390
- Object.defineProperty(FullTextDocument.prototype, "languageId", {
80391
- get: function () {
80392
- return this._languageId;
80393
- },
80394
- enumerable: false,
80395
- configurable: true
80396
- });
80397
- Object.defineProperty(FullTextDocument.prototype, "version", {
80398
- get: function () {
80399
- return this._version;
80400
- },
80401
- enumerable: false,
80402
- configurable: true
80403
- });
80404
- FullTextDocument.prototype.getText = function (range) {
80405
- if (range) {
80406
- var start = this.offsetAt(range.start);
80407
- var end = this.offsetAt(range.end);
80408
- return this._content.substring(start, end);
80409
- }
80410
- return this._content;
80411
- };
80412
- FullTextDocument.prototype.update = function (event, version) {
80413
- this._content = event.text;
80414
- this._version = version;
80415
- this._lineOffsets = undefined;
80416
- };
80417
- FullTextDocument.prototype.getLineOffsets = function () {
80418
- if (this._lineOffsets === undefined) {
80419
- var lineOffsets = [];
80420
- var text = this._content;
80421
- var isLineStart = true;
80422
- for (var i = 0; i < text.length; i++) {
80423
- if (isLineStart) {
80424
- lineOffsets.push(i);
80425
- isLineStart = false;
80458
+ })(TextDocument || (exports.TextDocument = TextDocument = {}));
80459
+ /**
80460
+ * @deprecated Use the text document from the new vscode-languageserver-textdocument package.
80461
+ */
80462
+ var FullTextDocument = /** @class */ (function () {
80463
+ function FullTextDocument(uri, languageId, version, content) {
80464
+ this._uri = uri;
80465
+ this._languageId = languageId;
80466
+ this._version = version;
80467
+ this._content = content;
80468
+ this._lineOffsets = undefined;
80469
+ }
80470
+ Object.defineProperty(FullTextDocument.prototype, "uri", {
80471
+ get: function () {
80472
+ return this._uri;
80473
+ },
80474
+ enumerable: false,
80475
+ configurable: true
80476
+ });
80477
+ Object.defineProperty(FullTextDocument.prototype, "languageId", {
80478
+ get: function () {
80479
+ return this._languageId;
80480
+ },
80481
+ enumerable: false,
80482
+ configurable: true
80483
+ });
80484
+ Object.defineProperty(FullTextDocument.prototype, "version", {
80485
+ get: function () {
80486
+ return this._version;
80487
+ },
80488
+ enumerable: false,
80489
+ configurable: true
80490
+ });
80491
+ FullTextDocument.prototype.getText = function (range) {
80492
+ if (range) {
80493
+ var start = this.offsetAt(range.start);
80494
+ var end = this.offsetAt(range.end);
80495
+ return this._content.substring(start, end);
80496
+ }
80497
+ return this._content;
80498
+ };
80499
+ FullTextDocument.prototype.update = function (event, version) {
80500
+ this._content = event.text;
80501
+ this._version = version;
80502
+ this._lineOffsets = undefined;
80503
+ };
80504
+ FullTextDocument.prototype.getLineOffsets = function () {
80505
+ if (this._lineOffsets === undefined) {
80506
+ var lineOffsets = [];
80507
+ var text = this._content;
80508
+ var isLineStart = true;
80509
+ for (var i = 0; i < text.length; i++) {
80510
+ if (isLineStart) {
80511
+ lineOffsets.push(i);
80512
+ isLineStart = false;
80513
+ }
80514
+ var ch = text.charAt(i);
80515
+ isLineStart = (ch === '\r' || ch === '\n');
80516
+ if (ch === '\r' && i + 1 < text.length && text.charAt(i + 1) === '\n') {
80517
+ i++;
80518
+ }
80426
80519
  }
80427
- var ch = text.charAt(i);
80428
- isLineStart = (ch === '\r' || ch === '\n');
80429
- if (ch === '\r' && i + 1 < text.length && text.charAt(i + 1) === '\n') {
80430
- i++;
80520
+ if (isLineStart && text.length > 0) {
80521
+ lineOffsets.push(text.length);
80431
80522
  }
80523
+ this._lineOffsets = lineOffsets;
80432
80524
  }
80433
- if (isLineStart && text.length > 0) {
80434
- lineOffsets.push(text.length);
80525
+ return this._lineOffsets;
80526
+ };
80527
+ FullTextDocument.prototype.positionAt = function (offset) {
80528
+ offset = Math.max(Math.min(offset, this._content.length), 0);
80529
+ var lineOffsets = this.getLineOffsets();
80530
+ var low = 0, high = lineOffsets.length;
80531
+ if (high === 0) {
80532
+ return Position.create(0, offset);
80533
+ }
80534
+ while (low < high) {
80535
+ var mid = Math.floor((low + high) / 2);
80536
+ if (lineOffsets[mid] > offset) {
80537
+ high = mid;
80538
+ }
80539
+ else {
80540
+ low = mid + 1;
80541
+ }
80435
80542
  }
80436
- this._lineOffsets = lineOffsets;
80437
- }
80438
- return this._lineOffsets;
80439
- };
80440
- FullTextDocument.prototype.positionAt = function (offset) {
80441
- offset = Math.max(Math.min(offset, this._content.length), 0);
80442
- var lineOffsets = this.getLineOffsets();
80443
- var low = 0, high = lineOffsets.length;
80444
- if (high === 0) {
80445
- return Position.create(0, offset);
80446
- }
80447
- while (low < high) {
80448
- var mid = Math.floor((low + high) / 2);
80449
- if (lineOffsets[mid] > offset) {
80450
- high = mid;
80543
+ // low is the least x for which the line offset is larger than the current offset
80544
+ // or array.length if no line offset is larger than the current offset
80545
+ var line = low - 1;
80546
+ return Position.create(line, offset - lineOffsets[line]);
80547
+ };
80548
+ FullTextDocument.prototype.offsetAt = function (position) {
80549
+ var lineOffsets = this.getLineOffsets();
80550
+ if (position.line >= lineOffsets.length) {
80551
+ return this._content.length;
80451
80552
  }
80452
- else {
80453
- low = mid + 1;
80553
+ else if (position.line < 0) {
80554
+ return 0;
80454
80555
  }
80455
- }
80456
- // low is the least x for which the line offset is larger than the current offset
80457
- // or array.length if no line offset is larger than the current offset
80458
- var line = low - 1;
80459
- return Position.create(line, offset - lineOffsets[line]);
80460
- };
80461
- FullTextDocument.prototype.offsetAt = function (position) {
80462
- var lineOffsets = this.getLineOffsets();
80463
- if (position.line >= lineOffsets.length) {
80464
- return this._content.length;
80465
- }
80466
- else if (position.line < 0) {
80467
- return 0;
80468
- }
80469
- var lineOffset = lineOffsets[position.line];
80470
- var nextLineOffset = (position.line + 1 < lineOffsets.length) ? lineOffsets[position.line + 1] : this._content.length;
80471
- return Math.max(Math.min(lineOffset + position.character, nextLineOffset), lineOffset);
80472
- };
80473
- Object.defineProperty(FullTextDocument.prototype, "lineCount", {
80474
- get: function () {
80475
- return this.getLineOffsets().length;
80476
- },
80477
- enumerable: false,
80478
- configurable: true
80479
- });
80480
- return FullTextDocument;
80481
- }());
80482
- var Is;
80483
- (function (Is) {
80484
- var toString = Object.prototype.toString;
80485
- function defined(value) {
80486
- return typeof value !== 'undefined';
80487
- }
80488
- Is.defined = defined;
80489
- function undefined(value) {
80490
- return typeof value === 'undefined';
80491
- }
80492
- Is.undefined = undefined;
80493
- function boolean(value) {
80494
- return value === true || value === false;
80495
- }
80496
- Is.boolean = boolean;
80497
- function string(value) {
80498
- return toString.call(value) === '[object String]';
80499
- }
80500
- Is.string = string;
80501
- function number(value) {
80502
- return toString.call(value) === '[object Number]';
80503
- }
80504
- Is.number = number;
80505
- function numberRange(value, min, max) {
80506
- return toString.call(value) === '[object Number]' && min <= value && value <= max;
80507
- }
80508
- Is.numberRange = numberRange;
80509
- function integer(value) {
80510
- return toString.call(value) === '[object Number]' && -2147483648 <= value && value <= 2147483647;
80511
- }
80512
- Is.integer = integer;
80513
- function uinteger(value) {
80514
- return toString.call(value) === '[object Number]' && 0 <= value && value <= 2147483647;
80515
- }
80516
- Is.uinteger = uinteger;
80517
- function func(value) {
80518
- return toString.call(value) === '[object Function]';
80519
- }
80520
- Is.func = func;
80521
- function objectLiteral(value) {
80522
- // Strictly speaking class instances pass this check as well. Since the LSP
80523
- // doesn't use classes we ignore this for now. If we do we need to add something
80524
- // like this: `Object.getPrototypeOf(Object.getPrototypeOf(x)) === null`
80525
- return value !== null && typeof value === 'object';
80526
- }
80527
- Is.objectLiteral = objectLiteral;
80528
- function typedArray(value, check) {
80529
- return Array.isArray(value) && value.every(check);
80530
- }
80531
- Is.typedArray = typedArray;
80532
- })(Is || (Is = {}));
80556
+ var lineOffset = lineOffsets[position.line];
80557
+ var nextLineOffset = (position.line + 1 < lineOffsets.length) ? lineOffsets[position.line + 1] : this._content.length;
80558
+ return Math.max(Math.min(lineOffset + position.character, nextLineOffset), lineOffset);
80559
+ };
80560
+ Object.defineProperty(FullTextDocument.prototype, "lineCount", {
80561
+ get: function () {
80562
+ return this.getLineOffsets().length;
80563
+ },
80564
+ enumerable: false,
80565
+ configurable: true
80566
+ });
80567
+ return FullTextDocument;
80568
+ }());
80569
+ var Is;
80570
+ (function (Is) {
80571
+ var toString = Object.prototype.toString;
80572
+ function defined(value) {
80573
+ return typeof value !== 'undefined';
80574
+ }
80575
+ Is.defined = defined;
80576
+ function undefined(value) {
80577
+ return typeof value === 'undefined';
80578
+ }
80579
+ Is.undefined = undefined;
80580
+ function boolean(value) {
80581
+ return value === true || value === false;
80582
+ }
80583
+ Is.boolean = boolean;
80584
+ function string(value) {
80585
+ return toString.call(value) === '[object String]';
80586
+ }
80587
+ Is.string = string;
80588
+ function number(value) {
80589
+ return toString.call(value) === '[object Number]';
80590
+ }
80591
+ Is.number = number;
80592
+ function numberRange(value, min, max) {
80593
+ return toString.call(value) === '[object Number]' && min <= value && value <= max;
80594
+ }
80595
+ Is.numberRange = numberRange;
80596
+ function integer(value) {
80597
+ return toString.call(value) === '[object Number]' && -2147483648 <= value && value <= 2147483647;
80598
+ }
80599
+ Is.integer = integer;
80600
+ function uinteger(value) {
80601
+ return toString.call(value) === '[object Number]' && 0 <= value && value <= 2147483647;
80602
+ }
80603
+ Is.uinteger = uinteger;
80604
+ function func(value) {
80605
+ return toString.call(value) === '[object Function]';
80606
+ }
80607
+ Is.func = func;
80608
+ function objectLiteral(value) {
80609
+ // Strictly speaking class instances pass this check as well. Since the LSP
80610
+ // doesn't use classes we ignore this for now. If we do we need to add something
80611
+ // like this: `Object.getPrototypeOf(Object.getPrototypeOf(x)) === null`
80612
+ return value !== null && typeof value === 'object';
80613
+ }
80614
+ Is.objectLiteral = objectLiteral;
80615
+ function typedArray(value, check) {
80616
+ return Array.isArray(value) && value.every(check);
80617
+ }
80618
+ Is.typedArray = typedArray;
80619
+ })(Is || (Is = {}));
80620
+ });
80533
80621
 
80534
80622
 
80623
+ /***/ }),
80624
+
80625
+ /***/ "./node_modules/vscode-languageserver-types/lib/umd sync recursive":
80626
+ /*!****************************************************************!*\
80627
+ !*** ./node_modules/vscode-languageserver-types/lib/umd/ sync ***!
80628
+ \****************************************************************/
80629
+ /***/ ((module) => {
80630
+
80631
+ function webpackEmptyContext(req) {
80632
+ var e = new Error("Cannot find module '" + req + "'");
80633
+ e.code = 'MODULE_NOT_FOUND';
80634
+ throw e;
80635
+ }
80636
+ webpackEmptyContext.keys = () => ([]);
80637
+ webpackEmptyContext.resolve = webpackEmptyContext;
80638
+ webpackEmptyContext.id = "./node_modules/vscode-languageserver-types/lib/umd sync recursive";
80639
+ module.exports = webpackEmptyContext;
80640
+
80535
80641
  /***/ }),
80536
80642
 
80537
80643
  /***/ "./node_modules/wrappy/wrappy.js":