@angular/language-service 21.2.6 → 21.2.8
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/bundles/language-service.js +980 -740
- package/package.json +1 -1
- package/private_bundle.js +5 -6
- package/private_bundle.js.map +1 -1
- package/src/adapters.d.ts +68 -0
- package/src/attribute_completions.d.ts +195 -0
- package/src/codefixes/all_codefixes_metas.d.ts +9 -0
- package/src/codefixes/code_fixes.d.ts +30 -0
- package/src/codefixes/fix_invalid_banana_in_box.d.ts +12 -0
- package/src/codefixes/fix_missing_import.d.ts +12 -0
- package/src/codefixes/fix_missing_member.d.ts +13 -0
- package/src/codefixes/fix_missing_required_inputs.d.ts +12 -0
- package/src/codefixes/fix_unused_standalone_imports.d.ts +12 -0
- package/src/codefixes/index.d.ts +9 -0
- package/src/codefixes/utils.d.ts +67 -0
- package/src/compiler_factory.d.ts +29 -0
- package/src/completions.d.ts +113 -0
- package/src/definitions.d.ts +28 -0
- package/src/language_service.d.ts +107 -0
- package/src/linked_editing_range.d.ts +21 -0
- package/src/outlining_spans.d.ts +10 -0
- package/src/quick_info.d.ts +34 -0
- package/src/quick_info_built_ins.d.ts +13 -0
- package/src/refactorings/convert_to_signal_input/apply_input_refactoring.d.ts +13 -0
- package/src/refactorings/convert_to_signal_input/decorators.d.ts +11 -0
- package/src/refactorings/convert_to_signal_input/full_class_input_refactoring.d.ts +38 -0
- package/src/refactorings/convert_to_signal_input/individual_input_refactoring.d.ts +39 -0
- package/src/refactorings/convert_to_signal_queries/apply_query_refactoring.d.ts +13 -0
- package/src/refactorings/convert_to_signal_queries/decorators.d.ts +11 -0
- package/src/refactorings/convert_to_signal_queries/full_class_query_refactoring.d.ts +38 -0
- package/src/refactorings/convert_to_signal_queries/individual_query_refactoring.d.ts +39 -0
- package/src/refactorings/refactoring.d.ts +45 -0
- package/src/references_and_rename.d.ts +28 -0
- package/src/references_and_rename_utils.d.ts +72 -0
- package/src/semantic_tokens.d.ts +48 -0
- package/src/signature_help.d.ts +13 -0
- package/src/template_target.d.ts +178 -0
- package/src/ts_plugin.d.ts +14 -0
- package/src/utils/decorators.d.ts +10 -0
- package/src/utils/display_parts.d.ts +62 -0
- package/src/utils/format.d.ts +17 -0
- package/src/utils/index.d.ts +89 -0
- package/src/utils/ts_utils.d.ts +146 -0
package/package.json
CHANGED
package/private_bundle.js
CHANGED
|
@@ -86,6 +86,9 @@ var import_typescript3 = __toESM(require("typescript"));
|
|
|
86
86
|
// packages/language-service/src/utils/format.js
|
|
87
87
|
var import_typescript2 = __toESM(require("typescript"));
|
|
88
88
|
|
|
89
|
+
// packages/language-service/src/utils/ts_utils.js
|
|
90
|
+
var import_imports = require("@angular/compiler-cli/src/ngtsc/imports");
|
|
91
|
+
|
|
89
92
|
// packages/language-service/src/utils/index.js
|
|
90
93
|
function isTemplateNodeWithKeyAndValue(node) {
|
|
91
94
|
return isTemplateNode(node) && node.hasOwnProperty("keySpan");
|
|
@@ -230,16 +233,12 @@ function findFirstMatchingNodeForSourceSpan(tcb, sourceSpan) {
|
|
|
230
233
|
filter: (node) => true
|
|
231
234
|
});
|
|
232
235
|
}
|
|
233
|
-
function getTcbNodesOfTemplateAtPosition(
|
|
236
|
+
function getTcbNodesOfTemplateAtPosition(templateNodes, position, tcb) {
|
|
234
237
|
var _a;
|
|
235
|
-
const target = getTargetAtPosition(
|
|
238
|
+
const target = getTargetAtPosition(templateNodes, position);
|
|
236
239
|
if (target === null) {
|
|
237
240
|
return null;
|
|
238
241
|
}
|
|
239
|
-
const tcb = compiler.getTemplateTypeChecker().getTypeCheckBlock(typeCheckInfo.declaration);
|
|
240
|
-
if (tcb === null) {
|
|
241
|
-
return null;
|
|
242
|
-
}
|
|
243
242
|
const tcbNodes = [];
|
|
244
243
|
if (target.context.kind === TargetNodeKind.RawExpression) {
|
|
245
244
|
const targetNode = target.context.node;
|
package/private_bundle.js.map
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"version": 3,
|
|
3
3
|
"sources": ["private.ts", "src/template_target.ts", "src/utils/index.ts", "src/utils/display_parts.ts", "src/utils/ts_utils.ts", "src/utils/format.ts"],
|
|
4
|
-
"mappings": ";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;;;ACQA,IAAAA,mBA8CO;AAEP,sBAAoC;AACpC,IAAAC,qBAAgB;;;AClDhB,sBAkBO;AAEP,yBAIO;AACP,sBAAiC;AAGjC,IAAAC,qBAAe;;;AC3Bf,wBAAsC;AACtC,
|
|
4
|
+
"mappings": ";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;;;ACQA,IAAAA,mBA8CO;AAEP,sBAAoC;AACpC,IAAAC,qBAAgB;;;AClDhB,sBAkBO;AAEP,yBAIO;AACP,sBAAiC;AAGjC,IAAAC,qBAAe;;;AC3Bf,wBAAsC;AACtC,iBASO;AACP,wBAAe;AAGR,IAAM,aAAa,kBAAAC,QAAG,sBAAsB,kBAAAA,QAAG,sBAAsB,SAAS;AAC9E,IAAM,mBAAmB,kBAAAA,QAAG,sBAAsB,kBAAAA,QAAG,sBAAsB,aAAa;AACxF,IAAM,cAAc,kBAAAA,QAAG,sBAAsB,kBAAAA,QAAG,sBAAsB,WAAW;AACjF,IAAM,eAAe,kBAAAA,QAAG,sBAAsB,kBAAAA,QAAG,sBAAsB,KAAK;AAC5E,IAAM,cAAc,kBAAAA,QAAG,sBAAsB,kBAAAA,QAAG,sBAAsB,IAAI;AAKjF,IAAY;CAAZ,SAAYC,kBAAe;AACzB,EAAAA,iBAAA,WAAA,IAAA;AACA,EAAAA,iBAAA,OAAA,IAAA;AACA,EAAAA,iBAAA,SAAA,IAAA;AACA,EAAAA,iBAAA,WAAA,IAAA;AACA,EAAAA,iBAAA,WAAA,IAAA;AACA,EAAAA,iBAAA,OAAA,IAAA;AACA,EAAAA,iB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AU,uBAAuB,IAAI,CAAC;EACxD;AAKA,SACG,KAAK,SAAS,SAAS,KACtB,KAAK,SAAS,KAAK,CAAC,YAAY,SAAS,UAAU,QAAQ,UAAU,CAAC,KACvE,KAAK,UAAU,SAAS,KACvB,KAAK,UAAU,KAAK,CAAC,aAAa,SAAS,UAAU,SAAS,UAAU,CAAC;AAE/E;AAGA,SAAS,gBAAgB,UAAkB,MAAuC;AAEhF,QAAM,OAAO,gBAAgB,oCAAmB,KAAK,WAAW,KAAK;AACrE,QAAM,YACJ,KAAK,WAAW,MAAM,SAAS,IAAuC,KAAK;AAC7E,SAAO,WAAW;AACpB;",
|
|
5
5
|
"names": ["import_compiler", "import_typescript", "import_typescript", "ts", "DisplayInfoKind", "import_api", "import_typescript", "import_typescript", "isWithinKeyValue", "TargetNodeKind", "tss"]
|
|
6
6
|
}
|
|
@@ -0,0 +1,68 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @license
|
|
3
|
+
* Copyright Google LLC All Rights Reserved.
|
|
4
|
+
*
|
|
5
|
+
* Use of this source code is governed by an MIT-style license that can be
|
|
6
|
+
* found in the LICENSE file at https://angular.dev/license
|
|
7
|
+
*/
|
|
8
|
+
/** @fileoverview provides adapters for communicating with the ng compiler */
|
|
9
|
+
import { ConfigurationHost } from '@angular/compiler-cli';
|
|
10
|
+
import { NgCompilerAdapter } from '@angular/compiler-cli/src/ngtsc/core/api';
|
|
11
|
+
import { AbsoluteFsPath, FileStats, PathSegment, PathString } from '@angular/compiler-cli/src/ngtsc/file_system';
|
|
12
|
+
import ts from 'typescript';
|
|
13
|
+
export declare class LanguageServiceAdapter implements NgCompilerAdapter {
|
|
14
|
+
private readonly project;
|
|
15
|
+
readonly entryPoint: null;
|
|
16
|
+
readonly constructionDiagnostics: ts.Diagnostic[];
|
|
17
|
+
readonly ignoreForEmit: Set<ts.SourceFile>;
|
|
18
|
+
readonly unifiedModulesHost: null;
|
|
19
|
+
readonly rootDirs: AbsoluteFsPath[];
|
|
20
|
+
/**
|
|
21
|
+
* Map of resource filenames to the version of the file last read via `readResource`.
|
|
22
|
+
*
|
|
23
|
+
* Used to implement `getModifiedResourceFiles`.
|
|
24
|
+
*/
|
|
25
|
+
private readonly lastReadResourceVersion;
|
|
26
|
+
constructor(project: ts.server.Project);
|
|
27
|
+
getSourceFile(fileName: string, languageVersion: ts.ScriptTarget, onError?: (message: string) => void, shouldCreateNewSourceFile?: boolean): ts.SourceFile | undefined;
|
|
28
|
+
resourceNameToFileName(url: string, fromFile: string, fallbackResolve?: (url: string, fromFile: string) => string | null): string | null;
|
|
29
|
+
isShim(sf: ts.SourceFile): boolean;
|
|
30
|
+
isResource(sf: ts.SourceFile): boolean;
|
|
31
|
+
fileExists(fileName: string): boolean;
|
|
32
|
+
readFile(fileName: string): string | undefined;
|
|
33
|
+
getCurrentDirectory(): string;
|
|
34
|
+
getCanonicalFileName(fileName: string): string;
|
|
35
|
+
/**
|
|
36
|
+
* Return the real path of a symlink. This method is required in order to
|
|
37
|
+
* resolve symlinks in node_modules.
|
|
38
|
+
*/
|
|
39
|
+
realpath(path: string): string;
|
|
40
|
+
/**
|
|
41
|
+
* readResource() is an Angular-specific method for reading files that are not
|
|
42
|
+
* managed by the TS compiler host, namely templates and stylesheets.
|
|
43
|
+
* It is a method on ExtendedTsCompilerHost, see
|
|
44
|
+
* packages/compiler-cli/src/ngtsc/core/api/src/interfaces.ts
|
|
45
|
+
*/
|
|
46
|
+
readResource(fileName: string): string;
|
|
47
|
+
getModifiedResourceFiles(): Set<string> | undefined;
|
|
48
|
+
}
|
|
49
|
+
/**
|
|
50
|
+
* Used to read configuration files.
|
|
51
|
+
*
|
|
52
|
+
* A language service parse configuration host is independent of the adapter
|
|
53
|
+
* because signatures of calls like `FileSystem#readFile` are a bit stricter
|
|
54
|
+
* than those on the adapter.
|
|
55
|
+
*/
|
|
56
|
+
export declare class LSParseConfigHost implements ConfigurationHost {
|
|
57
|
+
private readonly serverHost;
|
|
58
|
+
constructor(serverHost: ts.server.ServerHost);
|
|
59
|
+
exists(path: AbsoluteFsPath): boolean;
|
|
60
|
+
readFile(path: AbsoluteFsPath): string;
|
|
61
|
+
lstat(path: AbsoluteFsPath): FileStats;
|
|
62
|
+
readdir(path: AbsoluteFsPath): PathSegment[];
|
|
63
|
+
pwd(): AbsoluteFsPath;
|
|
64
|
+
extname(path: AbsoluteFsPath | PathSegment): string;
|
|
65
|
+
resolve(...paths: string[]): AbsoluteFsPath;
|
|
66
|
+
dirname<T extends PathString>(file: T): T;
|
|
67
|
+
join<T extends PathString>(basePath: T, ...paths: string[]): T;
|
|
68
|
+
}
|
|
@@ -0,0 +1,195 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @license
|
|
3
|
+
* Copyright Google LLC All Rights Reserved.
|
|
4
|
+
*
|
|
5
|
+
* Use of this source code is governed by an MIT-style license that can be
|
|
6
|
+
* found in the LICENSE file at https://angular.dev/license
|
|
7
|
+
*/
|
|
8
|
+
import { TmplAstElement, TmplAstTemplate } from '@angular/compiler';
|
|
9
|
+
import { PotentialDirective, TemplateTypeChecker } from '@angular/compiler-cli/src/ngtsc/typecheck/api';
|
|
10
|
+
import ts from 'typescript';
|
|
11
|
+
import { DisplayInfoKind } from './utils/display_parts';
|
|
12
|
+
/**
|
|
13
|
+
* Differentiates different kinds of `AttributeCompletion`s.
|
|
14
|
+
*/
|
|
15
|
+
export declare enum AttributeCompletionKind {
|
|
16
|
+
/**
|
|
17
|
+
* Completion of an attribute from the HTML schema.
|
|
18
|
+
*
|
|
19
|
+
* Attributes often have a corresponding DOM property of the same name.
|
|
20
|
+
*/
|
|
21
|
+
DomAttribute = 0,
|
|
22
|
+
/**
|
|
23
|
+
* Completion of a property from the DOM schema.
|
|
24
|
+
*
|
|
25
|
+
* `DomProperty` completions are generated only for properties which don't share their name with
|
|
26
|
+
* an HTML attribute.
|
|
27
|
+
*/
|
|
28
|
+
DomProperty = 1,
|
|
29
|
+
/**
|
|
30
|
+
* Completion of an event from the DOM schema.
|
|
31
|
+
*/
|
|
32
|
+
DomEvent = 2,
|
|
33
|
+
/**
|
|
34
|
+
* Completion of an attribute that results in a new directive being matched on an element.
|
|
35
|
+
*/
|
|
36
|
+
DirectiveAttribute = 3,
|
|
37
|
+
/**
|
|
38
|
+
* Completion of an attribute that results in a new structural directive being matched on an
|
|
39
|
+
* element.
|
|
40
|
+
*/
|
|
41
|
+
StructuralDirectiveAttribute = 4,
|
|
42
|
+
/**
|
|
43
|
+
* Completion of an input from a directive which is either present on the element, or becomes
|
|
44
|
+
* present after the addition of this attribute.
|
|
45
|
+
*/
|
|
46
|
+
DirectiveInput = 5,
|
|
47
|
+
/**
|
|
48
|
+
* Completion of an output from a directive which is either present on the element, or becomes
|
|
49
|
+
* present after the addition of this attribute.
|
|
50
|
+
*/
|
|
51
|
+
DirectiveOutput = 6
|
|
52
|
+
}
|
|
53
|
+
/**
|
|
54
|
+
* Completion of an attribute from the DOM schema.
|
|
55
|
+
*/
|
|
56
|
+
export interface DomAttributeCompletion {
|
|
57
|
+
kind: AttributeCompletionKind.DomAttribute;
|
|
58
|
+
/**
|
|
59
|
+
* Name of the HTML attribute (not to be confused with the corresponding DOM property name).
|
|
60
|
+
*/
|
|
61
|
+
attribute: string;
|
|
62
|
+
/**
|
|
63
|
+
* Whether this attribute is also a DOM property. Note that this is required to be `true` because
|
|
64
|
+
* we only want to provide DOM attributes when there is an Angular syntax associated with them
|
|
65
|
+
* (`[propertyName]=""`).
|
|
66
|
+
*/
|
|
67
|
+
isAlsoProperty: true;
|
|
68
|
+
}
|
|
69
|
+
/**
|
|
70
|
+
* Completion of a DOM property of an element that's distinct from an HTML attribute.
|
|
71
|
+
*/
|
|
72
|
+
export interface DomPropertyCompletion {
|
|
73
|
+
kind: AttributeCompletionKind.DomProperty;
|
|
74
|
+
/**
|
|
75
|
+
* Name of the DOM property
|
|
76
|
+
*/
|
|
77
|
+
property: string;
|
|
78
|
+
}
|
|
79
|
+
export interface DomEventCompletion {
|
|
80
|
+
kind: AttributeCompletionKind.DomEvent;
|
|
81
|
+
/**
|
|
82
|
+
* Name of the DOM event
|
|
83
|
+
*/
|
|
84
|
+
eventName: string;
|
|
85
|
+
}
|
|
86
|
+
/**
|
|
87
|
+
* Completion of an attribute which results in a new directive being matched on an element.
|
|
88
|
+
*/
|
|
89
|
+
export interface DirectiveAttributeCompletion {
|
|
90
|
+
kind: AttributeCompletionKind.DirectiveAttribute | AttributeCompletionKind.StructuralDirectiveAttribute;
|
|
91
|
+
/**
|
|
92
|
+
* Name of the attribute whose addition causes this directive to match the element.
|
|
93
|
+
*/
|
|
94
|
+
attribute: string;
|
|
95
|
+
/**
|
|
96
|
+
* The directive whose selector gave rise to this completion.
|
|
97
|
+
*/
|
|
98
|
+
directive: PotentialDirective;
|
|
99
|
+
}
|
|
100
|
+
/**
|
|
101
|
+
* Completion of an input of a directive which may either be present on the element, or become
|
|
102
|
+
* present when a binding to this input is added.
|
|
103
|
+
*/
|
|
104
|
+
export interface DirectiveInputCompletion {
|
|
105
|
+
kind: AttributeCompletionKind.DirectiveInput;
|
|
106
|
+
/**
|
|
107
|
+
* The public property name of the input (the name which would be used in any binding to that
|
|
108
|
+
* input).
|
|
109
|
+
*/
|
|
110
|
+
propertyName: string;
|
|
111
|
+
/**
|
|
112
|
+
* The directive which has this input.
|
|
113
|
+
*/
|
|
114
|
+
directive: PotentialDirective;
|
|
115
|
+
/**
|
|
116
|
+
* The field name on the directive class which corresponds to this input.
|
|
117
|
+
*
|
|
118
|
+
* Currently, in the case where a single property name corresponds to multiple input fields, only
|
|
119
|
+
* the first such field is represented here. In the future multiple results may be warranted.
|
|
120
|
+
*/
|
|
121
|
+
classPropertyName: string;
|
|
122
|
+
/**
|
|
123
|
+
* Whether this input can be used with two-way binding (that is, whether a corresponding change
|
|
124
|
+
* output exists on the directive).
|
|
125
|
+
*/
|
|
126
|
+
twoWayBindingSupported: boolean;
|
|
127
|
+
}
|
|
128
|
+
export interface DirectiveOutputCompletion {
|
|
129
|
+
kind: AttributeCompletionKind.DirectiveOutput;
|
|
130
|
+
/**
|
|
131
|
+
* The public event name of the output (the name which would be used in any binding to that
|
|
132
|
+
* output).
|
|
133
|
+
*/
|
|
134
|
+
eventName: string;
|
|
135
|
+
/**
|
|
136
|
+
*The directive which has this output.
|
|
137
|
+
*/
|
|
138
|
+
directive: PotentialDirective;
|
|
139
|
+
/**
|
|
140
|
+
* The field name on the directive class which corresponds to this output.
|
|
141
|
+
*/
|
|
142
|
+
classPropertyName: string;
|
|
143
|
+
}
|
|
144
|
+
/**
|
|
145
|
+
* Any named attribute which is available for completion on a given element.
|
|
146
|
+
*
|
|
147
|
+
* Disambiguated by the `kind` property into various types of completions.
|
|
148
|
+
*/
|
|
149
|
+
export type AttributeCompletion = DomAttributeCompletion | DomPropertyCompletion | DirectiveAttributeCompletion | DirectiveInputCompletion | DirectiveOutputCompletion | DomEventCompletion;
|
|
150
|
+
/**
|
|
151
|
+
* Given an element and its context, produce a `Map` of all possible attribute completions.
|
|
152
|
+
*
|
|
153
|
+
* 3 kinds of attributes are considered for completion, from highest to lowest priority:
|
|
154
|
+
*
|
|
155
|
+
* 1. Inputs/outputs of directives present on the element already.
|
|
156
|
+
* 2. Inputs/outputs of directives that are not present on the element, but which would become
|
|
157
|
+
* present if such a binding is added.
|
|
158
|
+
* 3. Attributes from the DOM schema for the element.
|
|
159
|
+
*
|
|
160
|
+
* The priority of these options determines which completions are added to the `Map`. If a directive
|
|
161
|
+
* input shares the same name as a DOM attribute, the `Map` will reflect the directive input
|
|
162
|
+
* completion, not the DOM completion for that name.
|
|
163
|
+
*/
|
|
164
|
+
export declare function buildAttributeCompletionTable(component: ts.ClassDeclaration, element: TmplAstElement | TmplAstTemplate, checker: TemplateTypeChecker, ls: ts.LanguageService, includeExternalModule: boolean | undefined): Map<string, AttributeCompletion>;
|
|
165
|
+
/**
|
|
166
|
+
* Used to ensure Angular completions appear before DOM completions. Inputs and Outputs are
|
|
167
|
+
* prioritized first while attributes which would match an additional directive are prioritized
|
|
168
|
+
* second.
|
|
169
|
+
*
|
|
170
|
+
* This sort priority is based on the ASCII table. Other than `space`, the `!` is the first
|
|
171
|
+
* printable character in the ASCII ordering.
|
|
172
|
+
*/
|
|
173
|
+
export declare enum AsciiSortPriority {
|
|
174
|
+
First = "!",
|
|
175
|
+
Second = "\""
|
|
176
|
+
}
|
|
177
|
+
/**
|
|
178
|
+
* Given an `AttributeCompletion`, add any available completions to a `ts.CompletionEntry` array of
|
|
179
|
+
* results.
|
|
180
|
+
*
|
|
181
|
+
* The kind of completions generated depends on whether the current context is an attribute context
|
|
182
|
+
* or not. For example, completing on `<element attr|>` will generate two results: `attribute` and
|
|
183
|
+
* `[attribute]` - either a static attribute can be generated, or a property binding. However,
|
|
184
|
+
* `<element [attr|]>` is not an attribute context, and so only the property completion `attribute`
|
|
185
|
+
* is generated. Note that this completion does not have the `[]` property binding sugar as its
|
|
186
|
+
* implicitly present in a property binding context (we're already completing within an `[attr|]`
|
|
187
|
+
* expression).
|
|
188
|
+
*
|
|
189
|
+
* If the `insertSnippet` is `true`, the completion entries should includes the property or event
|
|
190
|
+
* binding sugar in some case. For Example `<div (my¦) />`, the `replacementSpan` is `(my)`, and the
|
|
191
|
+
* `insertText` is `(myOutput)="$0"`.
|
|
192
|
+
*/
|
|
193
|
+
export declare function addAttributeCompletionEntries(entries: ts.CompletionEntry[], completion: AttributeCompletion, isAttributeContext: boolean, isElementContext: boolean, replacementSpan: ts.TextSpan | undefined, insertSnippet: true | undefined): void;
|
|
194
|
+
export declare function getAttributeCompletionSymbol(attrKind: AttributeCompletionKind, directive: PotentialDirective | null, classPropertyName: string | null, checker: ts.TypeChecker, ls?: ts.LanguageService): ts.Symbol | null;
|
|
195
|
+
export declare function buildAnimationCompletionEntries(animations: string[], replacementSpan: ts.TextSpan, kind: DisplayInfoKind): ts.CompletionEntry[];
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @license
|
|
3
|
+
* Copyright Google LLC All Rights Reserved.
|
|
4
|
+
*
|
|
5
|
+
* Use of this source code is governed by an MIT-style license that can be
|
|
6
|
+
* found in the LICENSE file at https://angular.dev/license
|
|
7
|
+
*/
|
|
8
|
+
import { CodeActionMeta } from './utils';
|
|
9
|
+
export declare const ALL_CODE_FIXES_METAS: CodeActionMeta[];
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @license
|
|
3
|
+
* Copyright Google LLC All Rights Reserved.
|
|
4
|
+
*
|
|
5
|
+
* Use of this source code is governed by an MIT-style license that can be
|
|
6
|
+
* found in the LICENSE file at https://angular.dev/license
|
|
7
|
+
*/
|
|
8
|
+
import { NgCompiler } from '@angular/compiler-cli/src/ngtsc/core';
|
|
9
|
+
import type ts from 'typescript';
|
|
10
|
+
import { TypeCheckInfo } from '../utils';
|
|
11
|
+
import { CodeActionMeta } from './utils';
|
|
12
|
+
export declare class CodeFixes {
|
|
13
|
+
private readonly tsLS;
|
|
14
|
+
readonly codeActionMetas: CodeActionMeta[];
|
|
15
|
+
private errorCodeToFixes;
|
|
16
|
+
private fixIdToRegistration;
|
|
17
|
+
constructor(tsLS: ts.LanguageService, codeActionMetas: CodeActionMeta[]);
|
|
18
|
+
hasFixForCode(code: number): boolean;
|
|
19
|
+
/**
|
|
20
|
+
* When the user moves the cursor or hovers on a diagnostics, this function will be invoked by LS,
|
|
21
|
+
* and collect all the responses from the `codeActionMetas` which could handle the `errorCodes`.
|
|
22
|
+
*/
|
|
23
|
+
getCodeFixesAtPosition(fileName: string, typeCheckInfo: TypeCheckInfo | null, compiler: NgCompiler, start: number, end: number, errorCodes: readonly number[], diagnostics: ts.Diagnostic[], formatOptions: ts.FormatCodeSettings, preferences: ts.UserPreferences): readonly ts.CodeFixAction[];
|
|
24
|
+
/**
|
|
25
|
+
* When the user wants to fix the all same type of diagnostics in the `scope`, this function will
|
|
26
|
+
* be called and fix all diagnostics which will be filtered by the `errorCodes` from the
|
|
27
|
+
* `CodeActionMeta` that the `fixId` belongs to.
|
|
28
|
+
*/
|
|
29
|
+
getAllCodeActions(compiler: NgCompiler, diagnostics: ts.Diagnostic[], scope: ts.CombinedCodeFixScope, fixId: string, formatOptions: ts.FormatCodeSettings, preferences: ts.UserPreferences): ts.CombinedCodeActions;
|
|
30
|
+
}
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @license
|
|
3
|
+
* Copyright Google LLC All Rights Reserved.
|
|
4
|
+
*
|
|
5
|
+
* Use of this source code is governed by an MIT-style license that can be
|
|
6
|
+
* found in the LICENSE file at https://angular.dev/license
|
|
7
|
+
*/
|
|
8
|
+
import { CodeActionMeta } from './utils';
|
|
9
|
+
/**
|
|
10
|
+
* fix [invalid banana-in-box](https://angular.dev/extended-diagnostics/NG8101)
|
|
11
|
+
*/
|
|
12
|
+
export declare const fixInvalidBananaInBoxMeta: CodeActionMeta;
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @license
|
|
3
|
+
* Copyright Google LLC All Rights Reserved.
|
|
4
|
+
*
|
|
5
|
+
* Use of this source code is governed by an MIT-style license that can be
|
|
6
|
+
* found in the LICENSE file at https://angular.dev/license
|
|
7
|
+
*/
|
|
8
|
+
import { CodeActionMeta } from './utils';
|
|
9
|
+
/**
|
|
10
|
+
* This code action will generate a new import for an unknown selector.
|
|
11
|
+
*/
|
|
12
|
+
export declare const missingImportMeta: CodeActionMeta;
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @license
|
|
3
|
+
* Copyright Google LLC All Rights Reserved.
|
|
4
|
+
*
|
|
5
|
+
* Use of this source code is governed by an MIT-style license that can be
|
|
6
|
+
* found in the LICENSE file at https://angular.dev/license
|
|
7
|
+
*/
|
|
8
|
+
import { CodeActionMeta } from './utils';
|
|
9
|
+
/**
|
|
10
|
+
* This code action will fix the missing member of a type. For example, add the missing member to
|
|
11
|
+
* the type or try to get the spelling suggestion for the name from the type.
|
|
12
|
+
*/
|
|
13
|
+
export declare const missingMemberMeta: CodeActionMeta;
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @license
|
|
3
|
+
* Copyright Google LLC All Rights Reserved.
|
|
4
|
+
*
|
|
5
|
+
* Use of this source code is governed by an MIT-style license that can be
|
|
6
|
+
* found in the LICENSE file at https://angular.dev/license
|
|
7
|
+
*/
|
|
8
|
+
import { CodeActionMeta } from './utils';
|
|
9
|
+
/**
|
|
10
|
+
* This code action will fix the missing required input of an element.
|
|
11
|
+
*/
|
|
12
|
+
export declare const fixMissingRequiredInput: CodeActionMeta;
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @license
|
|
3
|
+
* Copyright Google LLC All Rights Reserved.
|
|
4
|
+
*
|
|
5
|
+
* Use of this source code is governed by an MIT-style license that can be
|
|
6
|
+
* found in the LICENSE file at https://angular.dev/license
|
|
7
|
+
*/
|
|
8
|
+
import { CodeActionMeta } from './utils';
|
|
9
|
+
/**
|
|
10
|
+
* Fix for [unused standalone imports](https://angular.dev/extended-diagnostics/NG8113)
|
|
11
|
+
*/
|
|
12
|
+
export declare const fixUnusedStandaloneImportsMeta: CodeActionMeta;
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @license
|
|
3
|
+
* Copyright Google LLC All Rights Reserved.
|
|
4
|
+
*
|
|
5
|
+
* Use of this source code is governed by an MIT-style license that can be
|
|
6
|
+
* found in the LICENSE file at https://angular.dev/license
|
|
7
|
+
*/
|
|
8
|
+
export { ALL_CODE_FIXES_METAS } from './all_codefixes_metas';
|
|
9
|
+
export { CodeFixes } from './code_fixes';
|
|
@@ -0,0 +1,67 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @license
|
|
3
|
+
* Copyright Google LLC All Rights Reserved.
|
|
4
|
+
*
|
|
5
|
+
* Use of this source code is governed by an MIT-style license that can be
|
|
6
|
+
* found in the LICENSE file at https://angular.dev/license
|
|
7
|
+
*/
|
|
8
|
+
import { NgCompiler } from '@angular/compiler-cli/src/ngtsc/core';
|
|
9
|
+
import type ts from 'typescript';
|
|
10
|
+
import { TypeCheckInfo } from '../utils';
|
|
11
|
+
/**
|
|
12
|
+
* This context is the info includes the `errorCode` at the given span the user selected in the
|
|
13
|
+
* editor and the `NgCompiler` could help to fix it.
|
|
14
|
+
*
|
|
15
|
+
* When the editor tries to provide a code fix for a diagnostic in a span of a template file, this
|
|
16
|
+
* context will be provided to the `CodeActionMeta` which could handle the `errorCode`.
|
|
17
|
+
*/
|
|
18
|
+
export interface CodeActionContext {
|
|
19
|
+
typeCheckInfo: TypeCheckInfo | null;
|
|
20
|
+
fileName: string;
|
|
21
|
+
compiler: NgCompiler;
|
|
22
|
+
start: number;
|
|
23
|
+
end: number;
|
|
24
|
+
errorCode: number;
|
|
25
|
+
formatOptions: ts.FormatCodeSettings;
|
|
26
|
+
preferences: ts.UserPreferences;
|
|
27
|
+
tsLs: ts.LanguageService;
|
|
28
|
+
}
|
|
29
|
+
/**
|
|
30
|
+
* This context is the info includes all diagnostics in the `scope` and the `NgCompiler` that could
|
|
31
|
+
* help to fix it.
|
|
32
|
+
*
|
|
33
|
+
* When the editor tries to fix the all same type of diagnostics selected by the user in the
|
|
34
|
+
* `scope`, this context will be provided to the `CodeActionMeta` which could handle the `fixId`.
|
|
35
|
+
*/
|
|
36
|
+
export interface CodeFixAllContext {
|
|
37
|
+
scope: ts.CombinedCodeFixScope;
|
|
38
|
+
compiler: NgCompiler;
|
|
39
|
+
fixId: string;
|
|
40
|
+
formatOptions: ts.FormatCodeSettings;
|
|
41
|
+
preferences: ts.UserPreferences;
|
|
42
|
+
tsLs: ts.LanguageService;
|
|
43
|
+
diagnostics: ts.Diagnostic[];
|
|
44
|
+
}
|
|
45
|
+
export interface CodeActionMeta {
|
|
46
|
+
errorCodes: Array<number>;
|
|
47
|
+
getCodeActions: (context: CodeActionContext) => readonly ts.CodeFixAction[];
|
|
48
|
+
fixIds: FixIdForCodeFixesAll[];
|
|
49
|
+
getAllCodeActions: (context: CodeFixAllContext) => ts.CombinedCodeActions;
|
|
50
|
+
}
|
|
51
|
+
/**
|
|
52
|
+
* Convert the span of `textChange` in the TCB to the span of the template.
|
|
53
|
+
*/
|
|
54
|
+
export declare function convertFileTextChangeInTcb(changes: readonly ts.FileTextChanges[], compiler: NgCompiler): ts.FileTextChanges[];
|
|
55
|
+
/**
|
|
56
|
+
* 'fix all' is only available when there are multiple diagnostics that the code action meta
|
|
57
|
+
* indicates it can fix.
|
|
58
|
+
*/
|
|
59
|
+
export declare function isFixAllAvailable(meta: CodeActionMeta, diagnostics: ts.Diagnostic[]): boolean;
|
|
60
|
+
export declare enum FixIdForCodeFixesAll {
|
|
61
|
+
FIX_SPELLING = "fixSpelling",
|
|
62
|
+
FIX_MISSING_MEMBER = "fixMissingMember",
|
|
63
|
+
FIX_INVALID_BANANA_IN_BOX = "fixInvalidBananaInBox",
|
|
64
|
+
FIX_MISSING_IMPORT = "fixMissingImport",
|
|
65
|
+
FIX_UNUSED_STANDALONE_IMPORTS = "fixUnusedStandaloneImports",
|
|
66
|
+
FIX_MISSING_REQUIRED_INPUTS = "fixMissingRequiredInputs"
|
|
67
|
+
}
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @license
|
|
3
|
+
* Copyright Google LLC All Rights Reserved.
|
|
4
|
+
*
|
|
5
|
+
* Use of this source code is governed by an MIT-style license that can be
|
|
6
|
+
* found in the LICENSE file at https://angular.dev/license
|
|
7
|
+
*/
|
|
8
|
+
import { NgCompiler } from '@angular/compiler-cli/src/ngtsc/core';
|
|
9
|
+
import { NgCompilerOptions } from '@angular/compiler-cli/src/ngtsc/core/api';
|
|
10
|
+
import { ProgramDriver } from '@angular/compiler-cli/src/ngtsc/program_driver';
|
|
11
|
+
import { LanguageServiceAdapter } from './adapters';
|
|
12
|
+
/**
|
|
13
|
+
* Manages the `NgCompiler` instance which backs the language service, updating or replacing it as
|
|
14
|
+
* needed to produce an up-to-date understanding of the current program.
|
|
15
|
+
*
|
|
16
|
+
* TODO(alxhub): currently the options used for the compiler are specified at `CompilerFactory`
|
|
17
|
+
* construction, and are not changeable. In a real project, users can update `tsconfig.json`. We
|
|
18
|
+
* need to properly handle a change in the compiler options, either by having an API to update the
|
|
19
|
+
* `CompilerFactory` to use new options, or by replacing it entirely.
|
|
20
|
+
*/
|
|
21
|
+
export declare class CompilerFactory {
|
|
22
|
+
private readonly adapter;
|
|
23
|
+
private readonly programStrategy;
|
|
24
|
+
private readonly options;
|
|
25
|
+
private readonly incrementalStrategy;
|
|
26
|
+
private compiler;
|
|
27
|
+
constructor(adapter: LanguageServiceAdapter, programStrategy: ProgramDriver, options: NgCompilerOptions);
|
|
28
|
+
getOrCreate(): NgCompiler;
|
|
29
|
+
}
|