@angular/language-server 22.0.0-next.1 → 22.0.0-next.11
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/index.js +715 -16
- package/package.json +4 -4
package/index.js
CHANGED
|
@@ -9908,9 +9908,19 @@ var require_api_bundle = __commonJS({
|
|
|
9908
9908
|
var __toCommonJS2 = (mod) => __copyProps2(__defProp2({}, "__esModule", { value: true }), mod);
|
|
9909
9909
|
var api_exports = {};
|
|
9910
9910
|
__export2(api_exports, {
|
|
9911
|
+
AngularSymbolKind: () => AngularSymbolKind,
|
|
9911
9912
|
isNgLanguageService: () => isNgLanguageService
|
|
9912
9913
|
});
|
|
9913
9914
|
module2.exports = __toCommonJS2(api_exports);
|
|
9915
|
+
var AngularSymbolKind = ((AngularSymbolKind2) => {
|
|
9916
|
+
AngularSymbolKind2[AngularSymbolKind2["Namespace"] = 3] = "Namespace";
|
|
9917
|
+
AngularSymbolKind2[AngularSymbolKind2["Class"] = 5] = "Class";
|
|
9918
|
+
AngularSymbolKind2[AngularSymbolKind2["Array"] = 18] = "Array";
|
|
9919
|
+
AngularSymbolKind2[AngularSymbolKind2["Object"] = 19] = "Object";
|
|
9920
|
+
AngularSymbolKind2[AngularSymbolKind2["Struct"] = 23] = "Struct";
|
|
9921
|
+
AngularSymbolKind2[AngularSymbolKind2["Event"] = 24] = "Event";
|
|
9922
|
+
return AngularSymbolKind2;
|
|
9923
|
+
})(AngularSymbolKind || {});
|
|
9914
9924
|
function isNgLanguageService(ls) {
|
|
9915
9925
|
return "getTcb" in ls;
|
|
9916
9926
|
}
|
|
@@ -9990,6 +10000,63 @@ var require_requests = __commonJS({
|
|
|
9990
10000
|
}
|
|
9991
10001
|
});
|
|
9992
10002
|
|
|
10003
|
+
// vscode-ng-language-service/server/src/config.js
|
|
10004
|
+
var require_config = __commonJS({
|
|
10005
|
+
"vscode-ng-language-service/server/src/config.js"(exports2) {
|
|
10006
|
+
"use strict";
|
|
10007
|
+
Object.defineProperty(exports2, "__esModule", { value: true });
|
|
10008
|
+
exports2.getWorkspaceConfiguration = getWorkspaceConfiguration;
|
|
10009
|
+
exports2.getWorkspaceConfigurationCached = getWorkspaceConfigurationCached;
|
|
10010
|
+
exports2.clearWorkspaceConfigurationCache = clearWorkspaceConfigurationCache;
|
|
10011
|
+
exports2.flattenConfiguration = flattenConfiguration;
|
|
10012
|
+
var workspaceConfigCache = /* @__PURE__ */ new WeakMap();
|
|
10013
|
+
function getWorkspaceConfiguration(connection, items) {
|
|
10014
|
+
return __async(this, null, function* () {
|
|
10015
|
+
try {
|
|
10016
|
+
return yield connection.workspace.getConfiguration(items);
|
|
10017
|
+
} catch (error) {
|
|
10018
|
+
return items.map(() => ({}));
|
|
10019
|
+
}
|
|
10020
|
+
});
|
|
10021
|
+
}
|
|
10022
|
+
function getWorkspaceConfigurationCached(connection, items) {
|
|
10023
|
+
return __async(this, null, function* () {
|
|
10024
|
+
const key = JSON.stringify(items);
|
|
10025
|
+
let cache = workspaceConfigCache.get(connection);
|
|
10026
|
+
if (!cache) {
|
|
10027
|
+
cache = /* @__PURE__ */ new Map();
|
|
10028
|
+
workspaceConfigCache.set(connection, cache);
|
|
10029
|
+
}
|
|
10030
|
+
const cached = cache.get(key);
|
|
10031
|
+
if (cached !== void 0) {
|
|
10032
|
+
return cached;
|
|
10033
|
+
}
|
|
10034
|
+
const value = yield getWorkspaceConfiguration(connection, items);
|
|
10035
|
+
cache.set(key, value);
|
|
10036
|
+
return value;
|
|
10037
|
+
});
|
|
10038
|
+
}
|
|
10039
|
+
function clearWorkspaceConfigurationCache(connection) {
|
|
10040
|
+
workspaceConfigCache.delete(connection);
|
|
10041
|
+
}
|
|
10042
|
+
function flattenConfiguration(config, prefix) {
|
|
10043
|
+
const result = {};
|
|
10044
|
+
function flatten(obj, currentPrefix) {
|
|
10045
|
+
for (const [key, value] of Object.entries(obj)) {
|
|
10046
|
+
const newKey = `${currentPrefix}.${key}`;
|
|
10047
|
+
if (value !== null && typeof value === "object" && !Array.isArray(value)) {
|
|
10048
|
+
flatten(value, newKey);
|
|
10049
|
+
} else {
|
|
10050
|
+
result[newKey] = value;
|
|
10051
|
+
}
|
|
10052
|
+
}
|
|
10053
|
+
}
|
|
10054
|
+
flatten(config, prefix);
|
|
10055
|
+
return result;
|
|
10056
|
+
}
|
|
10057
|
+
}
|
|
10058
|
+
});
|
|
10059
|
+
|
|
9993
10060
|
// node_modules/.aspect_rules_js/vscode-uri@3.1.0/node_modules/vscode-uri/lib/umd/index.js
|
|
9994
10061
|
var require_umd = __commonJS({
|
|
9995
10062
|
"node_modules/.aspect_rules_js/vscode-uri@3.1.0/node_modules/vscode-uri/lib/umd/index.js"(exports2, module2) {
|
|
@@ -72987,9 +73054,9 @@ var require_source_map_support = __commonJS({
|
|
|
72987
73054
|
}
|
|
72988
73055
|
});
|
|
72989
73056
|
|
|
72990
|
-
// node_modules/.aspect_rules_js/typescript@6.0.
|
|
73057
|
+
// node_modules/.aspect_rules_js/typescript@6.0.3/node_modules/typescript/lib/typescript.js
|
|
72991
73058
|
var require_typescript = __commonJS({
|
|
72992
|
-
"node_modules/.aspect_rules_js/typescript@6.0.
|
|
73059
|
+
"node_modules/.aspect_rules_js/typescript@6.0.3/node_modules/typescript/lib/typescript.js"(exports2, module2) {
|
|
72993
73060
|
var ts = {};
|
|
72994
73061
|
((module3) => {
|
|
72995
73062
|
"use strict";
|
|
@@ -75263,7 +75330,7 @@ var require_typescript = __commonJS({
|
|
|
75263
75330
|
});
|
|
75264
75331
|
module3.exports = __toCommonJS2(typescript_exports);
|
|
75265
75332
|
var versionMajorMinor = "6.0";
|
|
75266
|
-
var version = "6.0.
|
|
75333
|
+
var version = "6.0.3";
|
|
75267
75334
|
var Comparison = ((Comparison3) => {
|
|
75268
75335
|
Comparison3[Comparison3["LessThan"] = -1] = "LessThan";
|
|
75269
75336
|
Comparison3[Comparison3["EqualTo"] = 0] = "EqualTo";
|
|
@@ -83637,6 +83704,7 @@ ${lanes.join("\n")}
|
|
|
83637
83704
|
Import_assertions_have_been_replaced_by_import_attributes_Use_with_instead_of_assert: diag(2880, 1, "Import_assertions_have_been_replaced_by_import_attributes_Use_with_instead_of_assert_2880", "Import assertions have been replaced by import attributes. Use 'with' instead of 'assert'."),
|
|
83638
83705
|
This_expression_is_never_nullish: diag(2881, 1, "This_expression_is_never_nullish_2881", "This expression is never nullish."),
|
|
83639
83706
|
Cannot_find_module_or_type_declarations_for_side_effect_import_of_0: diag(2882, 1, "Cannot_find_module_or_type_declarations_for_side_effect_import_of_0_2882", "Cannot find module or type declarations for side-effect import of '{0}'."),
|
|
83707
|
+
The_inferred_type_of_0_cannot_be_named_without_a_reference_to_2_from_1_This_is_likely_not_portable_A_type_annotation_is_necessary: diag(2883, 1, "The_inferred_type_of_0_cannot_be_named_without_a_reference_to_2_from_1_This_is_likely_not_portable_A_2883", "The inferred type of '{0}' cannot be named without a reference to '{2}' from '{1}'. This is likely not portable. A type annotation is necessary."),
|
|
83640
83708
|
Import_declaration_0_is_using_private_name_1: diag(4e3, 1, "Import_declaration_0_is_using_private_name_1_4000", "Import declaration '{0}' is using private name '{1}'."),
|
|
83641
83709
|
Type_parameter_0_of_exported_class_has_or_is_using_private_name_1: diag(4002, 1, "Type_parameter_0_of_exported_class_has_or_is_using_private_name_1_4002", "Type parameter '{0}' of exported class has or is using private name '{1}'."),
|
|
83642
83710
|
Type_parameter_0_of_exported_interface_has_or_is_using_private_name_1: diag(4004, 1, "Type_parameter_0_of_exported_interface_has_or_is_using_private_name_1_4004", "Type parameter '{0}' of exported interface has or is using private name '{1}'."),
|
|
@@ -126608,6 +126676,8 @@ ${lanes.join("\n")}
|
|
|
126608
126676
|
return 1 | 4 | 32 | 8 | 16 | 256;
|
|
126609
126677
|
case 269:
|
|
126610
126678
|
return 4;
|
|
126679
|
+
case 173:
|
|
126680
|
+
return node.initializer ? 4 : 0;
|
|
126611
126681
|
case 300:
|
|
126612
126682
|
case 249:
|
|
126613
126683
|
case 250:
|
|
@@ -132863,7 +132933,7 @@ ${lanes.join("\n")}
|
|
|
132863
132933
|
if (name.includes("/node_modules/")) {
|
|
132864
132934
|
context.encounteredError = true;
|
|
132865
132935
|
if (context.tracker.reportLikelyUnsafeImportRequiredError) {
|
|
132866
|
-
context.tracker.reportLikelyUnsafeImportRequiredError(name);
|
|
132936
|
+
context.tracker.reportLikelyUnsafeImportRequiredError(name, nodeSymbol ? unescapeLeadingUnderscores(nodeSymbol.escapedName) : void 0);
|
|
132867
132937
|
}
|
|
132868
132938
|
}
|
|
132869
132939
|
if (name !== originalName) {
|
|
@@ -134763,8 +134833,8 @@ ${lanes.join("\n")}
|
|
|
134763
134833
|
reportInaccessibleUniqueSymbolError() {
|
|
134764
134834
|
markError(() => oldTracker.reportInaccessibleUniqueSymbolError());
|
|
134765
134835
|
},
|
|
134766
|
-
reportLikelyUnsafeImportRequiredError(specifier) {
|
|
134767
|
-
markError(() => oldTracker.reportLikelyUnsafeImportRequiredError(specifier));
|
|
134836
|
+
reportLikelyUnsafeImportRequiredError(specifier, symbolName2) {
|
|
134837
|
+
markError(() => oldTracker.reportLikelyUnsafeImportRequiredError(specifier, symbolName2));
|
|
134768
134838
|
},
|
|
134769
134839
|
reportNonSerializableProperty(name) {
|
|
134770
134840
|
markError(() => oldTracker.reportNonSerializableProperty(name));
|
|
@@ -135357,7 +135427,7 @@ ${lanes.join("\n")}
|
|
|
135357
135427
|
if (!attributes) {
|
|
135358
135428
|
context.encounteredError = true;
|
|
135359
135429
|
if (context.tracker.reportLikelyUnsafeImportRequiredError) {
|
|
135360
|
-
context.tracker.reportLikelyUnsafeImportRequiredError(oldSpecifier);
|
|
135430
|
+
context.tracker.reportLikelyUnsafeImportRequiredError(oldSpecifier, unescapeLeadingUnderscores(symbol.escapedName));
|
|
135361
135431
|
}
|
|
135362
135432
|
}
|
|
135363
135433
|
}
|
|
@@ -150116,9 +150186,12 @@ ${lanes.join("\n")}
|
|
|
150116
150186
|
if (relation === identityRelation) {
|
|
150117
150187
|
return signaturesIdenticalTo(source2, target2, kind);
|
|
150118
150188
|
}
|
|
150119
|
-
if (
|
|
150189
|
+
if (source2 === anyFunctionType) {
|
|
150120
150190
|
return -1;
|
|
150121
150191
|
}
|
|
150192
|
+
if (target2 === anyFunctionType) {
|
|
150193
|
+
return 0;
|
|
150194
|
+
}
|
|
150122
150195
|
const sourceIsJSConstructor = source2.symbol && isJSConstructor(source2.symbol.valueDeclaration);
|
|
150123
150196
|
const targetIsJSConstructor = target2.symbol && isJSConstructor(target2.symbol.valueDeclaration);
|
|
150124
150197
|
const sourceSignatures = getSignaturesOfType(
|
|
@@ -158261,7 +158334,7 @@ ${lanes.join("\n")}
|
|
|
158261
158334
|
spread,
|
|
158262
158335
|
createAnonymousType(attributesSymbol, childPropMap, emptyArray, emptyArray, emptyArray),
|
|
158263
158336
|
attributesSymbol,
|
|
158264
|
-
objectFlags,
|
|
158337
|
+
objectFlags | getPropagatingFlagsOfTypes(childrenTypes),
|
|
158265
158338
|
/*readonly*/
|
|
158266
158339
|
false
|
|
158267
158340
|
);
|
|
@@ -161834,6 +161907,14 @@ ${lanes.join("\n")}
|
|
|
161834
161907
|
/* Undefined */
|
|
161835
161908
|
), node.arguments[1]);
|
|
161836
161909
|
}
|
|
161910
|
+
if (compilerOptions.ignoreDeprecations !== "6.0" && isObjectLiteralExpression(node.arguments[1])) {
|
|
161911
|
+
for (const prop of node.arguments[1].properties) {
|
|
161912
|
+
if (isPropertyAssignment(prop) && isIdentifier(prop.name) && prop.name.escapedText === "assert") {
|
|
161913
|
+
grammarErrorOnNode(prop.name, Diagnostics.Import_assertions_have_been_replaced_by_import_attributes_Use_with_instead_of_assert);
|
|
161914
|
+
break;
|
|
161915
|
+
}
|
|
161916
|
+
}
|
|
161917
|
+
}
|
|
161837
161918
|
}
|
|
161838
161919
|
const moduleSymbol = resolveExternalModuleName(node, specifier);
|
|
161839
161920
|
if (moduleSymbol) {
|
|
@@ -166520,6 +166601,9 @@ ${lanes.join("\n")}
|
|
|
166520
166601
|
function checkImportType(node) {
|
|
166521
166602
|
checkSourceElement(node.argument);
|
|
166522
166603
|
if (node.attributes) {
|
|
166604
|
+
if (node.attributes.token !== 118 && compilerOptions.ignoreDeprecations !== "6.0") {
|
|
166605
|
+
grammarErrorOnFirstToken(node.attributes, Diagnostics.Import_assertions_have_been_replaced_by_import_attributes_Use_with_instead_of_assert);
|
|
166606
|
+
}
|
|
166523
166607
|
getResolutionModeOverride(node.attributes, grammarErrorOnNode);
|
|
166524
166608
|
}
|
|
166525
166609
|
checkTypeReferenceOrImport(node);
|
|
@@ -176136,11 +176220,11 @@ ${lanes.join("\n")}
|
|
|
176136
176220
|
this.inner.reportCyclicStructureError();
|
|
176137
176221
|
}
|
|
176138
176222
|
}
|
|
176139
|
-
reportLikelyUnsafeImportRequiredError(specifier) {
|
|
176223
|
+
reportLikelyUnsafeImportRequiredError(specifier, symbolName2) {
|
|
176140
176224
|
var _a3;
|
|
176141
176225
|
if ((_a3 = this.inner) == null ? void 0 : _a3.reportLikelyUnsafeImportRequiredError) {
|
|
176142
176226
|
this.onDiagnosticReported();
|
|
176143
|
-
this.inner.reportLikelyUnsafeImportRequiredError(specifier);
|
|
176227
|
+
this.inner.reportLikelyUnsafeImportRequiredError(specifier, symbolName2);
|
|
176144
176228
|
}
|
|
176145
176229
|
}
|
|
176146
176230
|
reportTruncationError() {
|
|
@@ -201680,9 +201764,13 @@ ${lanes.join("\n")}
|
|
|
201680
201764
|
context.addDiagnostic(createDiagnosticForNode(errorNameNode || errorFallbackNode, Diagnostics.The_inferred_type_of_0_references_an_inaccessible_1_type_A_type_annotation_is_necessary, errorDeclarationNameWithFallback(), "this"));
|
|
201681
201765
|
}
|
|
201682
201766
|
}
|
|
201683
|
-
function reportLikelyUnsafeImportRequiredError(specifier) {
|
|
201767
|
+
function reportLikelyUnsafeImportRequiredError(specifier, symbolName2) {
|
|
201684
201768
|
if (errorNameNode || errorFallbackNode) {
|
|
201685
|
-
|
|
201769
|
+
if (symbolName2) {
|
|
201770
|
+
context.addDiagnostic(createDiagnosticForNode(errorNameNode || errorFallbackNode, Diagnostics.The_inferred_type_of_0_cannot_be_named_without_a_reference_to_2_from_1_This_is_likely_not_portable_A_type_annotation_is_necessary, errorDeclarationNameWithFallback(), specifier, symbolName2));
|
|
201771
|
+
} else {
|
|
201772
|
+
context.addDiagnostic(createDiagnosticForNode(errorNameNode || errorFallbackNode, Diagnostics.The_inferred_type_of_0_cannot_be_named_without_a_reference_to_1_This_is_likely_not_portable_A_type_annotation_is_necessary, errorDeclarationNameWithFallback(), specifier));
|
|
201773
|
+
}
|
|
201686
201774
|
}
|
|
201687
201775
|
}
|
|
201688
201776
|
function reportTruncationError() {
|
|
@@ -202970,6 +203058,7 @@ ${lanes.join("\n")}
|
|
|
202970
203058
|
continue;
|
|
202971
203059
|
if (isBindingPattern(elem.name)) {
|
|
202972
203060
|
elems = concatenate(elems, walkBindingPattern(elem.name));
|
|
203061
|
+
continue;
|
|
202973
203062
|
}
|
|
202974
203063
|
elems = elems || [];
|
|
202975
203064
|
elems.push(factory2.createPropertyDeclaration(
|
|
@@ -211328,6 +211417,9 @@ ${lanes.join("\n")}
|
|
|
211328
211417
|
Debug.assert(newSourceFiles.length === oldProgram.getSourceFiles().length);
|
|
211329
211418
|
for (const newSourceFile of newSourceFiles) {
|
|
211330
211419
|
filesByName.set(newSourceFile.path, newSourceFile);
|
|
211420
|
+
if (oldProgram.isSourceFileDefaultLibrary(newSourceFile)) {
|
|
211421
|
+
libFiles.add(newSourceFile.path);
|
|
211422
|
+
}
|
|
211331
211423
|
}
|
|
211332
211424
|
const oldFilesByNameMap = oldProgram.getFilesByNameMap();
|
|
211333
211425
|
oldFilesByNameMap.forEach((oldFile, path) => {
|
|
@@ -223320,7 +223412,11 @@ ${lanes.join("\n")}
|
|
|
223320
223412
|
NameValidationResult2[NameValidationResult2["NameTooLong"] = 2] = "NameTooLong";
|
|
223321
223413
|
NameValidationResult2[NameValidationResult2["NameStartsWithDot"] = 3] = "NameStartsWithDot";
|
|
223322
223414
|
NameValidationResult2[NameValidationResult2["NameStartsWithUnderscore"] = 4] = "NameStartsWithUnderscore";
|
|
223323
|
-
NameValidationResult2[NameValidationResult2["
|
|
223415
|
+
NameValidationResult2[NameValidationResult2["NameContainsInvalidCharacters"] = 5] = "NameContainsInvalidCharacters";
|
|
223416
|
+
NameValidationResult2[
|
|
223417
|
+
NameValidationResult2["NameContainsNonURISafeCharacters"] = 5
|
|
223418
|
+
/* NameContainsInvalidCharacters */
|
|
223419
|
+
] = "NameContainsNonURISafeCharacters";
|
|
223324
223420
|
return NameValidationResult2;
|
|
223325
223421
|
})(NameValidationResult || {});
|
|
223326
223422
|
var maxPackageNameLength = 214;
|
|
@@ -223366,7 +223462,7 @@ ${lanes.join("\n")}
|
|
|
223366
223462
|
return 0;
|
|
223367
223463
|
}
|
|
223368
223464
|
}
|
|
223369
|
-
if (
|
|
223465
|
+
if (!/^[\w.-]+$/.test(packageName)) {
|
|
223370
223466
|
return 5;
|
|
223371
223467
|
}
|
|
223372
223468
|
return 0;
|
|
@@ -223392,7 +223488,7 @@ ${lanes.join("\n")}
|
|
|
223392
223488
|
case 4:
|
|
223393
223489
|
return `'${typing}':: ${kind} name '${name}' cannot start with '_'`;
|
|
223394
223490
|
case 5:
|
|
223395
|
-
return `'${typing}':: ${kind} name '${name}' contains
|
|
223491
|
+
return `'${typing}':: ${kind} name '${name}' contains invalid characters`;
|
|
223396
223492
|
case 0:
|
|
223397
223493
|
return Debug.fail();
|
|
223398
223494
|
default:
|
|
@@ -273654,6 +273750,22 @@ ${options2.prefix}` : "\n" : options2.prefix
|
|
|
273654
273750
|
/** @internal */
|
|
273655
273751
|
installPackage(req) {
|
|
273656
273752
|
const { fileName, packageName, projectName, projectRootPath, id } = req;
|
|
273753
|
+
const validationResult = ts_JsTyping_exports.validatePackageName(packageName);
|
|
273754
|
+
if (validationResult !== ts_JsTyping_exports.NameValidationResult.Ok) {
|
|
273755
|
+
const message = ts_JsTyping_exports.renderPackageNameValidationFailure(validationResult, packageName);
|
|
273756
|
+
if (this.log.isEnabled()) {
|
|
273757
|
+
this.log.writeLine(message);
|
|
273758
|
+
}
|
|
273759
|
+
const response = {
|
|
273760
|
+
kind: ActionPackageInstalled,
|
|
273761
|
+
projectName,
|
|
273762
|
+
id,
|
|
273763
|
+
success: false,
|
|
273764
|
+
message
|
|
273765
|
+
};
|
|
273766
|
+
this.sendResponse(response);
|
|
273767
|
+
return;
|
|
273768
|
+
}
|
|
273657
273769
|
const cwd = forEachAncestorDirectory(getDirectoryPath(fileName), (directory) => {
|
|
273658
273770
|
if (this.installTypingHost.fileExists(combinePaths(directory, "package.json"))) {
|
|
273659
273771
|
return directory;
|
|
@@ -307848,6 +307960,7 @@ var require_initialization = __commonJS({
|
|
|
307848
307960
|
return {
|
|
307849
307961
|
capabilities: {
|
|
307850
307962
|
foldingRangeProvider: true,
|
|
307963
|
+
documentSymbolProvider: true,
|
|
307851
307964
|
codeLensProvider: { resolveProvider: true },
|
|
307852
307965
|
textDocumentSync: lsp.TextDocumentSyncKind.Incremental,
|
|
307853
307966
|
completionProvider: {
|
|
@@ -307880,6 +307993,11 @@ var require_initialization = __commonJS({
|
|
|
307880
307993
|
// Find more info
|
|
307881
307994
|
// [here](https://github.com/angular/vscode-ng-language-service/issues/1828)
|
|
307882
307995
|
codeActionKinds: [lsp.CodeActionKind.QuickFix]
|
|
307996
|
+
},
|
|
307997
|
+
// Inlay hints provider (LSP 3.17)
|
|
307998
|
+
// Provides type annotations for template variables, $event types, etc.
|
|
307999
|
+
inlayHintProvider: {
|
|
308000
|
+
resolveProvider: true
|
|
307883
308001
|
}
|
|
307884
308002
|
},
|
|
307885
308003
|
serverOptions
|
|
@@ -307915,6 +308033,322 @@ var require_linked_editing_range = __commonJS({
|
|
|
307915
308033
|
}
|
|
307916
308034
|
});
|
|
307917
308035
|
|
|
308036
|
+
// vscode-ng-language-service/server/src/handlers/document_symbols.js
|
|
308037
|
+
var require_document_symbols = __commonJS({
|
|
308038
|
+
"vscode-ng-language-service/server/src/handlers/document_symbols.js"(exports2) {
|
|
308039
|
+
"use strict";
|
|
308040
|
+
var __createBinding = exports2 && exports2.__createBinding || (Object.create ? function(o, m, k, k2) {
|
|
308041
|
+
if (k2 === void 0)
|
|
308042
|
+
k2 = k;
|
|
308043
|
+
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
308044
|
+
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
308045
|
+
desc = { enumerable: true, get: function() {
|
|
308046
|
+
return m[k];
|
|
308047
|
+
} };
|
|
308048
|
+
}
|
|
308049
|
+
Object.defineProperty(o, k2, desc);
|
|
308050
|
+
} : function(o, m, k, k2) {
|
|
308051
|
+
if (k2 === void 0)
|
|
308052
|
+
k2 = k;
|
|
308053
|
+
o[k2] = m[k];
|
|
308054
|
+
});
|
|
308055
|
+
var __setModuleDefault = exports2 && exports2.__setModuleDefault || (Object.create ? function(o, v) {
|
|
308056
|
+
Object.defineProperty(o, "default", { enumerable: true, value: v });
|
|
308057
|
+
} : function(o, v) {
|
|
308058
|
+
o["default"] = v;
|
|
308059
|
+
});
|
|
308060
|
+
var __importStar = exports2 && exports2.__importStar || /* @__PURE__ */ function() {
|
|
308061
|
+
var ownKeys = function(o) {
|
|
308062
|
+
ownKeys = Object.getOwnPropertyNames || function(o2) {
|
|
308063
|
+
var ar = [];
|
|
308064
|
+
for (var k in o2)
|
|
308065
|
+
if (Object.prototype.hasOwnProperty.call(o2, k))
|
|
308066
|
+
ar[ar.length] = k;
|
|
308067
|
+
return ar;
|
|
308068
|
+
};
|
|
308069
|
+
return ownKeys(o);
|
|
308070
|
+
};
|
|
308071
|
+
return function(mod) {
|
|
308072
|
+
if (mod && mod.__esModule)
|
|
308073
|
+
return mod;
|
|
308074
|
+
var result = {};
|
|
308075
|
+
if (mod != null) {
|
|
308076
|
+
for (var k = ownKeys(mod), i = 0; i < k.length; i++)
|
|
308077
|
+
if (k[i] !== "default")
|
|
308078
|
+
__createBinding(result, mod, k[i]);
|
|
308079
|
+
}
|
|
308080
|
+
__setModuleDefault(result, mod);
|
|
308081
|
+
return result;
|
|
308082
|
+
};
|
|
308083
|
+
}();
|
|
308084
|
+
Object.defineProperty(exports2, "__esModule", { value: true });
|
|
308085
|
+
exports2.onDocumentSymbol = onDocumentSymbol;
|
|
308086
|
+
var lsp = __importStar(require_main4());
|
|
308087
|
+
var ts = __importStar(require("typescript/lib/tsserverlibrary"));
|
|
308088
|
+
var api_1 = require_api_bundle();
|
|
308089
|
+
var config_1 = require_config();
|
|
308090
|
+
var utils_1 = require_utils();
|
|
308091
|
+
function onDocumentSymbol(session, params) {
|
|
308092
|
+
return __async(this, null, function* () {
|
|
308093
|
+
var _a3, _b;
|
|
308094
|
+
const lsInfo = session.getLSAndScriptInfo(params.textDocument);
|
|
308095
|
+
if (lsInfo === null) {
|
|
308096
|
+
return null;
|
|
308097
|
+
}
|
|
308098
|
+
const { scriptInfo, languageService } = lsInfo;
|
|
308099
|
+
const isHtmlFile = params.textDocument.uri.endsWith(".html");
|
|
308100
|
+
const [config] = yield (0, config_1.getWorkspaceConfiguration)(session.connection, [
|
|
308101
|
+
{ scopeUri: params.textDocument.uri, section: "angular.documentSymbols" }
|
|
308102
|
+
]);
|
|
308103
|
+
const isEnabled = (config === null || config === void 0 ? void 0 : config.enabled) !== false;
|
|
308104
|
+
if (!isEnabled) {
|
|
308105
|
+
return null;
|
|
308106
|
+
}
|
|
308107
|
+
if (isHtmlFile) {
|
|
308108
|
+
if (isEnabled && (0, api_1.isNgLanguageService)(languageService)) {
|
|
308109
|
+
const templateSymbols2 = languageService.getTemplateDocumentSymbols(scriptInfo.fileName, {
|
|
308110
|
+
showImplicitForVariables: (_a3 = config === null || config === void 0 ? void 0 : config.showImplicitForVariables) !== null && _a3 !== void 0 ? _a3 : false
|
|
308111
|
+
});
|
|
308112
|
+
if (templateSymbols2.length > 0) {
|
|
308113
|
+
return convertTemplateSymbols(templateSymbols2, scriptInfo);
|
|
308114
|
+
}
|
|
308115
|
+
}
|
|
308116
|
+
return null;
|
|
308117
|
+
}
|
|
308118
|
+
let templateSymbols = [];
|
|
308119
|
+
if ((0, api_1.isNgLanguageService)(languageService)) {
|
|
308120
|
+
templateSymbols = languageService.getTemplateDocumentSymbols(scriptInfo.fileName, {
|
|
308121
|
+
showImplicitForVariables: (_b = config === null || config === void 0 ? void 0 : config.showImplicitForVariables) !== null && _b !== void 0 ? _b : false
|
|
308122
|
+
});
|
|
308123
|
+
}
|
|
308124
|
+
const navigationTree = languageService.getNavigationTree(scriptInfo.fileName);
|
|
308125
|
+
if (!navigationTree) {
|
|
308126
|
+
return null;
|
|
308127
|
+
}
|
|
308128
|
+
const classNamesWithTemplates = /* @__PURE__ */ new Set();
|
|
308129
|
+
for (const symbol of templateSymbols) {
|
|
308130
|
+
if (symbol.className) {
|
|
308131
|
+
classNamesWithTemplates.add(symbol.className);
|
|
308132
|
+
}
|
|
308133
|
+
}
|
|
308134
|
+
const tsSymbols = filterNavigationTreeToTemplateClasses(navigationTree, scriptInfo, classNamesWithTemplates);
|
|
308135
|
+
if (templateSymbols.length > 0) {
|
|
308136
|
+
mergeTemplateSymbolsIntoClass(tsSymbols, templateSymbols, scriptInfo);
|
|
308137
|
+
}
|
|
308138
|
+
return tsSymbols;
|
|
308139
|
+
});
|
|
308140
|
+
}
|
|
308141
|
+
function mergeTemplateSymbolsIntoClass(tsSymbols, templateSymbols, scriptInfo) {
|
|
308142
|
+
var _a3;
|
|
308143
|
+
if (templateSymbols.length === 0) {
|
|
308144
|
+
return;
|
|
308145
|
+
}
|
|
308146
|
+
const symbolsByClass = /* @__PURE__ */ new Map();
|
|
308147
|
+
const symbolsWithoutClass = [];
|
|
308148
|
+
for (const symbol of templateSymbols) {
|
|
308149
|
+
if (symbol.className) {
|
|
308150
|
+
const existing = (_a3 = symbolsByClass.get(symbol.className)) !== null && _a3 !== void 0 ? _a3 : [];
|
|
308151
|
+
existing.push(symbol);
|
|
308152
|
+
symbolsByClass.set(symbol.className, existing);
|
|
308153
|
+
} else {
|
|
308154
|
+
symbolsWithoutClass.push(symbol);
|
|
308155
|
+
}
|
|
308156
|
+
}
|
|
308157
|
+
for (const tsSymbol of tsSymbols) {
|
|
308158
|
+
if (tsSymbol.kind === lsp.SymbolKind.Class) {
|
|
308159
|
+
const classTemplateSymbols = symbolsByClass.get(tsSymbol.name);
|
|
308160
|
+
if (classTemplateSymbols && classTemplateSymbols.length > 0) {
|
|
308161
|
+
const converted = convertTemplateSymbols(classTemplateSymbols, scriptInfo);
|
|
308162
|
+
addTemplateSymbolsToClass(tsSymbol, converted);
|
|
308163
|
+
symbolsByClass.delete(tsSymbol.name);
|
|
308164
|
+
}
|
|
308165
|
+
}
|
|
308166
|
+
}
|
|
308167
|
+
if (symbolsWithoutClass.length > 0) {
|
|
308168
|
+
const converted = convertTemplateSymbols(symbolsWithoutClass, scriptInfo);
|
|
308169
|
+
for (const tsSymbol of tsSymbols) {
|
|
308170
|
+
if (tsSymbol.kind === lsp.SymbolKind.Class) {
|
|
308171
|
+
addTemplateSymbolsToClass(tsSymbol, converted);
|
|
308172
|
+
break;
|
|
308173
|
+
}
|
|
308174
|
+
}
|
|
308175
|
+
}
|
|
308176
|
+
}
|
|
308177
|
+
function addTemplateSymbolsToClass(classSymbol, templateSymbols) {
|
|
308178
|
+
if (!classSymbol.children) {
|
|
308179
|
+
classSymbol.children = [];
|
|
308180
|
+
}
|
|
308181
|
+
const templateContainer = {
|
|
308182
|
+
name: "(template)",
|
|
308183
|
+
kind: lsp.SymbolKind.Namespace,
|
|
308184
|
+
range: templateSymbols[0].range,
|
|
308185
|
+
selectionRange: templateSymbols[0].selectionRange,
|
|
308186
|
+
children: templateSymbols
|
|
308187
|
+
};
|
|
308188
|
+
classSymbol.children.push(templateContainer);
|
|
308189
|
+
}
|
|
308190
|
+
function filterNavigationTreeToTemplateClasses(tree, scriptInfo, classNamesWithTemplates) {
|
|
308191
|
+
const result = [];
|
|
308192
|
+
if (classNamesWithTemplates.size === 0) {
|
|
308193
|
+
return result;
|
|
308194
|
+
}
|
|
308195
|
+
if (tree.kind === ts.ScriptElementKind.moduleElement && tree.childItems) {
|
|
308196
|
+
for (const child of tree.childItems) {
|
|
308197
|
+
const filtered = filterNavigationItem(child, scriptInfo, classNamesWithTemplates);
|
|
308198
|
+
if (filtered) {
|
|
308199
|
+
result.push(filtered);
|
|
308200
|
+
}
|
|
308201
|
+
}
|
|
308202
|
+
} else {
|
|
308203
|
+
const filtered = filterNavigationItem(tree, scriptInfo, classNamesWithTemplates);
|
|
308204
|
+
if (filtered) {
|
|
308205
|
+
result.push(filtered);
|
|
308206
|
+
}
|
|
308207
|
+
}
|
|
308208
|
+
return result;
|
|
308209
|
+
}
|
|
308210
|
+
function filterNavigationItem(item, scriptInfo, classNamesWithTemplates) {
|
|
308211
|
+
if ((item.kind === ts.ScriptElementKind.classElement || item.kind === ts.ScriptElementKind.localClassElement) && item.text && classNamesWithTemplates.has(item.text)) {
|
|
308212
|
+
const spans = item.spans;
|
|
308213
|
+
if (!spans || spans.length === 0) {
|
|
308214
|
+
return null;
|
|
308215
|
+
}
|
|
308216
|
+
const range = (0, utils_1.tsTextSpanToLspRange)(scriptInfo, spans[0]);
|
|
308217
|
+
const selectionRange = item.nameSpan !== void 0 ? (0, utils_1.tsTextSpanToLspRange)(scriptInfo, item.nameSpan) : range;
|
|
308218
|
+
return {
|
|
308219
|
+
name: item.text,
|
|
308220
|
+
kind: lsp.SymbolKind.Class,
|
|
308221
|
+
range,
|
|
308222
|
+
selectionRange
|
|
308223
|
+
// No children - template symbols will be added later
|
|
308224
|
+
};
|
|
308225
|
+
}
|
|
308226
|
+
if (item.kind === ts.ScriptElementKind.moduleElement || item.kind === ts.ScriptElementKind.directory) {
|
|
308227
|
+
if (item.childItems && item.childItems.length > 0) {
|
|
308228
|
+
const filteredChildren = [];
|
|
308229
|
+
for (const child of item.childItems) {
|
|
308230
|
+
const filtered = filterNavigationItem(child, scriptInfo, classNamesWithTemplates);
|
|
308231
|
+
if (filtered) {
|
|
308232
|
+
filteredChildren.push(filtered);
|
|
308233
|
+
}
|
|
308234
|
+
}
|
|
308235
|
+
if (filteredChildren.length > 0) {
|
|
308236
|
+
const spans = item.spans;
|
|
308237
|
+
if (!spans || spans.length === 0) {
|
|
308238
|
+
const childRange = filteredChildren[0].range;
|
|
308239
|
+
return {
|
|
308240
|
+
name: item.text || "",
|
|
308241
|
+
kind: scriptElementKindToSymbolKind(item.kind),
|
|
308242
|
+
range: childRange,
|
|
308243
|
+
selectionRange: childRange,
|
|
308244
|
+
children: filteredChildren
|
|
308245
|
+
};
|
|
308246
|
+
}
|
|
308247
|
+
const range = (0, utils_1.tsTextSpanToLspRange)(scriptInfo, spans[0]);
|
|
308248
|
+
const selectionRange = item.nameSpan !== void 0 ? (0, utils_1.tsTextSpanToLspRange)(scriptInfo, item.nameSpan) : range;
|
|
308249
|
+
return {
|
|
308250
|
+
name: item.text || "",
|
|
308251
|
+
kind: scriptElementKindToSymbolKind(item.kind),
|
|
308252
|
+
range,
|
|
308253
|
+
selectionRange,
|
|
308254
|
+
children: filteredChildren
|
|
308255
|
+
};
|
|
308256
|
+
}
|
|
308257
|
+
}
|
|
308258
|
+
}
|
|
308259
|
+
return null;
|
|
308260
|
+
}
|
|
308261
|
+
function scriptElementKindToSymbolKind(kind) {
|
|
308262
|
+
switch (kind) {
|
|
308263
|
+
case ts.ScriptElementKind.moduleElement:
|
|
308264
|
+
return lsp.SymbolKind.Module;
|
|
308265
|
+
case ts.ScriptElementKind.classElement:
|
|
308266
|
+
return lsp.SymbolKind.Class;
|
|
308267
|
+
case ts.ScriptElementKind.localClassElement:
|
|
308268
|
+
return lsp.SymbolKind.Class;
|
|
308269
|
+
case ts.ScriptElementKind.interfaceElement:
|
|
308270
|
+
return lsp.SymbolKind.Interface;
|
|
308271
|
+
case ts.ScriptElementKind.typeElement:
|
|
308272
|
+
return lsp.SymbolKind.TypeParameter;
|
|
308273
|
+
case ts.ScriptElementKind.enumElement:
|
|
308274
|
+
return lsp.SymbolKind.Enum;
|
|
308275
|
+
case ts.ScriptElementKind.enumMemberElement:
|
|
308276
|
+
return lsp.SymbolKind.EnumMember;
|
|
308277
|
+
case ts.ScriptElementKind.variableElement:
|
|
308278
|
+
return lsp.SymbolKind.Variable;
|
|
308279
|
+
case ts.ScriptElementKind.localVariableElement:
|
|
308280
|
+
return lsp.SymbolKind.Variable;
|
|
308281
|
+
case ts.ScriptElementKind.functionElement:
|
|
308282
|
+
return lsp.SymbolKind.Function;
|
|
308283
|
+
case ts.ScriptElementKind.localFunctionElement:
|
|
308284
|
+
return lsp.SymbolKind.Function;
|
|
308285
|
+
case ts.ScriptElementKind.memberFunctionElement:
|
|
308286
|
+
return lsp.SymbolKind.Method;
|
|
308287
|
+
case ts.ScriptElementKind.memberGetAccessorElement:
|
|
308288
|
+
return lsp.SymbolKind.Property;
|
|
308289
|
+
case ts.ScriptElementKind.memberSetAccessorElement:
|
|
308290
|
+
return lsp.SymbolKind.Property;
|
|
308291
|
+
case ts.ScriptElementKind.memberVariableElement:
|
|
308292
|
+
return lsp.SymbolKind.Field;
|
|
308293
|
+
case ts.ScriptElementKind.constructorImplementationElement:
|
|
308294
|
+
return lsp.SymbolKind.Constructor;
|
|
308295
|
+
case ts.ScriptElementKind.callSignatureElement:
|
|
308296
|
+
return lsp.SymbolKind.Function;
|
|
308297
|
+
case ts.ScriptElementKind.indexSignatureElement:
|
|
308298
|
+
return lsp.SymbolKind.Key;
|
|
308299
|
+
case ts.ScriptElementKind.constructSignatureElement:
|
|
308300
|
+
return lsp.SymbolKind.Constructor;
|
|
308301
|
+
case ts.ScriptElementKind.parameterElement:
|
|
308302
|
+
return lsp.SymbolKind.Variable;
|
|
308303
|
+
case ts.ScriptElementKind.typeParameterElement:
|
|
308304
|
+
return lsp.SymbolKind.TypeParameter;
|
|
308305
|
+
case ts.ScriptElementKind.constElement:
|
|
308306
|
+
return lsp.SymbolKind.Constant;
|
|
308307
|
+
case ts.ScriptElementKind.letElement:
|
|
308308
|
+
return lsp.SymbolKind.Variable;
|
|
308309
|
+
case ts.ScriptElementKind.alias:
|
|
308310
|
+
return lsp.SymbolKind.Variable;
|
|
308311
|
+
default:
|
|
308312
|
+
return lsp.SymbolKind.Variable;
|
|
308313
|
+
}
|
|
308314
|
+
}
|
|
308315
|
+
function convertTemplateSymbols(symbols, scriptInfo) {
|
|
308316
|
+
const result = [];
|
|
308317
|
+
for (const symbol of symbols) {
|
|
308318
|
+
const converted = convertTemplateSymbol(symbol, scriptInfo);
|
|
308319
|
+
if (converted) {
|
|
308320
|
+
result.push(converted);
|
|
308321
|
+
}
|
|
308322
|
+
}
|
|
308323
|
+
return result;
|
|
308324
|
+
}
|
|
308325
|
+
function convertTemplateSymbol(symbol, scriptInfo) {
|
|
308326
|
+
if (!symbol.spans || symbol.spans.length === 0) {
|
|
308327
|
+
return null;
|
|
308328
|
+
}
|
|
308329
|
+
const range = (0, utils_1.tsTextSpanToLspRange)(scriptInfo, symbol.spans[0]);
|
|
308330
|
+
const selectionRange = symbol.nameSpan ? (0, utils_1.tsTextSpanToLspRange)(scriptInfo, symbol.nameSpan) : range;
|
|
308331
|
+
const children = [];
|
|
308332
|
+
if (symbol.childItems) {
|
|
308333
|
+
for (const child of symbol.childItems) {
|
|
308334
|
+
const childSymbol = convertTemplateSymbol(child, scriptInfo);
|
|
308335
|
+
if (childSymbol) {
|
|
308336
|
+
children.push(childSymbol);
|
|
308337
|
+
}
|
|
308338
|
+
}
|
|
308339
|
+
}
|
|
308340
|
+
const kind = symbol.lspKind !== void 0 ? symbol.lspKind : scriptElementKindToSymbolKind(symbol.kind);
|
|
308341
|
+
return {
|
|
308342
|
+
name: symbol.text,
|
|
308343
|
+
kind,
|
|
308344
|
+
range,
|
|
308345
|
+
selectionRange,
|
|
308346
|
+
children: children.length > 0 ? children : void 0
|
|
308347
|
+
};
|
|
308348
|
+
}
|
|
308349
|
+
}
|
|
308350
|
+
});
|
|
308351
|
+
|
|
307918
308352
|
// vscode-ng-language-service/server/src/handlers/rename.js
|
|
307919
308353
|
var require_rename = __commonJS({
|
|
307920
308354
|
"vscode-ng-language-service/server/src/handlers/rename.js"(exports2) {
|
|
@@ -308084,6 +308518,257 @@ var require_did_change_watched_files = __commonJS({
|
|
|
308084
308518
|
}
|
|
308085
308519
|
});
|
|
308086
308520
|
|
|
308521
|
+
// vscode-ng-language-service/server/src/handlers/inlay_hints.js
|
|
308522
|
+
var require_inlay_hints = __commonJS({
|
|
308523
|
+
"vscode-ng-language-service/server/src/handlers/inlay_hints.js"(exports2) {
|
|
308524
|
+
"use strict";
|
|
308525
|
+
var __createBinding = exports2 && exports2.__createBinding || (Object.create ? function(o, m, k, k2) {
|
|
308526
|
+
if (k2 === void 0)
|
|
308527
|
+
k2 = k;
|
|
308528
|
+
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
308529
|
+
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
308530
|
+
desc = { enumerable: true, get: function() {
|
|
308531
|
+
return m[k];
|
|
308532
|
+
} };
|
|
308533
|
+
}
|
|
308534
|
+
Object.defineProperty(o, k2, desc);
|
|
308535
|
+
} : function(o, m, k, k2) {
|
|
308536
|
+
if (k2 === void 0)
|
|
308537
|
+
k2 = k;
|
|
308538
|
+
o[k2] = m[k];
|
|
308539
|
+
});
|
|
308540
|
+
var __setModuleDefault = exports2 && exports2.__setModuleDefault || (Object.create ? function(o, v) {
|
|
308541
|
+
Object.defineProperty(o, "default", { enumerable: true, value: v });
|
|
308542
|
+
} : function(o, v) {
|
|
308543
|
+
o["default"] = v;
|
|
308544
|
+
});
|
|
308545
|
+
var __importStar = exports2 && exports2.__importStar || /* @__PURE__ */ function() {
|
|
308546
|
+
var ownKeys = function(o) {
|
|
308547
|
+
ownKeys = Object.getOwnPropertyNames || function(o2) {
|
|
308548
|
+
var ar = [];
|
|
308549
|
+
for (var k in o2)
|
|
308550
|
+
if (Object.prototype.hasOwnProperty.call(o2, k))
|
|
308551
|
+
ar[ar.length] = k;
|
|
308552
|
+
return ar;
|
|
308553
|
+
};
|
|
308554
|
+
return ownKeys(o);
|
|
308555
|
+
};
|
|
308556
|
+
return function(mod) {
|
|
308557
|
+
if (mod && mod.__esModule)
|
|
308558
|
+
return mod;
|
|
308559
|
+
var result = {};
|
|
308560
|
+
if (mod != null) {
|
|
308561
|
+
for (var k = ownKeys(mod), i = 0; i < k.length; i++)
|
|
308562
|
+
if (k[i] !== "default")
|
|
308563
|
+
__createBinding(result, mod, k[i]);
|
|
308564
|
+
}
|
|
308565
|
+
__setModuleDefault(result, mod);
|
|
308566
|
+
return result;
|
|
308567
|
+
};
|
|
308568
|
+
}();
|
|
308569
|
+
Object.defineProperty(exports2, "__esModule", { value: true });
|
|
308570
|
+
exports2.onInlayHint = onInlayHint;
|
|
308571
|
+
exports2.onInlayHintResolve = onInlayHintResolve;
|
|
308572
|
+
var lsp = __importStar(require_node3());
|
|
308573
|
+
var ts = __importStar(require("typescript/lib/tsserverlibrary"));
|
|
308574
|
+
var utils_1 = require_utils();
|
|
308575
|
+
var utils_2 = require_utils();
|
|
308576
|
+
var config_1 = require_config();
|
|
308577
|
+
var api_1 = require_api_bundle();
|
|
308578
|
+
function isEditorInlayHintsEnabled(vsCodeConfig) {
|
|
308579
|
+
const editorEnabled = vsCodeConfig["editor.inlayHints.enabled"];
|
|
308580
|
+
return !(editorEnabled === "off" || editorEnabled === false);
|
|
308581
|
+
}
|
|
308582
|
+
function mapAngularInlayHintsConfig(vsCodeConfig) {
|
|
308583
|
+
const config = {};
|
|
308584
|
+
const getConfigValue = (...keys) => {
|
|
308585
|
+
for (const key of keys) {
|
|
308586
|
+
if (vsCodeConfig[key] !== void 0 && vsCodeConfig[key] !== null) {
|
|
308587
|
+
return vsCodeConfig[key];
|
|
308588
|
+
}
|
|
308589
|
+
}
|
|
308590
|
+
return void 0;
|
|
308591
|
+
};
|
|
308592
|
+
const forLoopVariableTypes = getConfigValue("angular.inlayHints.variableTypes.forLoopVariableTypes");
|
|
308593
|
+
if (forLoopVariableTypes !== void 0)
|
|
308594
|
+
config.forLoopVariableTypes = forLoopVariableTypes;
|
|
308595
|
+
const ifAliasTypes = getConfigValue("angular.inlayHints.variableTypes.ifAliasTypes");
|
|
308596
|
+
if (ifAliasTypes !== void 0)
|
|
308597
|
+
config.ifAliasTypes = ifAliasTypes;
|
|
308598
|
+
const letDeclarationTypes = getConfigValue("angular.inlayHints.variableTypes.letDeclarationTypes");
|
|
308599
|
+
if (letDeclarationTypes !== void 0)
|
|
308600
|
+
config.letDeclarationTypes = letDeclarationTypes;
|
|
308601
|
+
const referenceVariableTypes = getConfigValue("angular.inlayHints.variableTypes.referenceVariableTypes");
|
|
308602
|
+
if (referenceVariableTypes !== void 0)
|
|
308603
|
+
config.referenceVariableTypes = referenceVariableTypes;
|
|
308604
|
+
const suppressWhenTypeMatchesName = getConfigValue("angular.inlayHints.variableTypes.suppressWhenTypeMatchesName");
|
|
308605
|
+
if (suppressWhenTypeMatchesName !== void 0) {
|
|
308606
|
+
config.variableTypeHintsWhenTypeMatchesName = !suppressWhenTypeMatchesName;
|
|
308607
|
+
}
|
|
308608
|
+
const arrowFunctionParameterTypes = getConfigValue("angular.inlayHints.functionTypes.arrowFunctionParameterTypes");
|
|
308609
|
+
if (arrowFunctionParameterTypes !== void 0) {
|
|
308610
|
+
config.arrowFunctionParameterTypes = arrowFunctionParameterTypes;
|
|
308611
|
+
}
|
|
308612
|
+
const arrowFunctionReturnTypes = getConfigValue("angular.inlayHints.functionTypes.arrowFunctionReturnTypes");
|
|
308613
|
+
if (arrowFunctionReturnTypes !== void 0) {
|
|
308614
|
+
config.arrowFunctionReturnTypes = arrowFunctionReturnTypes;
|
|
308615
|
+
}
|
|
308616
|
+
const parameterNameHints = getConfigValue("angular.inlayHints.parameterHints.nameHints");
|
|
308617
|
+
if (parameterNameHints !== void 0)
|
|
308618
|
+
config.parameterNameHints = parameterNameHints;
|
|
308619
|
+
const suppressWhenArgumentMatchesName = getConfigValue("angular.inlayHints.parameterHints.suppressWhenArgumentMatchesName");
|
|
308620
|
+
if (suppressWhenArgumentMatchesName !== void 0) {
|
|
308621
|
+
config.parameterNameHintsWhenArgumentMatchesName = !suppressWhenArgumentMatchesName;
|
|
308622
|
+
}
|
|
308623
|
+
const eventParameterTypes = getConfigValue("angular.inlayHints.eventHints.parameterTypes");
|
|
308624
|
+
if (eventParameterTypes !== void 0)
|
|
308625
|
+
config.eventParameterTypes = eventParameterTypes;
|
|
308626
|
+
const propertyBindingTypes = getConfigValue("angular.inlayHints.bindingHints.propertyBindingTypes");
|
|
308627
|
+
if (propertyBindingTypes !== void 0)
|
|
308628
|
+
config.propertyBindingTypes = propertyBindingTypes;
|
|
308629
|
+
const pipeOutputTypes = getConfigValue("angular.inlayHints.bindingHints.pipeOutputTypes");
|
|
308630
|
+
if (pipeOutputTypes !== void 0)
|
|
308631
|
+
config.pipeOutputTypes = pipeOutputTypes;
|
|
308632
|
+
const twoWayBindingSignalTypes = getConfigValue("angular.inlayHints.bindingHints.twoWayBindingSignalTypes");
|
|
308633
|
+
if (twoWayBindingSignalTypes !== void 0) {
|
|
308634
|
+
config.twoWayBindingSignalTypes = twoWayBindingSignalTypes;
|
|
308635
|
+
}
|
|
308636
|
+
const requiredInputIndicator = getConfigValue("angular.inlayHints.bindingHints.requiredInputIndicator");
|
|
308637
|
+
if (requiredInputIndicator !== void 0) {
|
|
308638
|
+
config.requiredInputIndicator = requiredInputIndicator;
|
|
308639
|
+
}
|
|
308640
|
+
const interactiveInlayHints = getConfigValue("angular.inlayHints.interaction.interactiveInlayHints");
|
|
308641
|
+
if (interactiveInlayHints !== void 0)
|
|
308642
|
+
config.interactiveInlayHints = interactiveInlayHints;
|
|
308643
|
+
const hostListenerArgumentTypes = getConfigValue("angular.inlayHints.eventHints.hostListenerArgumentTypes");
|
|
308644
|
+
if (hostListenerArgumentTypes !== void 0) {
|
|
308645
|
+
config.hostListenerArgumentTypes = hostListenerArgumentTypes;
|
|
308646
|
+
}
|
|
308647
|
+
const switchExpressionTypes = getConfigValue("angular.inlayHints.controlFlowHints.switchExpressionTypes");
|
|
308648
|
+
if (switchExpressionTypes !== void 0)
|
|
308649
|
+
config.switchExpressionTypes = switchExpressionTypes;
|
|
308650
|
+
const deferTriggerTypes = getConfigValue("angular.inlayHints.controlFlowHints.deferTriggerTypes");
|
|
308651
|
+
if (deferTriggerTypes !== void 0)
|
|
308652
|
+
config.deferTriggerTypes = deferTriggerTypes;
|
|
308653
|
+
return config;
|
|
308654
|
+
}
|
|
308655
|
+
function onInlayHint(session, params) {
|
|
308656
|
+
return __async(this, null, function* () {
|
|
308657
|
+
var _a3, _b;
|
|
308658
|
+
const lsInfo = session.getLSAndScriptInfo(params.textDocument);
|
|
308659
|
+
if (!lsInfo) {
|
|
308660
|
+
return null;
|
|
308661
|
+
}
|
|
308662
|
+
const { languageService, scriptInfo } = lsInfo;
|
|
308663
|
+
const hints = [];
|
|
308664
|
+
const [startOffset, endOffset] = (0, utils_1.lspRangeToTsPositions)(scriptInfo, params.range);
|
|
308665
|
+
const span = { start: startOffset, length: endOffset - startOffset };
|
|
308666
|
+
let angularConfig = {};
|
|
308667
|
+
try {
|
|
308668
|
+
const configResult = yield (0, config_1.getWorkspaceConfigurationCached)(session.connection, [
|
|
308669
|
+
{ section: "angular.inlayHints", scopeUri: params.textDocument.uri },
|
|
308670
|
+
{ section: "editor.inlayHints", scopeUri: params.textDocument.uri }
|
|
308671
|
+
]);
|
|
308672
|
+
if (configResult && configResult.length >= 2) {
|
|
308673
|
+
const flatConfig = Object.assign(Object.assign({}, (0, config_1.flattenConfiguration)((_a3 = configResult[0]) !== null && _a3 !== void 0 ? _a3 : {}, "angular.inlayHints")), (0, config_1.flattenConfiguration)((_b = configResult[1]) !== null && _b !== void 0 ? _b : {}, "editor.inlayHints"));
|
|
308674
|
+
if (!isEditorInlayHintsEnabled(flatConfig)) {
|
|
308675
|
+
return null;
|
|
308676
|
+
}
|
|
308677
|
+
angularConfig = mapAngularInlayHintsConfig(flatConfig);
|
|
308678
|
+
}
|
|
308679
|
+
} catch (_c) {
|
|
308680
|
+
}
|
|
308681
|
+
if ((0, api_1.isNgLanguageService)(languageService)) {
|
|
308682
|
+
try {
|
|
308683
|
+
const angularHints = languageService.getAngularInlayHints(scriptInfo.fileName, span, angularConfig);
|
|
308684
|
+
for (const angularHint of angularHints) {
|
|
308685
|
+
const position = scriptInfo.positionToLineOffset(angularHint.position);
|
|
308686
|
+
hints.push(convertAngularInlayHint(session, angularHint, position));
|
|
308687
|
+
}
|
|
308688
|
+
} catch (e) {
|
|
308689
|
+
}
|
|
308690
|
+
}
|
|
308691
|
+
return hints.length > 0 ? hints : null;
|
|
308692
|
+
});
|
|
308693
|
+
}
|
|
308694
|
+
function onInlayHintResolve(session, hint) {
|
|
308695
|
+
return hint;
|
|
308696
|
+
}
|
|
308697
|
+
function convertAngularInlayHint(session, angularHint, position) {
|
|
308698
|
+
const lspPosition = {
|
|
308699
|
+
line: position.line - 1,
|
|
308700
|
+
character: position.offset - 1
|
|
308701
|
+
};
|
|
308702
|
+
const kind = angularHint.kind === "Type" ? lsp.InlayHintKind.Type : lsp.InlayHintKind.Parameter;
|
|
308703
|
+
let label;
|
|
308704
|
+
if (angularHint.displayParts && angularHint.displayParts.length > 0) {
|
|
308705
|
+
label = angularHint.displayParts.map((part) => {
|
|
308706
|
+
const labelPart = {
|
|
308707
|
+
value: part.text
|
|
308708
|
+
};
|
|
308709
|
+
const location = getDisplayPartLocation(session, part);
|
|
308710
|
+
if (location) {
|
|
308711
|
+
labelPart.location = location;
|
|
308712
|
+
}
|
|
308713
|
+
return labelPart;
|
|
308714
|
+
});
|
|
308715
|
+
} else {
|
|
308716
|
+
label = angularHint.text;
|
|
308717
|
+
}
|
|
308718
|
+
const hint = {
|
|
308719
|
+
position: lspPosition,
|
|
308720
|
+
label,
|
|
308721
|
+
kind,
|
|
308722
|
+
paddingLeft: angularHint.paddingLeft,
|
|
308723
|
+
paddingRight: angularHint.paddingRight
|
|
308724
|
+
};
|
|
308725
|
+
if (angularHint.tooltip) {
|
|
308726
|
+
hint.tooltip = angularHint.tooltip;
|
|
308727
|
+
}
|
|
308728
|
+
return hint;
|
|
308729
|
+
}
|
|
308730
|
+
function getDisplayPartLocation(session, part) {
|
|
308731
|
+
if (!part.span || !part.file) {
|
|
308732
|
+
return void 0;
|
|
308733
|
+
}
|
|
308734
|
+
const scriptInfo = session.projectService.getScriptInfo(part.file);
|
|
308735
|
+
if (scriptInfo) {
|
|
308736
|
+
const start2 = scriptInfo.positionToLineOffset(part.span.start);
|
|
308737
|
+
const end2 = scriptInfo.positionToLineOffset(part.span.start + part.span.length);
|
|
308738
|
+
return {
|
|
308739
|
+
uri: (0, utils_2.filePathToUri)(part.file),
|
|
308740
|
+
range: {
|
|
308741
|
+
start: { line: start2.line - 1, character: start2.offset - 1 },
|
|
308742
|
+
end: { line: end2.line - 1, character: end2.offset - 1 }
|
|
308743
|
+
}
|
|
308744
|
+
};
|
|
308745
|
+
}
|
|
308746
|
+
const text = readFileText(session, part.file);
|
|
308747
|
+
if (text === void 0) {
|
|
308748
|
+
return void 0;
|
|
308749
|
+
}
|
|
308750
|
+
const sourceFile = ts.createSourceFile(part.file, text, ts.ScriptTarget.Latest, true);
|
|
308751
|
+
const start = ts.getLineAndCharacterOfPosition(sourceFile, part.span.start);
|
|
308752
|
+
const end = ts.getLineAndCharacterOfPosition(sourceFile, part.span.start + part.span.length);
|
|
308753
|
+
return {
|
|
308754
|
+
uri: (0, utils_2.filePathToUri)(part.file),
|
|
308755
|
+
range: {
|
|
308756
|
+
start: { line: start.line, character: start.character },
|
|
308757
|
+
end: { line: end.line, character: end.character }
|
|
308758
|
+
}
|
|
308759
|
+
};
|
|
308760
|
+
}
|
|
308761
|
+
function readFileText(session, fileName) {
|
|
308762
|
+
const scriptInfo = session.projectService.getScriptInfo(fileName);
|
|
308763
|
+
if (scriptInfo) {
|
|
308764
|
+
const snapshot = scriptInfo.getSnapshot();
|
|
308765
|
+
return snapshot.getText(0, snapshot.getLength());
|
|
308766
|
+
}
|
|
308767
|
+
return ts.sys.readFile(fileName);
|
|
308768
|
+
}
|
|
308769
|
+
}
|
|
308770
|
+
});
|
|
308771
|
+
|
|
308087
308772
|
// vscode-ng-language-service/server/src/session.js
|
|
308088
308773
|
var require_session = __commonJS({
|
|
308089
308774
|
"vscode-ng-language-service/server/src/session.js"(exports2) {
|
|
@@ -308140,6 +308825,7 @@ var require_session = __commonJS({
|
|
|
308140
308825
|
var lsp = __importStar(require_node3());
|
|
308141
308826
|
var notifications_1 = require_notifications();
|
|
308142
308827
|
var requests_1 = require_requests();
|
|
308828
|
+
var config_1 = require_config();
|
|
308143
308829
|
var diagnostic_1 = require_diagnostic2();
|
|
308144
308830
|
var utils_1 = require_utils();
|
|
308145
308831
|
var code_actions_1 = require_code_actions();
|
|
@@ -308150,11 +308836,13 @@ var require_session = __commonJS({
|
|
|
308150
308836
|
var hover_1 = require_hover();
|
|
308151
308837
|
var initialization_1 = require_initialization();
|
|
308152
308838
|
var linked_editing_range_1 = require_linked_editing_range();
|
|
308839
|
+
var document_symbols_1 = require_document_symbols();
|
|
308153
308840
|
var rename_1 = require_rename();
|
|
308154
308841
|
var signature_1 = require_signature();
|
|
308155
308842
|
var tcb_1 = require_tcb();
|
|
308156
308843
|
var template_info_1 = require_template_info();
|
|
308157
308844
|
var did_change_watched_files_1 = require_did_change_watched_files();
|
|
308845
|
+
var inlay_hints_1 = require_inlay_hints();
|
|
308158
308846
|
var LanguageId;
|
|
308159
308847
|
(function(LanguageId2) {
|
|
308160
308848
|
LanguageId2["TS"] = "typescript";
|
|
@@ -308173,6 +308861,7 @@ var require_session = __commonJS({
|
|
|
308173
308861
|
this.renameDisabledProjects = /* @__PURE__ */ new WeakSet();
|
|
308174
308862
|
this.clientCapabilities = {};
|
|
308175
308863
|
this.defaultPreferences = {};
|
|
308864
|
+
this.inlayHintsConfig = {};
|
|
308176
308865
|
this.includeAutomaticOptionalChainCompletions = options2.includeAutomaticOptionalChainCompletions;
|
|
308177
308866
|
this.includeCompletionsWithSnippetText = options2.includeCompletionsWithSnippetText;
|
|
308178
308867
|
this.includeCompletionsForModuleExports = options2.includeCompletionsForModuleExports;
|
|
@@ -308283,6 +308972,11 @@ var require_session = __commonJS({
|
|
|
308283
308972
|
conn.onDidCloseTextDocument((p) => this.onDidCloseTextDocument(p));
|
|
308284
308973
|
conn.onDidChangeTextDocument((p) => this.onDidChangeTextDocument(p));
|
|
308285
308974
|
conn.onDidSaveTextDocument((p) => this.onDidSaveTextDocument(p));
|
|
308975
|
+
conn.onDidChangeConfiguration(() => {
|
|
308976
|
+
(0, config_1.clearWorkspaceConfigurationCache)(this.connection);
|
|
308977
|
+
void this.connection.languages.inlayHint.refresh().catch(() => {
|
|
308978
|
+
});
|
|
308979
|
+
});
|
|
308286
308980
|
conn.onDefinition((p) => (0, definitions_1.onDefinition)(this, p));
|
|
308287
308981
|
conn.onTypeDefinition((p) => (0, definitions_1.onTypeDefinition)(this, p));
|
|
308288
308982
|
conn.onReferences((p) => (0, definitions_1.onReferences)(this, p));
|
|
@@ -308291,6 +308985,9 @@ var require_session = __commonJS({
|
|
|
308291
308985
|
conn.onHover((p) => (0, hover_1.onHover)(this, p));
|
|
308292
308986
|
conn.onFoldingRanges((p) => (0, folding_1.onFoldingRanges)(this, p));
|
|
308293
308987
|
conn.languages.onLinkedEditingRange((p) => (0, linked_editing_range_1.onLinkedEditingRange)(this, p));
|
|
308988
|
+
conn.onDocumentSymbol((p) => __async(this, null, function* () {
|
|
308989
|
+
return yield (0, document_symbols_1.onDocumentSymbol)(this, p);
|
|
308990
|
+
}));
|
|
308294
308991
|
conn.onCompletion((p) => (0, completions_1.onCompletion)(this, p));
|
|
308295
308992
|
conn.onCompletionResolve((p) => (0, completions_1.onCompletionResolve)(this, p));
|
|
308296
308993
|
conn.onRequest(requests_1.GetComponentsWithTemplateFile, (p) => (0, code_lens_1.getComponentsWithTemplateFile)(this, p));
|
|
@@ -308304,6 +309001,8 @@ var require_session = __commonJS({
|
|
|
308304
309001
|
conn.onCodeActionResolve((p) => __async(this, null, function* () {
|
|
308305
309002
|
return yield (0, code_actions_1.onCodeActionResolve)(this, p);
|
|
308306
309003
|
}));
|
|
309004
|
+
conn.onRequest(lsp.InlayHintRequest.type, (p) => (0, inlay_hints_1.onInlayHint)(this, p));
|
|
309005
|
+
conn.onRequest(lsp.InlayHintResolveRequest.type, (p) => (0, inlay_hints_1.onInlayHintResolve)(this, p));
|
|
308307
309006
|
}
|
|
308308
309007
|
enableLanguageServiceForProject(project) {
|
|
308309
309008
|
const projectName = project.getProjectName();
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@angular/language-server",
|
|
3
3
|
"description": "LSP server for Angular Language Service",
|
|
4
|
-
"version": "22.0.0-next.
|
|
4
|
+
"version": "22.0.0-next.11",
|
|
5
5
|
"repository": {
|
|
6
6
|
"type": "git",
|
|
7
7
|
"url": "https://github.com/angular/angular.git",
|
|
@@ -10,15 +10,15 @@
|
|
|
10
10
|
"author": "Angular",
|
|
11
11
|
"license": "MIT",
|
|
12
12
|
"engines": {
|
|
13
|
-
"node": "^22.22.0 ||
|
|
13
|
+
"node": "^22.22.0 || ^24.13.1 || >=26.0.0"
|
|
14
14
|
},
|
|
15
15
|
"main": "./index.js",
|
|
16
16
|
"bin": {
|
|
17
17
|
"ngserver": "./bin/ngserver"
|
|
18
18
|
},
|
|
19
19
|
"dependencies": {
|
|
20
|
-
"@angular/language-service": "22.0.0-next.
|
|
21
|
-
"typescript": "6.0.
|
|
20
|
+
"@angular/language-service": "22.0.0-next.11",
|
|
21
|
+
"typescript": "6.0.3"
|
|
22
22
|
},
|
|
23
23
|
"devDependencies": {
|
|
24
24
|
"@types/node": "^24.5.2",
|