@angular/language-service 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/api.d.ts CHANGED
@@ -76,6 +76,57 @@ export interface ApplyRefactoringResult extends Omit<ts.RefactorEditInfo, 'notAp
76
76
  errorMessage?: string;
77
77
  warningMessage?: string;
78
78
  }
79
+ /**
80
+ * Angular-specific LSP SymbolKind values for template symbols.
81
+ * These are used for symbols that don't have a direct TypeScript ScriptElementKind mapping.
82
+ * Values match LSP SymbolKind enum: https://microsoft.github.io/language-server-protocol/specifications/lsp/3.17/specification/#symbolKind
83
+ */
84
+ export declare enum AngularSymbolKind {
85
+ Namespace = 3,
86
+ Class = 5,
87
+ Array = 18,
88
+ Object = 19,
89
+ Struct = 23,
90
+ Event = 24
91
+ }
92
+ /**
93
+ * A document symbol representing an Angular template element.
94
+ * This uses TypeScript's NavigationTree structure so it can be merged with TS symbols.
95
+ */
96
+ export interface TemplateDocumentSymbol {
97
+ /** Display name for the symbol */
98
+ text: string;
99
+ /** Kind of symbol (using TypeScript's ScriptElementKind for compatibility) */
100
+ kind: ts.ScriptElementKind;
101
+ /**
102
+ * Optional LSP SymbolKind override for Angular-specific symbol types.
103
+ * When set, this takes precedence over the default ScriptElementKind mapping.
104
+ */
105
+ lspKind?: AngularSymbolKind;
106
+ /** Span covering the entire symbol */
107
+ spans: ts.TextSpan[];
108
+ /** Span for just the name (used for selection) */
109
+ nameSpan?: ts.TextSpan;
110
+ /** Child symbols */
111
+ childItems?: TemplateDocumentSymbol[];
112
+ /**
113
+ * The name of the class this template belongs to.
114
+ * Only set for root-level symbols in TypeScript files with inline templates.
115
+ * Used to merge template symbols into the correct component class when
116
+ * multiple components exist in the same file.
117
+ */
118
+ className?: string;
119
+ }
120
+ /**
121
+ * Options for customizing document symbols behavior.
122
+ */
123
+ export interface DocumentSymbolsOptions {
124
+ /**
125
+ * Show all implicit @for loop variables ($index, $count, $first, $last, $even, $odd).
126
+ * When false (default), only explicitly aliased variables like `let i = $index` are shown.
127
+ */
128
+ showImplicitForVariables?: boolean;
129
+ }
79
130
  /**
80
131
  * Result for linked editing ranges containing the ranges and optional word pattern.
81
132
  */
@@ -324,6 +375,15 @@ export interface NgLanguageService extends ts.LanguageService {
324
375
  * @param config Optional configuration for which hints to show
325
376
  */
326
377
  getAngularInlayHints(fileName: string, span: ts.TextSpan, config?: InlayHintsConfig): AngularInlayHint[];
378
+ /**
379
+ * Gets document symbols for Angular templates, including control flow blocks,
380
+ * elements, components, template references, and @let declarations.
381
+ * Returns symbols in NavigationTree format for compatibility with TypeScript.
382
+ *
383
+ * @param fileName The file path to get template symbols for
384
+ * @param options Optional configuration for document symbols behavior
385
+ */
386
+ getTemplateDocumentSymbols(fileName: string, options?: DocumentSymbolsOptions): TemplateDocumentSymbol[];
327
387
  applyRefactoring(fileName: string, positionOrRange: number | ts.TextRange, refactorName: string, reportProgress: ApplyRefactoringProgressFn): Promise<ApplyRefactoringResult | undefined>;
328
388
  hasCodeFixesForErrorCode(errorCode: number): boolean;
329
389
  getTokenTypeFromClassification(classification: number): number | undefined;
package/api_bundle.js CHANGED
@@ -19,9 +19,19 @@ var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: tru
19
19
  // packages/language-service/api.ts
20
20
  var api_exports = {};
21
21
  __export(api_exports, {
22
+ AngularSymbolKind: () => AngularSymbolKind,
22
23
  isNgLanguageService: () => isNgLanguageService
23
24
  });
24
25
  module.exports = __toCommonJS(api_exports);
26
+ var AngularSymbolKind = /* @__PURE__ */ ((AngularSymbolKind2) => {
27
+ AngularSymbolKind2[AngularSymbolKind2["Namespace"] = 3] = "Namespace";
28
+ AngularSymbolKind2[AngularSymbolKind2["Class"] = 5] = "Class";
29
+ AngularSymbolKind2[AngularSymbolKind2["Array"] = 18] = "Array";
30
+ AngularSymbolKind2[AngularSymbolKind2["Object"] = 19] = "Object";
31
+ AngularSymbolKind2[AngularSymbolKind2["Struct"] = 23] = "Struct";
32
+ AngularSymbolKind2[AngularSymbolKind2["Event"] = 24] = "Event";
33
+ return AngularSymbolKind2;
34
+ })(AngularSymbolKind || {});
25
35
  function isNgLanguageService(ls) {
26
36
  return "getTcb" in ls;
27
37
  }
package/api_bundle.js.map CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "version": 3,
3
3
  "sources": ["api.ts"],
4
- "mappings": ";;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AA8aO,SAAS,oBACd,IACyB;AACzB,SAAO,YAAY;AACrB;",
5
- "names": []
4
+ "mappings": ";;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAgGO,IAAK,oBAAL,kBAAKA,uBAAL;AACL,EAAAA,sCAAA,eAAY,KAAZ;AACA,EAAAA,sCAAA,WAAQ,KAAR;AACA,EAAAA,sCAAA,WAAQ,MAAR;AACA,EAAAA,sCAAA,YAAS,MAAT;AACA,EAAAA,sCAAA,YAAS,MAAT;AACA,EAAAA,sCAAA,WAAQ,MAAR;AANU,SAAAA;AAAA,GAAA;AAiZL,SAAS,oBACd,IACyB;AACzB,SAAO,YAAY;AACrB;",
5
+ "names": ["AngularSymbolKind"]
6
6
  }