@angular/language-service 12.0.0 → 12.0.4
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/ivy.js +157 -30
- package/bundles/language-service.js +62 -12
- package/package.json +2 -5
package/bundles/ivy.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
/**
|
|
2
|
-
* @license Angular v12.0.
|
|
2
|
+
* @license Angular v12.0.4
|
|
3
3
|
* Copyright Google LLC All Rights Reserved.
|
|
4
4
|
* License: MIT
|
|
5
5
|
*/
|
|
@@ -11503,11 +11503,12 @@ define(['exports', 'typescript/lib/tsserverlibrary', 'os', 'typescript', 'fs', '
|
|
|
11503
11503
|
(function (TokenType) {
|
|
11504
11504
|
TokenType[TokenType["Character"] = 0] = "Character";
|
|
11505
11505
|
TokenType[TokenType["Identifier"] = 1] = "Identifier";
|
|
11506
|
-
TokenType[TokenType["
|
|
11507
|
-
TokenType[TokenType["
|
|
11508
|
-
TokenType[TokenType["
|
|
11509
|
-
TokenType[TokenType["
|
|
11510
|
-
TokenType[TokenType["
|
|
11506
|
+
TokenType[TokenType["PrivateIdentifier"] = 2] = "PrivateIdentifier";
|
|
11507
|
+
TokenType[TokenType["Keyword"] = 3] = "Keyword";
|
|
11508
|
+
TokenType[TokenType["String"] = 4] = "String";
|
|
11509
|
+
TokenType[TokenType["Operator"] = 5] = "Operator";
|
|
11510
|
+
TokenType[TokenType["Number"] = 6] = "Number";
|
|
11511
|
+
TokenType[TokenType["Error"] = 7] = "Error";
|
|
11511
11512
|
})(TokenType$1 || (TokenType$1 = {}));
|
|
11512
11513
|
const KEYWORDS = ['var', 'let', 'as', 'null', 'undefined', 'true', 'false', 'if', 'else', 'this'];
|
|
11513
11514
|
class Lexer {
|
|
@@ -11545,6 +11546,9 @@ define(['exports', 'typescript/lib/tsserverlibrary', 'os', 'typescript', 'fs', '
|
|
|
11545
11546
|
isIdentifier() {
|
|
11546
11547
|
return this.type == TokenType$1.Identifier;
|
|
11547
11548
|
}
|
|
11549
|
+
isPrivateIdentifier() {
|
|
11550
|
+
return this.type == TokenType$1.PrivateIdentifier;
|
|
11551
|
+
}
|
|
11548
11552
|
isKeyword() {
|
|
11549
11553
|
return this.type == TokenType$1.Keyword;
|
|
11550
11554
|
}
|
|
@@ -11581,6 +11585,7 @@ define(['exports', 'typescript/lib/tsserverlibrary', 'os', 'typescript', 'fs', '
|
|
|
11581
11585
|
case TokenType$1.Identifier:
|
|
11582
11586
|
case TokenType$1.Keyword:
|
|
11583
11587
|
case TokenType$1.Operator:
|
|
11588
|
+
case TokenType$1.PrivateIdentifier:
|
|
11584
11589
|
case TokenType$1.String:
|
|
11585
11590
|
case TokenType$1.Error:
|
|
11586
11591
|
return this.strValue;
|
|
@@ -11597,6 +11602,9 @@ define(['exports', 'typescript/lib/tsserverlibrary', 'os', 'typescript', 'fs', '
|
|
|
11597
11602
|
function newIdentifierToken(index, end, text) {
|
|
11598
11603
|
return new Token$1(index, end, TokenType$1.Identifier, 0, text);
|
|
11599
11604
|
}
|
|
11605
|
+
function newPrivateIdentifierToken(index, end, text) {
|
|
11606
|
+
return new Token$1(index, end, TokenType$1.PrivateIdentifier, 0, text);
|
|
11607
|
+
}
|
|
11600
11608
|
function newKeywordToken(index, end, text) {
|
|
11601
11609
|
return new Token$1(index, end, TokenType$1.Keyword, 0, text);
|
|
11602
11610
|
}
|
|
@@ -11667,6 +11675,7 @@ define(['exports', 'typescript/lib/tsserverlibrary', 'os', 'typescript', 'fs', '
|
|
|
11667
11675
|
case $DQ:
|
|
11668
11676
|
return this.scanString();
|
|
11669
11677
|
case $HASH:
|
|
11678
|
+
return this.scanPrivateIdentifier();
|
|
11670
11679
|
case $PLUS:
|
|
11671
11680
|
case $MINUS:
|
|
11672
11681
|
case $STAR:
|
|
@@ -11734,6 +11743,18 @@ define(['exports', 'typescript/lib/tsserverlibrary', 'os', 'typescript', 'fs', '
|
|
|
11734
11743
|
return KEYWORDS.indexOf(str) > -1 ? newKeywordToken(start, this.index, str) :
|
|
11735
11744
|
newIdentifierToken(start, this.index, str);
|
|
11736
11745
|
}
|
|
11746
|
+
/** Scans an ECMAScript private identifier. */
|
|
11747
|
+
scanPrivateIdentifier() {
|
|
11748
|
+
const start = this.index;
|
|
11749
|
+
this.advance();
|
|
11750
|
+
if (!isIdentifierStart(this.peek)) {
|
|
11751
|
+
return this.error('Invalid character [#]', -1);
|
|
11752
|
+
}
|
|
11753
|
+
while (isIdentifierPart(this.peek))
|
|
11754
|
+
this.advance();
|
|
11755
|
+
const identifierName = this.input.substring(start, this.index);
|
|
11756
|
+
return newPrivateIdentifierToken(start, this.index, identifierName);
|
|
11757
|
+
}
|
|
11737
11758
|
scanNumber(start) {
|
|
11738
11759
|
let simple = (this.index === start);
|
|
11739
11760
|
this.advance(); // Skip initial digit.
|
|
@@ -12341,7 +12362,12 @@ define(['exports', 'typescript/lib/tsserverlibrary', 'os', 'typescript', 'fs', '
|
|
|
12341
12362
|
expectIdentifierOrKeyword() {
|
|
12342
12363
|
const n = this.next;
|
|
12343
12364
|
if (!n.isIdentifier() && !n.isKeyword()) {
|
|
12344
|
-
|
|
12365
|
+
if (n.isPrivateIdentifier()) {
|
|
12366
|
+
this._reportErrorForPrivateIdentifier(n, 'expected identifier or keyword');
|
|
12367
|
+
}
|
|
12368
|
+
else {
|
|
12369
|
+
this.error(`Unexpected ${this.prettyPrintToken(n)}, expected identifier or keyword`);
|
|
12370
|
+
}
|
|
12345
12371
|
return null;
|
|
12346
12372
|
}
|
|
12347
12373
|
this.advance();
|
|
@@ -12350,7 +12376,12 @@ define(['exports', 'typescript/lib/tsserverlibrary', 'os', 'typescript', 'fs', '
|
|
|
12350
12376
|
expectIdentifierOrKeywordOrString() {
|
|
12351
12377
|
const n = this.next;
|
|
12352
12378
|
if (!n.isIdentifier() && !n.isKeyword() && !n.isString()) {
|
|
12353
|
-
|
|
12379
|
+
if (n.isPrivateIdentifier()) {
|
|
12380
|
+
this._reportErrorForPrivateIdentifier(n, 'expected identifier, keyword or string');
|
|
12381
|
+
}
|
|
12382
|
+
else {
|
|
12383
|
+
this.error(`Unexpected ${this.prettyPrintToken(n)}, expected identifier, keyword, or string`);
|
|
12384
|
+
}
|
|
12354
12385
|
return '';
|
|
12355
12386
|
}
|
|
12356
12387
|
this.advance();
|
|
@@ -12673,6 +12704,10 @@ define(['exports', 'typescript/lib/tsserverlibrary', 'os', 'typescript', 'fs', '
|
|
|
12673
12704
|
this.advance();
|
|
12674
12705
|
return new LiteralPrimitive(this.span(start), this.sourceSpan(start), literalValue);
|
|
12675
12706
|
}
|
|
12707
|
+
else if (this.next.isPrivateIdentifier()) {
|
|
12708
|
+
this._reportErrorForPrivateIdentifier(this.next, null);
|
|
12709
|
+
return new EmptyExpr(this.span(start), this.sourceSpan(start));
|
|
12710
|
+
}
|
|
12676
12711
|
else if (this.index >= this.tokens.length) {
|
|
12677
12712
|
this.error(`Unexpected end of expression: ${this.input}`);
|
|
12678
12713
|
return new EmptyExpr(this.span(start), this.sourceSpan(start));
|
|
@@ -12969,6 +13004,18 @@ define(['exports', 'typescript/lib/tsserverlibrary', 'os', 'typescript', 'fs', '
|
|
|
12969
13004
|
return (index < this.tokens.length) ? `at column ${this.tokens[index].index + 1} in` :
|
|
12970
13005
|
`at the end of the expression`;
|
|
12971
13006
|
}
|
|
13007
|
+
/**
|
|
13008
|
+
* Records an error for an unexpected private identifier being discovered.
|
|
13009
|
+
* @param token Token representing a private identifier.
|
|
13010
|
+
* @param extraMessage Optional additional message being appended to the error.
|
|
13011
|
+
*/
|
|
13012
|
+
_reportErrorForPrivateIdentifier(token, extraMessage) {
|
|
13013
|
+
let errorMessage = `Private identifiers are not supported. Unexpected private identifier: ${token}`;
|
|
13014
|
+
if (extraMessage !== null) {
|
|
13015
|
+
errorMessage += `, ${extraMessage}`;
|
|
13016
|
+
}
|
|
13017
|
+
this.error(errorMessage);
|
|
13018
|
+
}
|
|
12972
13019
|
/**
|
|
12973
13020
|
* Error recovery should skip tokens until it encounters a recovery point.
|
|
12974
13021
|
*
|
|
@@ -17871,7 +17918,7 @@ define(['exports', 'typescript/lib/tsserverlibrary', 'os', 'typescript', 'fs', '
|
|
|
17871
17918
|
* Use of this source code is governed by an MIT-style license that can be
|
|
17872
17919
|
* found in the LICENSE file at https://angular.io/license
|
|
17873
17920
|
*/
|
|
17874
|
-
const VERSION$1 = new Version('12.0.
|
|
17921
|
+
const VERSION$1 = new Version('12.0.4');
|
|
17875
17922
|
|
|
17876
17923
|
/**
|
|
17877
17924
|
* @license
|
|
@@ -18510,7 +18557,7 @@ define(['exports', 'typescript/lib/tsserverlibrary', 'os', 'typescript', 'fs', '
|
|
|
18510
18557
|
function compileDeclareClassMetadata(metadata) {
|
|
18511
18558
|
const definitionMap = new DefinitionMap();
|
|
18512
18559
|
definitionMap.set('minVersion', literal(MINIMUM_PARTIAL_LINKER_VERSION));
|
|
18513
|
-
definitionMap.set('version', literal('12.0.
|
|
18560
|
+
definitionMap.set('version', literal('12.0.4'));
|
|
18514
18561
|
definitionMap.set('ngImport', importExpr(Identifiers.core));
|
|
18515
18562
|
definitionMap.set('type', metadata.type);
|
|
18516
18563
|
definitionMap.set('decorators', metadata.decorators);
|
|
@@ -18550,7 +18597,7 @@ define(['exports', 'typescript/lib/tsserverlibrary', 'os', 'typescript', 'fs', '
|
|
|
18550
18597
|
function createDirectiveDefinitionMap(meta) {
|
|
18551
18598
|
const definitionMap = new DefinitionMap();
|
|
18552
18599
|
definitionMap.set('minVersion', literal(MINIMUM_PARTIAL_LINKER_VERSION$1));
|
|
18553
|
-
definitionMap.set('version', literal('12.0.
|
|
18600
|
+
definitionMap.set('version', literal('12.0.4'));
|
|
18554
18601
|
// e.g. `type: MyDirective`
|
|
18555
18602
|
definitionMap.set('type', meta.internalType);
|
|
18556
18603
|
// e.g. `selector: 'some-dir'`
|
|
@@ -18767,7 +18814,7 @@ define(['exports', 'typescript/lib/tsserverlibrary', 'os', 'typescript', 'fs', '
|
|
|
18767
18814
|
function compileDeclareFactoryFunction(meta) {
|
|
18768
18815
|
const definitionMap = new DefinitionMap();
|
|
18769
18816
|
definitionMap.set('minVersion', literal(MINIMUM_PARTIAL_LINKER_VERSION$2));
|
|
18770
|
-
definitionMap.set('version', literal('12.0.
|
|
18817
|
+
definitionMap.set('version', literal('12.0.4'));
|
|
18771
18818
|
definitionMap.set('ngImport', importExpr(Identifiers.core));
|
|
18772
18819
|
definitionMap.set('type', meta.internalType);
|
|
18773
18820
|
definitionMap.set('deps', compileDependencies(meta.deps));
|
|
@@ -18809,7 +18856,7 @@ define(['exports', 'typescript/lib/tsserverlibrary', 'os', 'typescript', 'fs', '
|
|
|
18809
18856
|
function createInjectableDefinitionMap(meta) {
|
|
18810
18857
|
const definitionMap = new DefinitionMap();
|
|
18811
18858
|
definitionMap.set('minVersion', literal(MINIMUM_PARTIAL_LINKER_VERSION$3));
|
|
18812
|
-
definitionMap.set('version', literal('12.0.
|
|
18859
|
+
definitionMap.set('version', literal('12.0.4'));
|
|
18813
18860
|
definitionMap.set('ngImport', importExpr(Identifiers.core));
|
|
18814
18861
|
definitionMap.set('type', meta.internalType);
|
|
18815
18862
|
// Only generate providedIn property if it has a non-null value
|
|
@@ -18888,7 +18935,7 @@ define(['exports', 'typescript/lib/tsserverlibrary', 'os', 'typescript', 'fs', '
|
|
|
18888
18935
|
function createInjectorDefinitionMap(meta) {
|
|
18889
18936
|
const definitionMap = new DefinitionMap();
|
|
18890
18937
|
definitionMap.set('minVersion', literal(MINIMUM_PARTIAL_LINKER_VERSION$4));
|
|
18891
|
-
definitionMap.set('version', literal('12.0.
|
|
18938
|
+
definitionMap.set('version', literal('12.0.4'));
|
|
18892
18939
|
definitionMap.set('ngImport', importExpr(Identifiers.core));
|
|
18893
18940
|
definitionMap.set('type', meta.internalType);
|
|
18894
18941
|
definitionMap.set('providers', meta.providers);
|
|
@@ -18925,7 +18972,7 @@ define(['exports', 'typescript/lib/tsserverlibrary', 'os', 'typescript', 'fs', '
|
|
|
18925
18972
|
function createNgModuleDefinitionMap(meta) {
|
|
18926
18973
|
const definitionMap = new DefinitionMap();
|
|
18927
18974
|
definitionMap.set('minVersion', literal(MINIMUM_PARTIAL_LINKER_VERSION$5));
|
|
18928
|
-
definitionMap.set('version', literal('12.0.
|
|
18975
|
+
definitionMap.set('version', literal('12.0.4'));
|
|
18929
18976
|
definitionMap.set('ngImport', importExpr(Identifiers.core));
|
|
18930
18977
|
definitionMap.set('type', meta.internalType);
|
|
18931
18978
|
// We only generate the keys in the metadata if the arrays contain values.
|
|
@@ -18983,7 +19030,7 @@ define(['exports', 'typescript/lib/tsserverlibrary', 'os', 'typescript', 'fs', '
|
|
|
18983
19030
|
function createPipeDefinitionMap(meta) {
|
|
18984
19031
|
const definitionMap = new DefinitionMap();
|
|
18985
19032
|
definitionMap.set('minVersion', literal(MINIMUM_PARTIAL_LINKER_VERSION$6));
|
|
18986
|
-
definitionMap.set('version', literal('12.0.
|
|
19033
|
+
definitionMap.set('version', literal('12.0.4'));
|
|
18987
19034
|
definitionMap.set('ngImport', importExpr(Identifiers.core));
|
|
18988
19035
|
// e.g. `type: MyPipe`
|
|
18989
19036
|
definitionMap.set('type', meta.internalType);
|
|
@@ -19015,7 +19062,7 @@ define(['exports', 'typescript/lib/tsserverlibrary', 'os', 'typescript', 'fs', '
|
|
|
19015
19062
|
* Use of this source code is governed by an MIT-style license that can be
|
|
19016
19063
|
* found in the LICENSE file at https://angular.io/license
|
|
19017
19064
|
*/
|
|
19018
|
-
const VERSION$2 = new Version('12.0.
|
|
19065
|
+
const VERSION$2 = new Version('12.0.4');
|
|
19019
19066
|
|
|
19020
19067
|
/**
|
|
19021
19068
|
* @license
|
|
@@ -19368,14 +19415,6 @@ define(['exports', 'typescript/lib/tsserverlibrary', 'os', 'typescript', 'fs', '
|
|
|
19368
19415
|
const namedNode = node;
|
|
19369
19416
|
return namedNode.name !== undefined && ts$1.isIdentifier(namedNode.name);
|
|
19370
19417
|
}
|
|
19371
|
-
function isExported(node) {
|
|
19372
|
-
let topLevel = node;
|
|
19373
|
-
if (ts$1.isVariableDeclaration(node) && ts$1.isVariableDeclarationList(node.parent)) {
|
|
19374
|
-
topLevel = node.parent.parent;
|
|
19375
|
-
}
|
|
19376
|
-
return topLevel.modifiers !== undefined &&
|
|
19377
|
-
topLevel.modifiers.some(modifier => modifier.kind === ts$1.SyntaxKind.ExportKeyword);
|
|
19378
|
-
}
|
|
19379
19418
|
function getRootDirs(host, options) {
|
|
19380
19419
|
const rootDirs = [];
|
|
19381
19420
|
const cwd = host.getCurrentDirectory();
|
|
@@ -21111,6 +21150,32 @@ define(['exports', 'typescript/lib/tsserverlibrary', 'os', 'typescript', 'fs', '
|
|
|
21111
21150
|
getAdjacentNameOfClass(clazz) {
|
|
21112
21151
|
return clazz.name;
|
|
21113
21152
|
}
|
|
21153
|
+
isStaticallyExported(clazz) {
|
|
21154
|
+
// First check if there's an `export` modifier directly on the class declaration.
|
|
21155
|
+
let topLevel = clazz;
|
|
21156
|
+
if (ts$1.isVariableDeclaration(clazz) && ts$1.isVariableDeclarationList(clazz.parent)) {
|
|
21157
|
+
topLevel = clazz.parent.parent;
|
|
21158
|
+
}
|
|
21159
|
+
if (topLevel.modifiers !== undefined &&
|
|
21160
|
+
topLevel.modifiers.some(modifier => modifier.kind === ts$1.SyntaxKind.ExportKeyword)) {
|
|
21161
|
+
// The node is part of a declaration that's directly exported.
|
|
21162
|
+
return true;
|
|
21163
|
+
}
|
|
21164
|
+
// If `topLevel` is not directly exported via a modifier, then it might be indirectly exported,
|
|
21165
|
+
// e.g.:
|
|
21166
|
+
//
|
|
21167
|
+
// class Foo {}
|
|
21168
|
+
// export {Foo};
|
|
21169
|
+
//
|
|
21170
|
+
// The only way to check this is to look at the module level for exports of the class. As a
|
|
21171
|
+
// performance optimization, this check is only performed if the class is actually declared at
|
|
21172
|
+
// the top level of the file and thus eligible for exporting in the first place.
|
|
21173
|
+
if (topLevel.parent === undefined || !ts$1.isSourceFile(topLevel.parent)) {
|
|
21174
|
+
return false;
|
|
21175
|
+
}
|
|
21176
|
+
const localExports = this.getLocalExportedClassesOfSourceFile(clazz.getSourceFile());
|
|
21177
|
+
return localExports.has(clazz);
|
|
21178
|
+
}
|
|
21114
21179
|
getDirectImportOfIdentifier(id) {
|
|
21115
21180
|
const symbol = this.checker.getSymbolAtLocation(id);
|
|
21116
21181
|
if (symbol === undefined || symbol.declarations === undefined ||
|
|
@@ -21311,6 +21376,49 @@ define(['exports', 'typescript/lib/tsserverlibrary', 'os', 'typescript', 'fs', '
|
|
|
21311
21376
|
isStatic,
|
|
21312
21377
|
};
|
|
21313
21378
|
}
|
|
21379
|
+
/**
|
|
21380
|
+
* Get the set of classes declared in `file` which are exported.
|
|
21381
|
+
*/
|
|
21382
|
+
getLocalExportedClassesOfSourceFile(file) {
|
|
21383
|
+
const cacheSf = file;
|
|
21384
|
+
if (cacheSf[LocalExportedClasses] !== undefined) {
|
|
21385
|
+
// TS does not currently narrow symbol-keyed fields, hence the non-null assert is needed.
|
|
21386
|
+
return cacheSf[LocalExportedClasses];
|
|
21387
|
+
}
|
|
21388
|
+
const exportSet = new Set();
|
|
21389
|
+
cacheSf[LocalExportedClasses] = exportSet;
|
|
21390
|
+
const sfSymbol = this.checker.getSymbolAtLocation(cacheSf);
|
|
21391
|
+
if (sfSymbol === undefined || sfSymbol.exports === undefined) {
|
|
21392
|
+
return exportSet;
|
|
21393
|
+
}
|
|
21394
|
+
// Scan the exported symbol of the `ts.SourceFile` for the original `symbol` of the class
|
|
21395
|
+
// declaration.
|
|
21396
|
+
//
|
|
21397
|
+
// Note: when checking multiple classes declared in the same file, this repeats some operations.
|
|
21398
|
+
// In theory, this could be expensive if run in the context of a massive input file (like a
|
|
21399
|
+
// large FESM in ngcc). If performance does become an issue here, it should be possible to
|
|
21400
|
+
// create a `Set<>`
|
|
21401
|
+
// Unfortunately, `ts.Iterator` doesn't implement the iterator protocol, so iteration here is
|
|
21402
|
+
// done manually.
|
|
21403
|
+
const iter = sfSymbol.exports.values();
|
|
21404
|
+
let item = iter.next();
|
|
21405
|
+
while (item.done !== true) {
|
|
21406
|
+
let exportedSymbol = item.value;
|
|
21407
|
+
// If this exported symbol comes from an `export {Foo}` statement, then the symbol is actually
|
|
21408
|
+
// for the export declaration, not the original declaration. Such a symbol will be an alias,
|
|
21409
|
+
// so unwrap aliasing if necessary.
|
|
21410
|
+
if (exportedSymbol.flags & ts$1.SymbolFlags.Alias) {
|
|
21411
|
+
exportedSymbol = this.checker.getAliasedSymbol(exportedSymbol);
|
|
21412
|
+
}
|
|
21413
|
+
if (exportedSymbol.valueDeclaration !== undefined &&
|
|
21414
|
+
exportedSymbol.valueDeclaration.getSourceFile() === file &&
|
|
21415
|
+
this.isClass(exportedSymbol.valueDeclaration)) {
|
|
21416
|
+
exportSet.add(exportedSymbol.valueDeclaration);
|
|
21417
|
+
}
|
|
21418
|
+
item = iter.next();
|
|
21419
|
+
}
|
|
21420
|
+
return exportSet;
|
|
21421
|
+
}
|
|
21314
21422
|
}
|
|
21315
21423
|
function reflectTypeEntityToDeclaration(type, checker) {
|
|
21316
21424
|
let realSymbol = checker.getSymbolAtLocation(type);
|
|
@@ -21460,6 +21568,7 @@ define(['exports', 'typescript/lib/tsserverlibrary', 'os', 'typescript', 'fs', '
|
|
|
21460
21568
|
(decl.propertyName !== undefined ? decl.propertyName : decl.name).text :
|
|
21461
21569
|
originalId.text;
|
|
21462
21570
|
}
|
|
21571
|
+
const LocalExportedClasses = Symbol('LocalExportedClasses');
|
|
21463
21572
|
|
|
21464
21573
|
/**
|
|
21465
21574
|
* @license
|
|
@@ -24071,7 +24180,7 @@ define(['exports', 'typescript/lib/tsserverlibrary', 'os', 'typescript', 'fs', '
|
|
|
24071
24180
|
this.fileToClasses.get(sf).add(record.node);
|
|
24072
24181
|
}
|
|
24073
24182
|
scanClassForTraits(clazz) {
|
|
24074
|
-
if (!this.compileNonExportedClasses && !
|
|
24183
|
+
if (!this.compileNonExportedClasses && !this.reflector.isStaticallyExported(clazz)) {
|
|
24075
24184
|
return null;
|
|
24076
24185
|
}
|
|
24077
24186
|
const decorators = this.reflector.getDecoratorsOfDeclaration(clazz);
|
|
@@ -29498,6 +29607,12 @@ Either add the @Injectable() decorator to '${provider.node.name
|
|
|
29498
29607
|
stmt.moduleSpecifier === undefined) {
|
|
29499
29608
|
continue;
|
|
29500
29609
|
}
|
|
29610
|
+
if (ts$1.isImportDeclaration(stmt) && stmt.importClause !== undefined &&
|
|
29611
|
+
stmt.importClause.isTypeOnly) {
|
|
29612
|
+
// Exclude type-only imports as they are always elided, so they don't contribute to
|
|
29613
|
+
// cycles.
|
|
29614
|
+
continue;
|
|
29615
|
+
}
|
|
29501
29616
|
const symbol = this.checker.getSymbolAtLocation(stmt.moduleSpecifier);
|
|
29502
29617
|
if (symbol === undefined || symbol.valueDeclaration === undefined) {
|
|
29503
29618
|
// No symbol could be found to skip over this import/export.
|
|
@@ -38809,7 +38924,9 @@ https://v9.angular.io/guide/template-typecheck#template-type-checking`,
|
|
|
38809
38924
|
}
|
|
38810
38925
|
function getTsSymbolDisplayInfo(tsLS, checker, symbol, kind, ownerName) {
|
|
38811
38926
|
const decl = symbol.valueDeclaration;
|
|
38812
|
-
if (decl === undefined ||
|
|
38927
|
+
if (decl === undefined ||
|
|
38928
|
+
(!ts$1.isPropertyDeclaration(decl) && !ts$1.isMethodDeclaration(decl) &&
|
|
38929
|
+
!isNamedClassDeclaration(decl)) ||
|
|
38813
38930
|
!ts$1.isIdentifier(decl.name)) {
|
|
38814
38931
|
return null;
|
|
38815
38932
|
}
|
|
@@ -40581,14 +40698,24 @@ https://v9.angular.io/guide/template-typecheck#template-type-checking`,
|
|
|
40581
40698
|
displayParts = info.displayParts;
|
|
40582
40699
|
documentation = info.documentation;
|
|
40583
40700
|
break;
|
|
40701
|
+
case AttributeCompletionKind.StructuralDirectiveAttribute:
|
|
40584
40702
|
case AttributeCompletionKind.DirectiveInput:
|
|
40585
40703
|
case AttributeCompletionKind.DirectiveOutput:
|
|
40586
40704
|
const propertySymbol = getAttributeCompletionSymbol(completion, this.typeChecker);
|
|
40587
40705
|
if (propertySymbol === null) {
|
|
40588
40706
|
return undefined;
|
|
40589
40707
|
}
|
|
40590
|
-
|
|
40591
|
-
|
|
40708
|
+
let kind;
|
|
40709
|
+
if (completion.kind === AttributeCompletionKind.DirectiveInput) {
|
|
40710
|
+
kind = DisplayInfoKind.PROPERTY;
|
|
40711
|
+
}
|
|
40712
|
+
else if (completion.kind === AttributeCompletionKind.DirectiveOutput) {
|
|
40713
|
+
kind = DisplayInfoKind.EVENT;
|
|
40714
|
+
}
|
|
40715
|
+
else {
|
|
40716
|
+
kind = DisplayInfoKind.DIRECTIVE;
|
|
40717
|
+
}
|
|
40718
|
+
info = getTsSymbolDisplayInfo(this.tsLS, this.typeChecker, propertySymbol, kind, completion.directive.tsSymbol.name);
|
|
40592
40719
|
if (info === null) {
|
|
40593
40720
|
return undefined;
|
|
40594
40721
|
}
|
|
@@ -40599,7 +40726,7 @@ https://v9.angular.io/guide/template-typecheck#template-type-checking`,
|
|
|
40599
40726
|
name: entryName,
|
|
40600
40727
|
kind: unsafeCastDisplayInfoKindToScriptElementKind(kind),
|
|
40601
40728
|
kindModifiers: ts$1.ScriptElementKindModifier.none,
|
|
40602
|
-
displayParts
|
|
40729
|
+
displayParts,
|
|
40603
40730
|
documentation,
|
|
40604
40731
|
};
|
|
40605
40732
|
}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
/**
|
|
2
|
-
* @license Angular v12.0.
|
|
2
|
+
* @license Angular v12.0.4
|
|
3
3
|
* Copyright Google LLC All Rights Reserved.
|
|
4
4
|
* License: MIT
|
|
5
5
|
*/
|
|
@@ -13044,11 +13044,12 @@ define(['exports', 'typescript/lib/tsserverlibrary', 'typescript', 'path'], func
|
|
|
13044
13044
|
(function (TokenType) {
|
|
13045
13045
|
TokenType[TokenType["Character"] = 0] = "Character";
|
|
13046
13046
|
TokenType[TokenType["Identifier"] = 1] = "Identifier";
|
|
13047
|
-
TokenType[TokenType["
|
|
13048
|
-
TokenType[TokenType["
|
|
13049
|
-
TokenType[TokenType["
|
|
13050
|
-
TokenType[TokenType["
|
|
13051
|
-
TokenType[TokenType["
|
|
13047
|
+
TokenType[TokenType["PrivateIdentifier"] = 2] = "PrivateIdentifier";
|
|
13048
|
+
TokenType[TokenType["Keyword"] = 3] = "Keyword";
|
|
13049
|
+
TokenType[TokenType["String"] = 4] = "String";
|
|
13050
|
+
TokenType[TokenType["Operator"] = 5] = "Operator";
|
|
13051
|
+
TokenType[TokenType["Number"] = 6] = "Number";
|
|
13052
|
+
TokenType[TokenType["Error"] = 7] = "Error";
|
|
13052
13053
|
})(TokenType$1 || (TokenType$1 = {}));
|
|
13053
13054
|
const KEYWORDS = ['var', 'let', 'as', 'null', 'undefined', 'true', 'false', 'if', 'else', 'this'];
|
|
13054
13055
|
class Lexer {
|
|
@@ -13086,6 +13087,9 @@ define(['exports', 'typescript/lib/tsserverlibrary', 'typescript', 'path'], func
|
|
|
13086
13087
|
isIdentifier() {
|
|
13087
13088
|
return this.type == TokenType$1.Identifier;
|
|
13088
13089
|
}
|
|
13090
|
+
isPrivateIdentifier() {
|
|
13091
|
+
return this.type == TokenType$1.PrivateIdentifier;
|
|
13092
|
+
}
|
|
13089
13093
|
isKeyword() {
|
|
13090
13094
|
return this.type == TokenType$1.Keyword;
|
|
13091
13095
|
}
|
|
@@ -13122,6 +13126,7 @@ define(['exports', 'typescript/lib/tsserverlibrary', 'typescript', 'path'], func
|
|
|
13122
13126
|
case TokenType$1.Identifier:
|
|
13123
13127
|
case TokenType$1.Keyword:
|
|
13124
13128
|
case TokenType$1.Operator:
|
|
13129
|
+
case TokenType$1.PrivateIdentifier:
|
|
13125
13130
|
case TokenType$1.String:
|
|
13126
13131
|
case TokenType$1.Error:
|
|
13127
13132
|
return this.strValue;
|
|
@@ -13138,6 +13143,9 @@ define(['exports', 'typescript/lib/tsserverlibrary', 'typescript', 'path'], func
|
|
|
13138
13143
|
function newIdentifierToken(index, end, text) {
|
|
13139
13144
|
return new Token$1(index, end, TokenType$1.Identifier, 0, text);
|
|
13140
13145
|
}
|
|
13146
|
+
function newPrivateIdentifierToken(index, end, text) {
|
|
13147
|
+
return new Token$1(index, end, TokenType$1.PrivateIdentifier, 0, text);
|
|
13148
|
+
}
|
|
13141
13149
|
function newKeywordToken(index, end, text) {
|
|
13142
13150
|
return new Token$1(index, end, TokenType$1.Keyword, 0, text);
|
|
13143
13151
|
}
|
|
@@ -13208,6 +13216,7 @@ define(['exports', 'typescript/lib/tsserverlibrary', 'typescript', 'path'], func
|
|
|
13208
13216
|
case $DQ:
|
|
13209
13217
|
return this.scanString();
|
|
13210
13218
|
case $HASH:
|
|
13219
|
+
return this.scanPrivateIdentifier();
|
|
13211
13220
|
case $PLUS:
|
|
13212
13221
|
case $MINUS:
|
|
13213
13222
|
case $STAR:
|
|
@@ -13275,6 +13284,18 @@ define(['exports', 'typescript/lib/tsserverlibrary', 'typescript', 'path'], func
|
|
|
13275
13284
|
return KEYWORDS.indexOf(str) > -1 ? newKeywordToken(start, this.index, str) :
|
|
13276
13285
|
newIdentifierToken(start, this.index, str);
|
|
13277
13286
|
}
|
|
13287
|
+
/** Scans an ECMAScript private identifier. */
|
|
13288
|
+
scanPrivateIdentifier() {
|
|
13289
|
+
const start = this.index;
|
|
13290
|
+
this.advance();
|
|
13291
|
+
if (!isIdentifierStart(this.peek)) {
|
|
13292
|
+
return this.error('Invalid character [#]', -1);
|
|
13293
|
+
}
|
|
13294
|
+
while (isIdentifierPart(this.peek))
|
|
13295
|
+
this.advance();
|
|
13296
|
+
const identifierName = this.input.substring(start, this.index);
|
|
13297
|
+
return newPrivateIdentifierToken(start, this.index, identifierName);
|
|
13298
|
+
}
|
|
13278
13299
|
scanNumber(start) {
|
|
13279
13300
|
let simple = (this.index === start);
|
|
13280
13301
|
this.advance(); // Skip initial digit.
|
|
@@ -13882,7 +13903,12 @@ define(['exports', 'typescript/lib/tsserverlibrary', 'typescript', 'path'], func
|
|
|
13882
13903
|
expectIdentifierOrKeyword() {
|
|
13883
13904
|
const n = this.next;
|
|
13884
13905
|
if (!n.isIdentifier() && !n.isKeyword()) {
|
|
13885
|
-
|
|
13906
|
+
if (n.isPrivateIdentifier()) {
|
|
13907
|
+
this._reportErrorForPrivateIdentifier(n, 'expected identifier or keyword');
|
|
13908
|
+
}
|
|
13909
|
+
else {
|
|
13910
|
+
this.error(`Unexpected ${this.prettyPrintToken(n)}, expected identifier or keyword`);
|
|
13911
|
+
}
|
|
13886
13912
|
return null;
|
|
13887
13913
|
}
|
|
13888
13914
|
this.advance();
|
|
@@ -13891,7 +13917,12 @@ define(['exports', 'typescript/lib/tsserverlibrary', 'typescript', 'path'], func
|
|
|
13891
13917
|
expectIdentifierOrKeywordOrString() {
|
|
13892
13918
|
const n = this.next;
|
|
13893
13919
|
if (!n.isIdentifier() && !n.isKeyword() && !n.isString()) {
|
|
13894
|
-
|
|
13920
|
+
if (n.isPrivateIdentifier()) {
|
|
13921
|
+
this._reportErrorForPrivateIdentifier(n, 'expected identifier, keyword or string');
|
|
13922
|
+
}
|
|
13923
|
+
else {
|
|
13924
|
+
this.error(`Unexpected ${this.prettyPrintToken(n)}, expected identifier, keyword, or string`);
|
|
13925
|
+
}
|
|
13895
13926
|
return '';
|
|
13896
13927
|
}
|
|
13897
13928
|
this.advance();
|
|
@@ -14214,6 +14245,10 @@ define(['exports', 'typescript/lib/tsserverlibrary', 'typescript', 'path'], func
|
|
|
14214
14245
|
this.advance();
|
|
14215
14246
|
return new LiteralPrimitive(this.span(start), this.sourceSpan(start), literalValue);
|
|
14216
14247
|
}
|
|
14248
|
+
else if (this.next.isPrivateIdentifier()) {
|
|
14249
|
+
this._reportErrorForPrivateIdentifier(this.next, null);
|
|
14250
|
+
return new EmptyExpr(this.span(start), this.sourceSpan(start));
|
|
14251
|
+
}
|
|
14217
14252
|
else if (this.index >= this.tokens.length) {
|
|
14218
14253
|
this.error(`Unexpected end of expression: ${this.input}`);
|
|
14219
14254
|
return new EmptyExpr(this.span(start), this.sourceSpan(start));
|
|
@@ -14510,6 +14545,18 @@ define(['exports', 'typescript/lib/tsserverlibrary', 'typescript', 'path'], func
|
|
|
14510
14545
|
return (index < this.tokens.length) ? `at column ${this.tokens[index].index + 1} in` :
|
|
14511
14546
|
`at the end of the expression`;
|
|
14512
14547
|
}
|
|
14548
|
+
/**
|
|
14549
|
+
* Records an error for an unexpected private identifier being discovered.
|
|
14550
|
+
* @param token Token representing a private identifier.
|
|
14551
|
+
* @param extraMessage Optional additional message being appended to the error.
|
|
14552
|
+
*/
|
|
14553
|
+
_reportErrorForPrivateIdentifier(token, extraMessage) {
|
|
14554
|
+
let errorMessage = `Private identifiers are not supported. Unexpected private identifier: ${token}`;
|
|
14555
|
+
if (extraMessage !== null) {
|
|
14556
|
+
errorMessage += `, ${extraMessage}`;
|
|
14557
|
+
}
|
|
14558
|
+
this.error(errorMessage);
|
|
14559
|
+
}
|
|
14513
14560
|
/**
|
|
14514
14561
|
* Error recovery should skip tokens until it encounters a recovery point.
|
|
14515
14562
|
*
|
|
@@ -19412,7 +19459,7 @@ define(['exports', 'typescript/lib/tsserverlibrary', 'typescript', 'path'], func
|
|
|
19412
19459
|
* Use of this source code is governed by an MIT-style license that can be
|
|
19413
19460
|
* found in the LICENSE file at https://angular.io/license
|
|
19414
19461
|
*/
|
|
19415
|
-
const VERSION$1 = new Version('12.0.
|
|
19462
|
+
const VERSION$1 = new Version('12.0.4');
|
|
19416
19463
|
|
|
19417
19464
|
/**
|
|
19418
19465
|
* @license
|
|
@@ -35319,6 +35366,9 @@ define(['exports', 'typescript/lib/tsserverlibrary', 'typescript', 'path'], func
|
|
|
35319
35366
|
* then use the factory's `create()` method to create a component of that type.
|
|
35320
35367
|
*
|
|
35321
35368
|
* @see [Dynamic Components](guide/dynamic-component-loader)
|
|
35369
|
+
* @see [Usage Example](guide/dynamic-component-loader#resolving-components)
|
|
35370
|
+
* @see <live-example name="dynamic-component-loader" noDownload></live-example>
|
|
35371
|
+
of the code in this cookbook
|
|
35322
35372
|
* @publicApi
|
|
35323
35373
|
*/
|
|
35324
35374
|
class ComponentFactoryResolver {
|
|
@@ -35480,7 +35530,7 @@ define(['exports', 'typescript/lib/tsserverlibrary', 'typescript', 'path'], func
|
|
|
35480
35530
|
/**
|
|
35481
35531
|
* @publicApi
|
|
35482
35532
|
*/
|
|
35483
|
-
const VERSION$2 = new Version$1('12.0.
|
|
35533
|
+
const VERSION$2 = new Version$1('12.0.4');
|
|
35484
35534
|
|
|
35485
35535
|
/**
|
|
35486
35536
|
* @license
|
|
@@ -36680,7 +36730,7 @@ define(['exports', 'typescript/lib/tsserverlibrary', 'typescript', 'path'], func
|
|
|
36680
36730
|
*
|
|
36681
36731
|
* ```typescript
|
|
36682
36732
|
* @Component({
|
|
36683
|
-
* selector: '
|
|
36733
|
+
* selector: 'app-root',
|
|
36684
36734
|
* template: `Number of ticks: {{numberOfTicks}}`
|
|
36685
36735
|
* changeDetection: ChangeDetectionStrategy.OnPush,
|
|
36686
36736
|
* })
|
|
@@ -36800,7 +36850,7 @@ define(['exports', 'typescript/lib/tsserverlibrary', 'typescript', 'path'], func
|
|
|
36800
36850
|
* }
|
|
36801
36851
|
*
|
|
36802
36852
|
* @Component({
|
|
36803
|
-
* selector: '
|
|
36853
|
+
* selector: 'app-root',
|
|
36804
36854
|
* providers: [DataProvider],
|
|
36805
36855
|
* template: `
|
|
36806
36856
|
* Live Update: <input type="checkbox" [(ngModel)]="live">
|
package/package.json
CHANGED
|
@@ -1,13 +1,13 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@angular/language-service",
|
|
3
|
-
"version": "12.0.
|
|
3
|
+
"version": "12.0.4",
|
|
4
4
|
"description": "Angular - language services",
|
|
5
5
|
"main": "./index.js",
|
|
6
6
|
"typings": "./index.d.ts",
|
|
7
7
|
"author": "angular",
|
|
8
8
|
"license": "MIT",
|
|
9
9
|
"engines": {
|
|
10
|
-
"node": "^12.14.1 ||
|
|
10
|
+
"node": "^12.14.1 || >=14.0.0"
|
|
11
11
|
},
|
|
12
12
|
"repository": {
|
|
13
13
|
"type": "git",
|
|
@@ -33,8 +33,5 @@
|
|
|
33
33
|
"@angular/localize",
|
|
34
34
|
"@angular/service-worker"
|
|
35
35
|
]
|
|
36
|
-
},
|
|
37
|
-
"publishConfig":{
|
|
38
|
-
"registry":"https://wombat-dressing-room.appspot.com"
|
|
39
36
|
}
|
|
40
37
|
}
|