@angular/language-server 22.0.0-next.3 → 22.0.0-next.5
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 +395 -61
- package/package.json +3 -3
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.2/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.2/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.2";
|
|
75267
75334
|
var Comparison = ((Comparison3) => {
|
|
75268
75335
|
Comparison3[Comparison3["LessThan"] = -1] = "LessThan";
|
|
75269
75336
|
Comparison3[Comparison3["EqualTo"] = 0] = "EqualTo";
|
|
@@ -211348,6 +211415,9 @@ ${lanes.join("\n")}
|
|
|
211348
211415
|
Debug.assert(newSourceFiles.length === oldProgram.getSourceFiles().length);
|
|
211349
211416
|
for (const newSourceFile of newSourceFiles) {
|
|
211350
211417
|
filesByName.set(newSourceFile.path, newSourceFile);
|
|
211418
|
+
if (oldProgram.isSourceFileDefaultLibrary(newSourceFile)) {
|
|
211419
|
+
libFiles.add(newSourceFile.path);
|
|
211420
|
+
}
|
|
211351
211421
|
}
|
|
211352
211422
|
const oldFilesByNameMap = oldProgram.getFilesByNameMap();
|
|
211353
211423
|
oldFilesByNameMap.forEach((oldFile, path) => {
|
|
@@ -307868,6 +307938,7 @@ var require_initialization = __commonJS({
|
|
|
307868
307938
|
return {
|
|
307869
307939
|
capabilities: {
|
|
307870
307940
|
foldingRangeProvider: true,
|
|
307941
|
+
documentSymbolProvider: true,
|
|
307871
307942
|
codeLensProvider: { resolveProvider: true },
|
|
307872
307943
|
textDocumentSync: lsp.TextDocumentSyncKind.Incremental,
|
|
307873
307944
|
completionProvider: {
|
|
@@ -307940,6 +308011,322 @@ var require_linked_editing_range = __commonJS({
|
|
|
307940
308011
|
}
|
|
307941
308012
|
});
|
|
307942
308013
|
|
|
308014
|
+
// vscode-ng-language-service/server/src/handlers/document_symbols.js
|
|
308015
|
+
var require_document_symbols = __commonJS({
|
|
308016
|
+
"vscode-ng-language-service/server/src/handlers/document_symbols.js"(exports2) {
|
|
308017
|
+
"use strict";
|
|
308018
|
+
var __createBinding = exports2 && exports2.__createBinding || (Object.create ? function(o, m, k, k2) {
|
|
308019
|
+
if (k2 === void 0)
|
|
308020
|
+
k2 = k;
|
|
308021
|
+
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
308022
|
+
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
308023
|
+
desc = { enumerable: true, get: function() {
|
|
308024
|
+
return m[k];
|
|
308025
|
+
} };
|
|
308026
|
+
}
|
|
308027
|
+
Object.defineProperty(o, k2, desc);
|
|
308028
|
+
} : function(o, m, k, k2) {
|
|
308029
|
+
if (k2 === void 0)
|
|
308030
|
+
k2 = k;
|
|
308031
|
+
o[k2] = m[k];
|
|
308032
|
+
});
|
|
308033
|
+
var __setModuleDefault = exports2 && exports2.__setModuleDefault || (Object.create ? function(o, v) {
|
|
308034
|
+
Object.defineProperty(o, "default", { enumerable: true, value: v });
|
|
308035
|
+
} : function(o, v) {
|
|
308036
|
+
o["default"] = v;
|
|
308037
|
+
});
|
|
308038
|
+
var __importStar = exports2 && exports2.__importStar || /* @__PURE__ */ function() {
|
|
308039
|
+
var ownKeys = function(o) {
|
|
308040
|
+
ownKeys = Object.getOwnPropertyNames || function(o2) {
|
|
308041
|
+
var ar = [];
|
|
308042
|
+
for (var k in o2)
|
|
308043
|
+
if (Object.prototype.hasOwnProperty.call(o2, k))
|
|
308044
|
+
ar[ar.length] = k;
|
|
308045
|
+
return ar;
|
|
308046
|
+
};
|
|
308047
|
+
return ownKeys(o);
|
|
308048
|
+
};
|
|
308049
|
+
return function(mod) {
|
|
308050
|
+
if (mod && mod.__esModule)
|
|
308051
|
+
return mod;
|
|
308052
|
+
var result = {};
|
|
308053
|
+
if (mod != null) {
|
|
308054
|
+
for (var k = ownKeys(mod), i = 0; i < k.length; i++)
|
|
308055
|
+
if (k[i] !== "default")
|
|
308056
|
+
__createBinding(result, mod, k[i]);
|
|
308057
|
+
}
|
|
308058
|
+
__setModuleDefault(result, mod);
|
|
308059
|
+
return result;
|
|
308060
|
+
};
|
|
308061
|
+
}();
|
|
308062
|
+
Object.defineProperty(exports2, "__esModule", { value: true });
|
|
308063
|
+
exports2.onDocumentSymbol = onDocumentSymbol;
|
|
308064
|
+
var lsp = __importStar(require_main4());
|
|
308065
|
+
var ts = __importStar(require("typescript/lib/tsserverlibrary"));
|
|
308066
|
+
var api_1 = require_api_bundle();
|
|
308067
|
+
var config_1 = require_config();
|
|
308068
|
+
var utils_1 = require_utils();
|
|
308069
|
+
function onDocumentSymbol(session, params) {
|
|
308070
|
+
return __async(this, null, function* () {
|
|
308071
|
+
var _a3, _b;
|
|
308072
|
+
const lsInfo = session.getLSAndScriptInfo(params.textDocument);
|
|
308073
|
+
if (lsInfo === null) {
|
|
308074
|
+
return null;
|
|
308075
|
+
}
|
|
308076
|
+
const { scriptInfo, languageService } = lsInfo;
|
|
308077
|
+
const isHtmlFile = params.textDocument.uri.endsWith(".html");
|
|
308078
|
+
const [config] = yield (0, config_1.getWorkspaceConfiguration)(session.connection, [
|
|
308079
|
+
{ scopeUri: params.textDocument.uri, section: "angular.documentSymbols" }
|
|
308080
|
+
]);
|
|
308081
|
+
const isEnabled = (config === null || config === void 0 ? void 0 : config.enabled) !== false;
|
|
308082
|
+
if (!isEnabled) {
|
|
308083
|
+
return null;
|
|
308084
|
+
}
|
|
308085
|
+
if (isHtmlFile) {
|
|
308086
|
+
if (isEnabled && (0, api_1.isNgLanguageService)(languageService)) {
|
|
308087
|
+
const templateSymbols2 = languageService.getTemplateDocumentSymbols(scriptInfo.fileName, {
|
|
308088
|
+
showImplicitForVariables: (_a3 = config === null || config === void 0 ? void 0 : config.showImplicitForVariables) !== null && _a3 !== void 0 ? _a3 : false
|
|
308089
|
+
});
|
|
308090
|
+
if (templateSymbols2.length > 0) {
|
|
308091
|
+
return convertTemplateSymbols(templateSymbols2, scriptInfo);
|
|
308092
|
+
}
|
|
308093
|
+
}
|
|
308094
|
+
return null;
|
|
308095
|
+
}
|
|
308096
|
+
let templateSymbols = [];
|
|
308097
|
+
if ((0, api_1.isNgLanguageService)(languageService)) {
|
|
308098
|
+
templateSymbols = languageService.getTemplateDocumentSymbols(scriptInfo.fileName, {
|
|
308099
|
+
showImplicitForVariables: (_b = config === null || config === void 0 ? void 0 : config.showImplicitForVariables) !== null && _b !== void 0 ? _b : false
|
|
308100
|
+
});
|
|
308101
|
+
}
|
|
308102
|
+
const navigationTree = languageService.getNavigationTree(scriptInfo.fileName);
|
|
308103
|
+
if (!navigationTree) {
|
|
308104
|
+
return null;
|
|
308105
|
+
}
|
|
308106
|
+
const classNamesWithTemplates = /* @__PURE__ */ new Set();
|
|
308107
|
+
for (const symbol of templateSymbols) {
|
|
308108
|
+
if (symbol.className) {
|
|
308109
|
+
classNamesWithTemplates.add(symbol.className);
|
|
308110
|
+
}
|
|
308111
|
+
}
|
|
308112
|
+
const tsSymbols = filterNavigationTreeToTemplateClasses(navigationTree, scriptInfo, classNamesWithTemplates);
|
|
308113
|
+
if (templateSymbols.length > 0) {
|
|
308114
|
+
mergeTemplateSymbolsIntoClass(tsSymbols, templateSymbols, scriptInfo);
|
|
308115
|
+
}
|
|
308116
|
+
return tsSymbols;
|
|
308117
|
+
});
|
|
308118
|
+
}
|
|
308119
|
+
function mergeTemplateSymbolsIntoClass(tsSymbols, templateSymbols, scriptInfo) {
|
|
308120
|
+
var _a3;
|
|
308121
|
+
if (templateSymbols.length === 0) {
|
|
308122
|
+
return;
|
|
308123
|
+
}
|
|
308124
|
+
const symbolsByClass = /* @__PURE__ */ new Map();
|
|
308125
|
+
const symbolsWithoutClass = [];
|
|
308126
|
+
for (const symbol of templateSymbols) {
|
|
308127
|
+
if (symbol.className) {
|
|
308128
|
+
const existing = (_a3 = symbolsByClass.get(symbol.className)) !== null && _a3 !== void 0 ? _a3 : [];
|
|
308129
|
+
existing.push(symbol);
|
|
308130
|
+
symbolsByClass.set(symbol.className, existing);
|
|
308131
|
+
} else {
|
|
308132
|
+
symbolsWithoutClass.push(symbol);
|
|
308133
|
+
}
|
|
308134
|
+
}
|
|
308135
|
+
for (const tsSymbol of tsSymbols) {
|
|
308136
|
+
if (tsSymbol.kind === lsp.SymbolKind.Class) {
|
|
308137
|
+
const classTemplateSymbols = symbolsByClass.get(tsSymbol.name);
|
|
308138
|
+
if (classTemplateSymbols && classTemplateSymbols.length > 0) {
|
|
308139
|
+
const converted = convertTemplateSymbols(classTemplateSymbols, scriptInfo);
|
|
308140
|
+
addTemplateSymbolsToClass(tsSymbol, converted);
|
|
308141
|
+
symbolsByClass.delete(tsSymbol.name);
|
|
308142
|
+
}
|
|
308143
|
+
}
|
|
308144
|
+
}
|
|
308145
|
+
if (symbolsWithoutClass.length > 0) {
|
|
308146
|
+
const converted = convertTemplateSymbols(symbolsWithoutClass, scriptInfo);
|
|
308147
|
+
for (const tsSymbol of tsSymbols) {
|
|
308148
|
+
if (tsSymbol.kind === lsp.SymbolKind.Class) {
|
|
308149
|
+
addTemplateSymbolsToClass(tsSymbol, converted);
|
|
308150
|
+
break;
|
|
308151
|
+
}
|
|
308152
|
+
}
|
|
308153
|
+
}
|
|
308154
|
+
}
|
|
308155
|
+
function addTemplateSymbolsToClass(classSymbol, templateSymbols) {
|
|
308156
|
+
if (!classSymbol.children) {
|
|
308157
|
+
classSymbol.children = [];
|
|
308158
|
+
}
|
|
308159
|
+
const templateContainer = {
|
|
308160
|
+
name: "(template)",
|
|
308161
|
+
kind: lsp.SymbolKind.Namespace,
|
|
308162
|
+
range: templateSymbols[0].range,
|
|
308163
|
+
selectionRange: templateSymbols[0].selectionRange,
|
|
308164
|
+
children: templateSymbols
|
|
308165
|
+
};
|
|
308166
|
+
classSymbol.children.push(templateContainer);
|
|
308167
|
+
}
|
|
308168
|
+
function filterNavigationTreeToTemplateClasses(tree, scriptInfo, classNamesWithTemplates) {
|
|
308169
|
+
const result = [];
|
|
308170
|
+
if (classNamesWithTemplates.size === 0) {
|
|
308171
|
+
return result;
|
|
308172
|
+
}
|
|
308173
|
+
if (tree.kind === ts.ScriptElementKind.moduleElement && tree.childItems) {
|
|
308174
|
+
for (const child of tree.childItems) {
|
|
308175
|
+
const filtered = filterNavigationItem(child, scriptInfo, classNamesWithTemplates);
|
|
308176
|
+
if (filtered) {
|
|
308177
|
+
result.push(filtered);
|
|
308178
|
+
}
|
|
308179
|
+
}
|
|
308180
|
+
} else {
|
|
308181
|
+
const filtered = filterNavigationItem(tree, scriptInfo, classNamesWithTemplates);
|
|
308182
|
+
if (filtered) {
|
|
308183
|
+
result.push(filtered);
|
|
308184
|
+
}
|
|
308185
|
+
}
|
|
308186
|
+
return result;
|
|
308187
|
+
}
|
|
308188
|
+
function filterNavigationItem(item, scriptInfo, classNamesWithTemplates) {
|
|
308189
|
+
if ((item.kind === ts.ScriptElementKind.classElement || item.kind === ts.ScriptElementKind.localClassElement) && item.text && classNamesWithTemplates.has(item.text)) {
|
|
308190
|
+
const spans = item.spans;
|
|
308191
|
+
if (!spans || spans.length === 0) {
|
|
308192
|
+
return null;
|
|
308193
|
+
}
|
|
308194
|
+
const range = (0, utils_1.tsTextSpanToLspRange)(scriptInfo, spans[0]);
|
|
308195
|
+
const selectionRange = item.nameSpan !== void 0 ? (0, utils_1.tsTextSpanToLspRange)(scriptInfo, item.nameSpan) : range;
|
|
308196
|
+
return {
|
|
308197
|
+
name: item.text,
|
|
308198
|
+
kind: lsp.SymbolKind.Class,
|
|
308199
|
+
range,
|
|
308200
|
+
selectionRange
|
|
308201
|
+
// No children - template symbols will be added later
|
|
308202
|
+
};
|
|
308203
|
+
}
|
|
308204
|
+
if (item.kind === ts.ScriptElementKind.moduleElement || item.kind === ts.ScriptElementKind.directory) {
|
|
308205
|
+
if (item.childItems && item.childItems.length > 0) {
|
|
308206
|
+
const filteredChildren = [];
|
|
308207
|
+
for (const child of item.childItems) {
|
|
308208
|
+
const filtered = filterNavigationItem(child, scriptInfo, classNamesWithTemplates);
|
|
308209
|
+
if (filtered) {
|
|
308210
|
+
filteredChildren.push(filtered);
|
|
308211
|
+
}
|
|
308212
|
+
}
|
|
308213
|
+
if (filteredChildren.length > 0) {
|
|
308214
|
+
const spans = item.spans;
|
|
308215
|
+
if (!spans || spans.length === 0) {
|
|
308216
|
+
const childRange = filteredChildren[0].range;
|
|
308217
|
+
return {
|
|
308218
|
+
name: item.text || "",
|
|
308219
|
+
kind: scriptElementKindToSymbolKind(item.kind),
|
|
308220
|
+
range: childRange,
|
|
308221
|
+
selectionRange: childRange,
|
|
308222
|
+
children: filteredChildren
|
|
308223
|
+
};
|
|
308224
|
+
}
|
|
308225
|
+
const range = (0, utils_1.tsTextSpanToLspRange)(scriptInfo, spans[0]);
|
|
308226
|
+
const selectionRange = item.nameSpan !== void 0 ? (0, utils_1.tsTextSpanToLspRange)(scriptInfo, item.nameSpan) : range;
|
|
308227
|
+
return {
|
|
308228
|
+
name: item.text || "",
|
|
308229
|
+
kind: scriptElementKindToSymbolKind(item.kind),
|
|
308230
|
+
range,
|
|
308231
|
+
selectionRange,
|
|
308232
|
+
children: filteredChildren
|
|
308233
|
+
};
|
|
308234
|
+
}
|
|
308235
|
+
}
|
|
308236
|
+
}
|
|
308237
|
+
return null;
|
|
308238
|
+
}
|
|
308239
|
+
function scriptElementKindToSymbolKind(kind) {
|
|
308240
|
+
switch (kind) {
|
|
308241
|
+
case ts.ScriptElementKind.moduleElement:
|
|
308242
|
+
return lsp.SymbolKind.Module;
|
|
308243
|
+
case ts.ScriptElementKind.classElement:
|
|
308244
|
+
return lsp.SymbolKind.Class;
|
|
308245
|
+
case ts.ScriptElementKind.localClassElement:
|
|
308246
|
+
return lsp.SymbolKind.Class;
|
|
308247
|
+
case ts.ScriptElementKind.interfaceElement:
|
|
308248
|
+
return lsp.SymbolKind.Interface;
|
|
308249
|
+
case ts.ScriptElementKind.typeElement:
|
|
308250
|
+
return lsp.SymbolKind.TypeParameter;
|
|
308251
|
+
case ts.ScriptElementKind.enumElement:
|
|
308252
|
+
return lsp.SymbolKind.Enum;
|
|
308253
|
+
case ts.ScriptElementKind.enumMemberElement:
|
|
308254
|
+
return lsp.SymbolKind.EnumMember;
|
|
308255
|
+
case ts.ScriptElementKind.variableElement:
|
|
308256
|
+
return lsp.SymbolKind.Variable;
|
|
308257
|
+
case ts.ScriptElementKind.localVariableElement:
|
|
308258
|
+
return lsp.SymbolKind.Variable;
|
|
308259
|
+
case ts.ScriptElementKind.functionElement:
|
|
308260
|
+
return lsp.SymbolKind.Function;
|
|
308261
|
+
case ts.ScriptElementKind.localFunctionElement:
|
|
308262
|
+
return lsp.SymbolKind.Function;
|
|
308263
|
+
case ts.ScriptElementKind.memberFunctionElement:
|
|
308264
|
+
return lsp.SymbolKind.Method;
|
|
308265
|
+
case ts.ScriptElementKind.memberGetAccessorElement:
|
|
308266
|
+
return lsp.SymbolKind.Property;
|
|
308267
|
+
case ts.ScriptElementKind.memberSetAccessorElement:
|
|
308268
|
+
return lsp.SymbolKind.Property;
|
|
308269
|
+
case ts.ScriptElementKind.memberVariableElement:
|
|
308270
|
+
return lsp.SymbolKind.Field;
|
|
308271
|
+
case ts.ScriptElementKind.constructorImplementationElement:
|
|
308272
|
+
return lsp.SymbolKind.Constructor;
|
|
308273
|
+
case ts.ScriptElementKind.callSignatureElement:
|
|
308274
|
+
return lsp.SymbolKind.Function;
|
|
308275
|
+
case ts.ScriptElementKind.indexSignatureElement:
|
|
308276
|
+
return lsp.SymbolKind.Key;
|
|
308277
|
+
case ts.ScriptElementKind.constructSignatureElement:
|
|
308278
|
+
return lsp.SymbolKind.Constructor;
|
|
308279
|
+
case ts.ScriptElementKind.parameterElement:
|
|
308280
|
+
return lsp.SymbolKind.Variable;
|
|
308281
|
+
case ts.ScriptElementKind.typeParameterElement:
|
|
308282
|
+
return lsp.SymbolKind.TypeParameter;
|
|
308283
|
+
case ts.ScriptElementKind.constElement:
|
|
308284
|
+
return lsp.SymbolKind.Constant;
|
|
308285
|
+
case ts.ScriptElementKind.letElement:
|
|
308286
|
+
return lsp.SymbolKind.Variable;
|
|
308287
|
+
case ts.ScriptElementKind.alias:
|
|
308288
|
+
return lsp.SymbolKind.Variable;
|
|
308289
|
+
default:
|
|
308290
|
+
return lsp.SymbolKind.Variable;
|
|
308291
|
+
}
|
|
308292
|
+
}
|
|
308293
|
+
function convertTemplateSymbols(symbols, scriptInfo) {
|
|
308294
|
+
const result = [];
|
|
308295
|
+
for (const symbol of symbols) {
|
|
308296
|
+
const converted = convertTemplateSymbol(symbol, scriptInfo);
|
|
308297
|
+
if (converted) {
|
|
308298
|
+
result.push(converted);
|
|
308299
|
+
}
|
|
308300
|
+
}
|
|
308301
|
+
return result;
|
|
308302
|
+
}
|
|
308303
|
+
function convertTemplateSymbol(symbol, scriptInfo) {
|
|
308304
|
+
if (!symbol.spans || symbol.spans.length === 0) {
|
|
308305
|
+
return null;
|
|
308306
|
+
}
|
|
308307
|
+
const range = (0, utils_1.tsTextSpanToLspRange)(scriptInfo, symbol.spans[0]);
|
|
308308
|
+
const selectionRange = symbol.nameSpan ? (0, utils_1.tsTextSpanToLspRange)(scriptInfo, symbol.nameSpan) : range;
|
|
308309
|
+
const children = [];
|
|
308310
|
+
if (symbol.childItems) {
|
|
308311
|
+
for (const child of symbol.childItems) {
|
|
308312
|
+
const childSymbol = convertTemplateSymbol(child, scriptInfo);
|
|
308313
|
+
if (childSymbol) {
|
|
308314
|
+
children.push(childSymbol);
|
|
308315
|
+
}
|
|
308316
|
+
}
|
|
308317
|
+
}
|
|
308318
|
+
const kind = symbol.lspKind !== void 0 ? symbol.lspKind : scriptElementKindToSymbolKind(symbol.kind);
|
|
308319
|
+
return {
|
|
308320
|
+
name: symbol.text,
|
|
308321
|
+
kind,
|
|
308322
|
+
range,
|
|
308323
|
+
selectionRange,
|
|
308324
|
+
children: children.length > 0 ? children : void 0
|
|
308325
|
+
};
|
|
308326
|
+
}
|
|
308327
|
+
}
|
|
308328
|
+
});
|
|
308329
|
+
|
|
307943
308330
|
// vscode-ng-language-service/server/src/handlers/rename.js
|
|
307944
308331
|
var require_rename = __commonJS({
|
|
307945
308332
|
"vscode-ng-language-service/server/src/handlers/rename.js"(exports2) {
|
|
@@ -308109,63 +308496,6 @@ var require_did_change_watched_files = __commonJS({
|
|
|
308109
308496
|
}
|
|
308110
308497
|
});
|
|
308111
308498
|
|
|
308112
|
-
// vscode-ng-language-service/server/src/config.js
|
|
308113
|
-
var require_config = __commonJS({
|
|
308114
|
-
"vscode-ng-language-service/server/src/config.js"(exports2) {
|
|
308115
|
-
"use strict";
|
|
308116
|
-
Object.defineProperty(exports2, "__esModule", { value: true });
|
|
308117
|
-
exports2.getWorkspaceConfiguration = getWorkspaceConfiguration;
|
|
308118
|
-
exports2.getWorkspaceConfigurationCached = getWorkspaceConfigurationCached;
|
|
308119
|
-
exports2.clearWorkspaceConfigurationCache = clearWorkspaceConfigurationCache;
|
|
308120
|
-
exports2.flattenConfiguration = flattenConfiguration;
|
|
308121
|
-
var workspaceConfigCache = /* @__PURE__ */ new WeakMap();
|
|
308122
|
-
function getWorkspaceConfiguration(connection, items) {
|
|
308123
|
-
return __async(this, null, function* () {
|
|
308124
|
-
try {
|
|
308125
|
-
return yield connection.workspace.getConfiguration(items);
|
|
308126
|
-
} catch (error) {
|
|
308127
|
-
return items.map(() => ({}));
|
|
308128
|
-
}
|
|
308129
|
-
});
|
|
308130
|
-
}
|
|
308131
|
-
function getWorkspaceConfigurationCached(connection, items) {
|
|
308132
|
-
return __async(this, null, function* () {
|
|
308133
|
-
const key = JSON.stringify(items);
|
|
308134
|
-
let cache = workspaceConfigCache.get(connection);
|
|
308135
|
-
if (!cache) {
|
|
308136
|
-
cache = /* @__PURE__ */ new Map();
|
|
308137
|
-
workspaceConfigCache.set(connection, cache);
|
|
308138
|
-
}
|
|
308139
|
-
const cached = cache.get(key);
|
|
308140
|
-
if (cached !== void 0) {
|
|
308141
|
-
return cached;
|
|
308142
|
-
}
|
|
308143
|
-
const value = yield getWorkspaceConfiguration(connection, items);
|
|
308144
|
-
cache.set(key, value);
|
|
308145
|
-
return value;
|
|
308146
|
-
});
|
|
308147
|
-
}
|
|
308148
|
-
function clearWorkspaceConfigurationCache(connection) {
|
|
308149
|
-
workspaceConfigCache.delete(connection);
|
|
308150
|
-
}
|
|
308151
|
-
function flattenConfiguration(config, prefix) {
|
|
308152
|
-
const result = {};
|
|
308153
|
-
function flatten(obj, currentPrefix) {
|
|
308154
|
-
for (const [key, value] of Object.entries(obj)) {
|
|
308155
|
-
const newKey = `${currentPrefix}.${key}`;
|
|
308156
|
-
if (value !== null && typeof value === "object" && !Array.isArray(value)) {
|
|
308157
|
-
flatten(value, newKey);
|
|
308158
|
-
} else {
|
|
308159
|
-
result[newKey] = value;
|
|
308160
|
-
}
|
|
308161
|
-
}
|
|
308162
|
-
}
|
|
308163
|
-
flatten(config, prefix);
|
|
308164
|
-
return result;
|
|
308165
|
-
}
|
|
308166
|
-
}
|
|
308167
|
-
});
|
|
308168
|
-
|
|
308169
308499
|
// vscode-ng-language-service/server/src/handlers/inlay_hints.js
|
|
308170
308500
|
var require_inlay_hints = __commonJS({
|
|
308171
308501
|
"vscode-ng-language-service/server/src/handlers/inlay_hints.js"(exports2) {
|
|
@@ -308473,6 +308803,7 @@ var require_session = __commonJS({
|
|
|
308473
308803
|
var lsp = __importStar(require_node3());
|
|
308474
308804
|
var notifications_1 = require_notifications();
|
|
308475
308805
|
var requests_1 = require_requests();
|
|
308806
|
+
var config_1 = require_config();
|
|
308476
308807
|
var diagnostic_1 = require_diagnostic2();
|
|
308477
308808
|
var utils_1 = require_utils();
|
|
308478
308809
|
var code_actions_1 = require_code_actions();
|
|
@@ -308483,13 +308814,13 @@ var require_session = __commonJS({
|
|
|
308483
308814
|
var hover_1 = require_hover();
|
|
308484
308815
|
var initialization_1 = require_initialization();
|
|
308485
308816
|
var linked_editing_range_1 = require_linked_editing_range();
|
|
308817
|
+
var document_symbols_1 = require_document_symbols();
|
|
308486
308818
|
var rename_1 = require_rename();
|
|
308487
308819
|
var signature_1 = require_signature();
|
|
308488
308820
|
var tcb_1 = require_tcb();
|
|
308489
308821
|
var template_info_1 = require_template_info();
|
|
308490
308822
|
var did_change_watched_files_1 = require_did_change_watched_files();
|
|
308491
308823
|
var inlay_hints_1 = require_inlay_hints();
|
|
308492
|
-
var config_1 = require_config();
|
|
308493
308824
|
var LanguageId;
|
|
308494
308825
|
(function(LanguageId2) {
|
|
308495
308826
|
LanguageId2["TS"] = "typescript";
|
|
@@ -308632,6 +308963,9 @@ var require_session = __commonJS({
|
|
|
308632
308963
|
conn.onHover((p) => (0, hover_1.onHover)(this, p));
|
|
308633
308964
|
conn.onFoldingRanges((p) => (0, folding_1.onFoldingRanges)(this, p));
|
|
308634
308965
|
conn.languages.onLinkedEditingRange((p) => (0, linked_editing_range_1.onLinkedEditingRange)(this, p));
|
|
308966
|
+
conn.onDocumentSymbol((p) => __async(this, null, function* () {
|
|
308967
|
+
return yield (0, document_symbols_1.onDocumentSymbol)(this, p);
|
|
308968
|
+
}));
|
|
308635
308969
|
conn.onCompletion((p) => (0, completions_1.onCompletion)(this, p));
|
|
308636
308970
|
conn.onCompletionResolve((p) => (0, completions_1.onCompletionResolve)(this, p));
|
|
308637
308971
|
conn.onRequest(requests_1.GetComponentsWithTemplateFile, (p) => (0, code_lens_1.getComponentsWithTemplateFile)(this, p));
|
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.5",
|
|
5
5
|
"repository": {
|
|
6
6
|
"type": "git",
|
|
7
7
|
"url": "https://github.com/angular/angular.git",
|
|
@@ -17,8 +17,8 @@
|
|
|
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.5",
|
|
21
|
+
"typescript": "6.0.2"
|
|
22
22
|
},
|
|
23
23
|
"devDependencies": {
|
|
24
24
|
"@types/node": "^24.5.2",
|