@angular/language-service 10.2.1 → 10.2.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/bundles/ivy.js +78 -29
- package/bundles/language-service.js +63 -21
- package/package.json +1 -1
package/bundles/ivy.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
/**
|
|
2
|
-
* @license Angular v10.2.
|
|
2
|
+
* @license Angular v10.2.5
|
|
3
3
|
* Copyright Google LLC All Rights Reserved.
|
|
4
4
|
* License: MIT
|
|
5
5
|
*/
|
|
@@ -6061,9 +6061,33 @@ define(['exports', 'os', 'typescript', 'fs', 'constants', 'stream', 'util', 'ass
|
|
|
6061
6061
|
}
|
|
6062
6062
|
}
|
|
6063
6063
|
class ParseSourceSpan {
|
|
6064
|
-
|
|
6064
|
+
/**
|
|
6065
|
+
* Create an object that holds information about spans of tokens/nodes captured during
|
|
6066
|
+
* lexing/parsing of text.
|
|
6067
|
+
*
|
|
6068
|
+
* @param start
|
|
6069
|
+
* The location of the start of the span (having skipped leading trivia).
|
|
6070
|
+
* Skipping leading trivia makes source-spans more "user friendly", since things like HTML
|
|
6071
|
+
* elements will appear to begin at the start of the opening tag, rather than at the start of any
|
|
6072
|
+
* leading trivia, which could include newlines.
|
|
6073
|
+
*
|
|
6074
|
+
* @param end
|
|
6075
|
+
* The location of the end of the span.
|
|
6076
|
+
*
|
|
6077
|
+
* @param fullStart
|
|
6078
|
+
* The start of the token without skipping the leading trivia.
|
|
6079
|
+
* This is used by tooling that splits tokens further, such as extracting Angular interpolations
|
|
6080
|
+
* from text tokens. Such tooling creates new source-spans relative to the original token's
|
|
6081
|
+
* source-span. If leading trivia characters have been skipped then the new source-spans may be
|
|
6082
|
+
* incorrectly offset.
|
|
6083
|
+
*
|
|
6084
|
+
* @param details
|
|
6085
|
+
* Additional information (such as identifier names) that should be associated with the span.
|
|
6086
|
+
*/
|
|
6087
|
+
constructor(start, end, fullStart = start, details = null) {
|
|
6065
6088
|
this.start = start;
|
|
6066
6089
|
this.end = end;
|
|
6090
|
+
this.fullStart = fullStart;
|
|
6067
6091
|
this.details = details;
|
|
6068
6092
|
}
|
|
6069
6093
|
toString() {
|
|
@@ -10225,7 +10249,8 @@ define(['exports', 'os', 'typescript', 'fs', 'constants', 'stream', 'util', 'ass
|
|
|
10225
10249
|
if (this.baseSourceSpan) {
|
|
10226
10250
|
const start = this.baseSourceSpan.start.moveBy(span.start);
|
|
10227
10251
|
const end = this.baseSourceSpan.start.moveBy(span.end);
|
|
10228
|
-
|
|
10252
|
+
const fullStart = this.baseSourceSpan.fullStart.moveBy(span.start);
|
|
10253
|
+
return new ParseSourceSpan(start, end, fullStart);
|
|
10229
10254
|
}
|
|
10230
10255
|
else {
|
|
10231
10256
|
return null;
|
|
@@ -11691,17 +11716,19 @@ define(['exports', 'os', 'typescript', 'fs', 'constants', 'stream', 'util', 'ass
|
|
|
11691
11716
|
}
|
|
11692
11717
|
getSpan(start, leadingTriviaCodePoints) {
|
|
11693
11718
|
start = start || this;
|
|
11694
|
-
let
|
|
11719
|
+
let fullStart = start;
|
|
11695
11720
|
if (leadingTriviaCodePoints) {
|
|
11696
11721
|
while (this.diff(start) > 0 && leadingTriviaCodePoints.indexOf(start.peek()) !== -1) {
|
|
11697
|
-
if (
|
|
11722
|
+
if (fullStart === start) {
|
|
11698
11723
|
start = start.clone();
|
|
11699
|
-
cloned = true;
|
|
11700
11724
|
}
|
|
11701
11725
|
start.advance();
|
|
11702
11726
|
}
|
|
11703
11727
|
}
|
|
11704
|
-
|
|
11728
|
+
const startLocation = this.locationFromCursor(start);
|
|
11729
|
+
const endLocation = this.locationFromCursor(this);
|
|
11730
|
+
const fullStartLocation = fullStart !== start ? this.locationFromCursor(fullStart) : startLocation;
|
|
11731
|
+
return new ParseSourceSpan(startLocation, endLocation, fullStartLocation);
|
|
11705
11732
|
}
|
|
11706
11733
|
getChars(start) {
|
|
11707
11734
|
return this.input.substring(start.state.offset, this.state.offset);
|
|
@@ -11728,6 +11755,9 @@ define(['exports', 'os', 'typescript', 'fs', 'constants', 'stream', 'util', 'ass
|
|
|
11728
11755
|
updatePeek(state) {
|
|
11729
11756
|
state.peek = state.offset >= this.end ? $EOF : this.charAt(state.offset);
|
|
11730
11757
|
}
|
|
11758
|
+
locationFromCursor(cursor) {
|
|
11759
|
+
return new ParseLocation(cursor.file, cursor.state.offset, cursor.state.line, cursor.state.column);
|
|
11760
|
+
}
|
|
11731
11761
|
}
|
|
11732
11762
|
class EscapedCharacterCursor extends PlainCharacterCursor {
|
|
11733
11763
|
constructor(fileOrCursor, range) {
|
|
@@ -11985,7 +12015,7 @@ define(['exports', 'os', 'typescript', 'fs', 'constants', 'stream', 'util', 'ass
|
|
|
11985
12015
|
this.errors.push(TreeError.create(null, this._peek.sourceSpan, `Invalid ICU message. Missing '}'.`));
|
|
11986
12016
|
return;
|
|
11987
12017
|
}
|
|
11988
|
-
const sourceSpan = new ParseSourceSpan(token.sourceSpan.start, this._peek.sourceSpan.end);
|
|
12018
|
+
const sourceSpan = new ParseSourceSpan(token.sourceSpan.start, this._peek.sourceSpan.end, token.sourceSpan.fullStart);
|
|
11989
12019
|
this._addToParent(new Expansion(switchValue.parts[0], type.parts[0], cases, sourceSpan, switchValue.sourceSpan));
|
|
11990
12020
|
this._advance();
|
|
11991
12021
|
}
|
|
@@ -12010,8 +12040,8 @@ define(['exports', 'os', 'typescript', 'fs', 'constants', 'stream', 'util', 'ass
|
|
|
12010
12040
|
this.errors = this.errors.concat(expansionCaseParser.errors);
|
|
12011
12041
|
return null;
|
|
12012
12042
|
}
|
|
12013
|
-
const sourceSpan = new ParseSourceSpan(value.sourceSpan.start, end.sourceSpan.end);
|
|
12014
|
-
const expSourceSpan = new ParseSourceSpan(start.sourceSpan.start, end.sourceSpan.end);
|
|
12043
|
+
const sourceSpan = new ParseSourceSpan(value.sourceSpan.start, end.sourceSpan.end, value.sourceSpan.fullStart);
|
|
12044
|
+
const expSourceSpan = new ParseSourceSpan(start.sourceSpan.start, end.sourceSpan.end, start.sourceSpan.fullStart);
|
|
12015
12045
|
return new ExpansionCase(value.parts[0], expansionCaseParser.rootNodes, sourceSpan, value.sourceSpan, expSourceSpan);
|
|
12016
12046
|
}
|
|
12017
12047
|
_collectExpansionExpTokens(start) {
|
|
@@ -12092,8 +12122,10 @@ define(['exports', 'os', 'typescript', 'fs', 'constants', 'stream', 'util', 'ass
|
|
|
12092
12122
|
selfClosing = false;
|
|
12093
12123
|
}
|
|
12094
12124
|
const end = this._peek.sourceSpan.start;
|
|
12095
|
-
const span = new ParseSourceSpan(startTagToken.sourceSpan.start, end);
|
|
12096
|
-
|
|
12125
|
+
const span = new ParseSourceSpan(startTagToken.sourceSpan.start, end, startTagToken.sourceSpan.fullStart);
|
|
12126
|
+
// Create a separate `startSpan` because `span` may be modified when there is an `end` span.
|
|
12127
|
+
const startSpan = new ParseSourceSpan(startTagToken.sourceSpan.start, end, startTagToken.sourceSpan.fullStart);
|
|
12128
|
+
const el = new Element$1(fullName, attrs, [], span, startSpan, undefined);
|
|
12097
12129
|
this._pushElement(el);
|
|
12098
12130
|
if (selfClosing) {
|
|
12099
12131
|
// Elements that are self-closed have their `endSourceSpan` set to the full span, as the
|
|
@@ -12154,7 +12186,7 @@ define(['exports', 'os', 'typescript', 'fs', 'constants', 'stream', 'util', 'ass
|
|
|
12154
12186
|
const quoteToken = this._advance();
|
|
12155
12187
|
end = quoteToken.sourceSpan.end;
|
|
12156
12188
|
}
|
|
12157
|
-
return new Attribute(fullName, value, new ParseSourceSpan(attrName.sourceSpan.start, end), valueSpan);
|
|
12189
|
+
return new Attribute(fullName, value, new ParseSourceSpan(attrName.sourceSpan.start, end, attrName.sourceSpan.fullStart), valueSpan);
|
|
12158
12190
|
}
|
|
12159
12191
|
_getParentElement() {
|
|
12160
12192
|
return this._elementStack.length > 0 ? this._elementStack[this._elementStack.length - 1] : null;
|
|
@@ -12735,7 +12767,7 @@ define(['exports', 'os', 'typescript', 'fs', 'constants', 'stream', 'util', 'ass
|
|
|
12735
12767
|
// The difference of two absolute offsets provide the relative offset
|
|
12736
12768
|
const startDiff = absoluteSpan.start - sourceSpan.start.offset;
|
|
12737
12769
|
const endDiff = absoluteSpan.end - sourceSpan.end.offset;
|
|
12738
|
-
return new ParseSourceSpan(sourceSpan.start.moveBy(startDiff), sourceSpan.end.moveBy(endDiff));
|
|
12770
|
+
return new ParseSourceSpan(sourceSpan.start.moveBy(startDiff), sourceSpan.end.moveBy(endDiff), sourceSpan.fullStart.moveBy(startDiff), sourceSpan.details);
|
|
12739
12771
|
}
|
|
12740
12772
|
|
|
12741
12773
|
/**
|
|
@@ -16244,7 +16276,7 @@ define(['exports', 'os', 'typescript', 'fs', 'constants', 'stream', 'util', 'ass
|
|
|
16244
16276
|
}
|
|
16245
16277
|
}
|
|
16246
16278
|
function getOffsetSourceSpan(sourceSpan, { start, end }) {
|
|
16247
|
-
return new ParseSourceSpan(sourceSpan.
|
|
16279
|
+
return new ParseSourceSpan(sourceSpan.fullStart.moveBy(start), sourceSpan.fullStart.moveBy(end));
|
|
16248
16280
|
}
|
|
16249
16281
|
const _CUSTOM_PH_EXP = /\/\/[\s\S]*i18n[\s\S]*\([\s\S]*ph[\s\S]*=[\s\S]*("|')([\s\S]*?)\1[\s\S]*\)/g;
|
|
16250
16282
|
function _extractPlaceholderName(input) {
|
|
@@ -16580,7 +16612,7 @@ define(['exports', 'os', 'typescript', 'fs', 'constants', 'stream', 'util', 'ass
|
|
|
16580
16612
|
function getSourceSpan(message) {
|
|
16581
16613
|
const startNode = message.nodes[0];
|
|
16582
16614
|
const endNode = message.nodes[message.nodes.length - 1];
|
|
16583
|
-
return new ParseSourceSpan(startNode.sourceSpan.start, endNode.sourceSpan.end, startNode.sourceSpan.details);
|
|
16615
|
+
return new ParseSourceSpan(startNode.sourceSpan.start, endNode.sourceSpan.end, startNode.sourceSpan.fullStart, startNode.sourceSpan.details);
|
|
16584
16616
|
}
|
|
16585
16617
|
/**
|
|
16586
16618
|
* Convert the list of serialized MessagePieces into two arrays.
|
|
@@ -16607,7 +16639,7 @@ define(['exports', 'os', 'typescript', 'fs', 'constants', 'stream', 'util', 'ass
|
|
|
16607
16639
|
placeHolders.push(part);
|
|
16608
16640
|
if (pieces[i - 1] instanceof PlaceholderPiece) {
|
|
16609
16641
|
// There were two placeholders in a row, so we need to add an empty message part.
|
|
16610
|
-
messageParts.push(createEmptyMessagePart(
|
|
16642
|
+
messageParts.push(createEmptyMessagePart(pieces[i - 1].sourceSpan.end));
|
|
16611
16643
|
}
|
|
16612
16644
|
}
|
|
16613
16645
|
}
|
|
@@ -19166,7 +19198,7 @@ define(['exports', 'os', 'typescript', 'fs', 'constants', 'stream', 'util', 'ass
|
|
|
19166
19198
|
* Use of this source code is governed by an MIT-style license that can be
|
|
19167
19199
|
* found in the LICENSE file at https://angular.io/license
|
|
19168
19200
|
*/
|
|
19169
|
-
const VERSION$1 = new Version('10.2.
|
|
19201
|
+
const VERSION$1 = new Version('10.2.5');
|
|
19170
19202
|
|
|
19171
19203
|
/**
|
|
19172
19204
|
* @license
|
|
@@ -19759,7 +19791,7 @@ define(['exports', 'os', 'typescript', 'fs', 'constants', 'stream', 'util', 'ass
|
|
|
19759
19791
|
* Use of this source code is governed by an MIT-style license that can be
|
|
19760
19792
|
* found in the LICENSE file at https://angular.io/license
|
|
19761
19793
|
*/
|
|
19762
|
-
const VERSION$2 = new Version('10.2.
|
|
19794
|
+
const VERSION$2 = new Version('10.2.5');
|
|
19763
19795
|
|
|
19764
19796
|
/**
|
|
19765
19797
|
* @license
|
|
@@ -19898,6 +19930,11 @@ define(['exports', 'os', 'typescript', 'fs', 'constants', 'stream', 'util', 'ass
|
|
|
19898
19930
|
* Raised when a directive/pipe is part of the declarations of two or more NgModules.
|
|
19899
19931
|
*/
|
|
19900
19932
|
ErrorCode[ErrorCode["NGMODULE_DECLARATION_NOT_UNIQUE"] = 6007] = "NGMODULE_DECLARATION_NOT_UNIQUE";
|
|
19933
|
+
/**
|
|
19934
|
+
* Not actually raised by the compiler, but reserved for documentation of a View Engine error when
|
|
19935
|
+
* a View Engine build depends on an Ivy-compiled NgModule.
|
|
19936
|
+
*/
|
|
19937
|
+
ErrorCode[ErrorCode["NGMODULE_VE_DEPENDENCY_ON_IVY_LIB"] = 6999] = "NGMODULE_VE_DEPENDENCY_ON_IVY_LIB";
|
|
19901
19938
|
/**
|
|
19902
19939
|
* An element name failed validation against the DOM schema.
|
|
19903
19940
|
*/
|
|
@@ -32089,6 +32126,11 @@ Either add the @Injectable() decorator to '${provider.node.name
|
|
|
32089
32126
|
constructor(resolver) {
|
|
32090
32127
|
this.resolver = resolver;
|
|
32091
32128
|
this._diagnostics = [];
|
|
32129
|
+
/**
|
|
32130
|
+
* Tracks which `BindingPipe` nodes have already been recorded as invalid, so only one diagnostic
|
|
32131
|
+
* is ever produced per node.
|
|
32132
|
+
*/
|
|
32133
|
+
this.recordedPipes = new Set();
|
|
32092
32134
|
}
|
|
32093
32135
|
get diagnostics() {
|
|
32094
32136
|
return this._diagnostics;
|
|
@@ -32100,6 +32142,9 @@ Either add the @Injectable() decorator to '${provider.node.name
|
|
|
32100
32142
|
this._diagnostics.push(makeTemplateDiagnostic(templateId, mapping, ref.valueSpan || ref.sourceSpan, ts.DiagnosticCategory.Error, ngErrorCode(ErrorCode.MISSING_REFERENCE_TARGET), errorMsg));
|
|
32101
32143
|
}
|
|
32102
32144
|
missingPipe(templateId, ast) {
|
|
32145
|
+
if (this.recordedPipes.has(ast)) {
|
|
32146
|
+
return;
|
|
32147
|
+
}
|
|
32103
32148
|
const mapping = this.resolver.getSourceMapping(templateId);
|
|
32104
32149
|
const errorMsg = `No pipe found with name '${ast.name}'.`;
|
|
32105
32150
|
const sourceSpan = this.resolver.toParseSourceSpan(templateId, ast.nameSpan);
|
|
@@ -32107,6 +32152,7 @@ Either add the @Injectable() decorator to '${provider.node.name
|
|
|
32107
32152
|
throw new Error(`Assertion failure: no SourceLocation found for usage of pipe '${ast.name}'.`);
|
|
32108
32153
|
}
|
|
32109
32154
|
this._diagnostics.push(makeTemplateDiagnostic(templateId, mapping, sourceSpan, ts.DiagnosticCategory.Error, ngErrorCode(ErrorCode.MISSING_PIPE), errorMsg));
|
|
32155
|
+
this.recordedPipes.add(ast);
|
|
32110
32156
|
}
|
|
32111
32157
|
illegalAssignmentToTemplateVar(templateId, assignment, target) {
|
|
32112
32158
|
const mapping = this.resolver.getSourceMapping(templateId);
|
|
@@ -33518,7 +33564,7 @@ Either add the @Injectable() decorator to '${provider.node.name
|
|
|
33518
33564
|
if (!this.pipes.has(name)) {
|
|
33519
33565
|
return null;
|
|
33520
33566
|
}
|
|
33521
|
-
return this.
|
|
33567
|
+
return this.pipes.get(name);
|
|
33522
33568
|
}
|
|
33523
33569
|
}
|
|
33524
33570
|
/**
|
|
@@ -33974,18 +34020,21 @@ Either add the @Injectable() decorator to '${provider.node.name
|
|
|
33974
34020
|
}
|
|
33975
34021
|
else if (ast instanceof BindingPipe) {
|
|
33976
34022
|
const expr = this.translate(ast.exp);
|
|
34023
|
+
const pipeRef = this.tcb.getPipeByName(ast.name);
|
|
33977
34024
|
let pipe;
|
|
33978
|
-
if (
|
|
33979
|
-
pipe
|
|
33980
|
-
|
|
33981
|
-
|
|
33982
|
-
|
|
33983
|
-
|
|
33984
|
-
|
|
33985
|
-
|
|
34025
|
+
if (pipeRef === null) {
|
|
34026
|
+
// No pipe by that name exists in scope. Record this as an error.
|
|
34027
|
+
this.tcb.oobRecorder.missingPipe(this.tcb.id, ast);
|
|
34028
|
+
// Use an 'any' value to at least allow the rest of the expression to be checked.
|
|
34029
|
+
pipe = NULL_AS_ANY;
|
|
34030
|
+
}
|
|
34031
|
+
else if (this.tcb.env.config.checkTypeOfPipes) {
|
|
34032
|
+
// Use a variable declared as the pipe's type.
|
|
34033
|
+
pipe = this.tcb.env.pipeInst(pipeRef);
|
|
33986
34034
|
}
|
|
33987
34035
|
else {
|
|
33988
|
-
|
|
34036
|
+
// Use an 'any' value when not checking the type of the pipe.
|
|
34037
|
+
pipe = NULL_AS_ANY;
|
|
33989
34038
|
}
|
|
33990
34039
|
const args = ast.args.map(arg => this.translate(arg));
|
|
33991
34040
|
const result = tsCallMethod(pipe, 'transform', [expr, ...args]);
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
/**
|
|
2
|
-
* @license Angular v10.2.
|
|
2
|
+
* @license Angular v10.2.5
|
|
3
3
|
* Copyright Google LLC All Rights Reserved.
|
|
4
4
|
* License: MIT
|
|
5
5
|
*/
|
|
@@ -3294,9 +3294,33 @@ define(['exports', 'typescript/lib/tsserverlibrary', 'typescript', 'path'], func
|
|
|
3294
3294
|
}
|
|
3295
3295
|
}
|
|
3296
3296
|
class ParseSourceSpan {
|
|
3297
|
-
|
|
3297
|
+
/**
|
|
3298
|
+
* Create an object that holds information about spans of tokens/nodes captured during
|
|
3299
|
+
* lexing/parsing of text.
|
|
3300
|
+
*
|
|
3301
|
+
* @param start
|
|
3302
|
+
* The location of the start of the span (having skipped leading trivia).
|
|
3303
|
+
* Skipping leading trivia makes source-spans more "user friendly", since things like HTML
|
|
3304
|
+
* elements will appear to begin at the start of the opening tag, rather than at the start of any
|
|
3305
|
+
* leading trivia, which could include newlines.
|
|
3306
|
+
*
|
|
3307
|
+
* @param end
|
|
3308
|
+
* The location of the end of the span.
|
|
3309
|
+
*
|
|
3310
|
+
* @param fullStart
|
|
3311
|
+
* The start of the token without skipping the leading trivia.
|
|
3312
|
+
* This is used by tooling that splits tokens further, such as extracting Angular interpolations
|
|
3313
|
+
* from text tokens. Such tooling creates new source-spans relative to the original token's
|
|
3314
|
+
* source-span. If leading trivia characters have been skipped then the new source-spans may be
|
|
3315
|
+
* incorrectly offset.
|
|
3316
|
+
*
|
|
3317
|
+
* @param details
|
|
3318
|
+
* Additional information (such as identifier names) that should be associated with the span.
|
|
3319
|
+
*/
|
|
3320
|
+
constructor(start, end, fullStart = start, details = null) {
|
|
3298
3321
|
this.start = start;
|
|
3299
3322
|
this.end = end;
|
|
3323
|
+
this.fullStart = fullStart;
|
|
3300
3324
|
this.details = details;
|
|
3301
3325
|
}
|
|
3302
3326
|
toString() {
|
|
@@ -7449,7 +7473,8 @@ define(['exports', 'typescript/lib/tsserverlibrary', 'typescript', 'path'], func
|
|
|
7449
7473
|
if (this.baseSourceSpan) {
|
|
7450
7474
|
const start = this.baseSourceSpan.start.moveBy(span.start);
|
|
7451
7475
|
const end = this.baseSourceSpan.start.moveBy(span.end);
|
|
7452
|
-
|
|
7476
|
+
const fullStart = this.baseSourceSpan.fullStart.moveBy(span.start);
|
|
7477
|
+
return new ParseSourceSpan(start, end, fullStart);
|
|
7453
7478
|
}
|
|
7454
7479
|
else {
|
|
7455
7480
|
return null;
|
|
@@ -9002,17 +9027,19 @@ define(['exports', 'typescript/lib/tsserverlibrary', 'typescript', 'path'], func
|
|
|
9002
9027
|
}
|
|
9003
9028
|
getSpan(start, leadingTriviaCodePoints) {
|
|
9004
9029
|
start = start || this;
|
|
9005
|
-
let
|
|
9030
|
+
let fullStart = start;
|
|
9006
9031
|
if (leadingTriviaCodePoints) {
|
|
9007
9032
|
while (this.diff(start) > 0 && leadingTriviaCodePoints.indexOf(start.peek()) !== -1) {
|
|
9008
|
-
if (
|
|
9033
|
+
if (fullStart === start) {
|
|
9009
9034
|
start = start.clone();
|
|
9010
|
-
cloned = true;
|
|
9011
9035
|
}
|
|
9012
9036
|
start.advance();
|
|
9013
9037
|
}
|
|
9014
9038
|
}
|
|
9015
|
-
|
|
9039
|
+
const startLocation = this.locationFromCursor(start);
|
|
9040
|
+
const endLocation = this.locationFromCursor(this);
|
|
9041
|
+
const fullStartLocation = fullStart !== start ? this.locationFromCursor(fullStart) : startLocation;
|
|
9042
|
+
return new ParseSourceSpan(startLocation, endLocation, fullStartLocation);
|
|
9016
9043
|
}
|
|
9017
9044
|
getChars(start) {
|
|
9018
9045
|
return this.input.substring(start.state.offset, this.state.offset);
|
|
@@ -9039,6 +9066,9 @@ define(['exports', 'typescript/lib/tsserverlibrary', 'typescript', 'path'], func
|
|
|
9039
9066
|
updatePeek(state) {
|
|
9040
9067
|
state.peek = state.offset >= this.end ? $EOF : this.charAt(state.offset);
|
|
9041
9068
|
}
|
|
9069
|
+
locationFromCursor(cursor) {
|
|
9070
|
+
return new ParseLocation(cursor.file, cursor.state.offset, cursor.state.line, cursor.state.column);
|
|
9071
|
+
}
|
|
9042
9072
|
}
|
|
9043
9073
|
class EscapedCharacterCursor extends PlainCharacterCursor {
|
|
9044
9074
|
constructor(fileOrCursor, range) {
|
|
@@ -9296,7 +9326,7 @@ define(['exports', 'typescript/lib/tsserverlibrary', 'typescript', 'path'], func
|
|
|
9296
9326
|
this.errors.push(TreeError.create(null, this._peek.sourceSpan, `Invalid ICU message. Missing '}'.`));
|
|
9297
9327
|
return;
|
|
9298
9328
|
}
|
|
9299
|
-
const sourceSpan = new ParseSourceSpan(token.sourceSpan.start, this._peek.sourceSpan.end);
|
|
9329
|
+
const sourceSpan = new ParseSourceSpan(token.sourceSpan.start, this._peek.sourceSpan.end, token.sourceSpan.fullStart);
|
|
9300
9330
|
this._addToParent(new Expansion(switchValue.parts[0], type.parts[0], cases, sourceSpan, switchValue.sourceSpan));
|
|
9301
9331
|
this._advance();
|
|
9302
9332
|
}
|
|
@@ -9321,8 +9351,8 @@ define(['exports', 'typescript/lib/tsserverlibrary', 'typescript', 'path'], func
|
|
|
9321
9351
|
this.errors = this.errors.concat(expansionCaseParser.errors);
|
|
9322
9352
|
return null;
|
|
9323
9353
|
}
|
|
9324
|
-
const sourceSpan = new ParseSourceSpan(value.sourceSpan.start, end.sourceSpan.end);
|
|
9325
|
-
const expSourceSpan = new ParseSourceSpan(start.sourceSpan.start, end.sourceSpan.end);
|
|
9354
|
+
const sourceSpan = new ParseSourceSpan(value.sourceSpan.start, end.sourceSpan.end, value.sourceSpan.fullStart);
|
|
9355
|
+
const expSourceSpan = new ParseSourceSpan(start.sourceSpan.start, end.sourceSpan.end, start.sourceSpan.fullStart);
|
|
9326
9356
|
return new ExpansionCase(value.parts[0], expansionCaseParser.rootNodes, sourceSpan, value.sourceSpan, expSourceSpan);
|
|
9327
9357
|
}
|
|
9328
9358
|
_collectExpansionExpTokens(start) {
|
|
@@ -9403,8 +9433,10 @@ define(['exports', 'typescript/lib/tsserverlibrary', 'typescript', 'path'], func
|
|
|
9403
9433
|
selfClosing = false;
|
|
9404
9434
|
}
|
|
9405
9435
|
const end = this._peek.sourceSpan.start;
|
|
9406
|
-
const span = new ParseSourceSpan(startTagToken.sourceSpan.start, end);
|
|
9407
|
-
|
|
9436
|
+
const span = new ParseSourceSpan(startTagToken.sourceSpan.start, end, startTagToken.sourceSpan.fullStart);
|
|
9437
|
+
// Create a separate `startSpan` because `span` may be modified when there is an `end` span.
|
|
9438
|
+
const startSpan = new ParseSourceSpan(startTagToken.sourceSpan.start, end, startTagToken.sourceSpan.fullStart);
|
|
9439
|
+
const el = new Element$1(fullName, attrs, [], span, startSpan, undefined);
|
|
9408
9440
|
this._pushElement(el);
|
|
9409
9441
|
if (selfClosing) {
|
|
9410
9442
|
// Elements that are self-closed have their `endSourceSpan` set to the full span, as the
|
|
@@ -9465,7 +9497,7 @@ define(['exports', 'typescript/lib/tsserverlibrary', 'typescript', 'path'], func
|
|
|
9465
9497
|
const quoteToken = this._advance();
|
|
9466
9498
|
end = quoteToken.sourceSpan.end;
|
|
9467
9499
|
}
|
|
9468
|
-
return new Attribute(fullName, value, new ParseSourceSpan(attrName.sourceSpan.start, end), valueSpan);
|
|
9500
|
+
return new Attribute(fullName, value, new ParseSourceSpan(attrName.sourceSpan.start, end, attrName.sourceSpan.fullStart), valueSpan);
|
|
9469
9501
|
}
|
|
9470
9502
|
_getParentElement() {
|
|
9471
9503
|
return this._elementStack.length > 0 ? this._elementStack[this._elementStack.length - 1] : null;
|
|
@@ -10848,7 +10880,7 @@ define(['exports', 'typescript/lib/tsserverlibrary', 'typescript', 'path'], func
|
|
|
10848
10880
|
// The difference of two absolute offsets provide the relative offset
|
|
10849
10881
|
const startDiff = absoluteSpan.start - sourceSpan.start.offset;
|
|
10850
10882
|
const endDiff = absoluteSpan.end - sourceSpan.end.offset;
|
|
10851
|
-
return new ParseSourceSpan(sourceSpan.start.moveBy(startDiff), sourceSpan.end.moveBy(endDiff));
|
|
10883
|
+
return new ParseSourceSpan(sourceSpan.start.moveBy(startDiff), sourceSpan.end.moveBy(endDiff), sourceSpan.fullStart.moveBy(startDiff), sourceSpan.details);
|
|
10852
10884
|
}
|
|
10853
10885
|
|
|
10854
10886
|
/**
|
|
@@ -11335,7 +11367,7 @@ define(['exports', 'typescript/lib/tsserverlibrary', 'typescript', 'path'], func
|
|
|
11335
11367
|
const matchedReferences = new Set();
|
|
11336
11368
|
let component = null;
|
|
11337
11369
|
const directiveAsts = directives.map((directive) => {
|
|
11338
|
-
const sourceSpan = new ParseSourceSpan(elementSourceSpan.start, elementSourceSpan.end, `Directive ${identifierName(directive.type)}`);
|
|
11370
|
+
const sourceSpan = new ParseSourceSpan(elementSourceSpan.start, elementSourceSpan.end, elementSourceSpan.fullStart, `Directive ${identifierName(directive.type)}`);
|
|
11339
11371
|
if (directive.isComponent) {
|
|
11340
11372
|
component = directive;
|
|
11341
11373
|
}
|
|
@@ -15041,7 +15073,7 @@ define(['exports', 'typescript/lib/tsserverlibrary', 'typescript', 'path'], func
|
|
|
15041
15073
|
}
|
|
15042
15074
|
}
|
|
15043
15075
|
function getOffsetSourceSpan(sourceSpan, { start, end }) {
|
|
15044
|
-
return new ParseSourceSpan(sourceSpan.
|
|
15076
|
+
return new ParseSourceSpan(sourceSpan.fullStart.moveBy(start), sourceSpan.fullStart.moveBy(end));
|
|
15045
15077
|
}
|
|
15046
15078
|
const _CUSTOM_PH_EXP = /\/\/[\s\S]*i18n[\s\S]*\([\s\S]*ph[\s\S]*=[\s\S]*("|')([\s\S]*?)\1[\s\S]*\)/g;
|
|
15047
15079
|
function _extractPlaceholderName(input) {
|
|
@@ -15377,7 +15409,7 @@ define(['exports', 'typescript/lib/tsserverlibrary', 'typescript', 'path'], func
|
|
|
15377
15409
|
function getSourceSpan(message) {
|
|
15378
15410
|
const startNode = message.nodes[0];
|
|
15379
15411
|
const endNode = message.nodes[message.nodes.length - 1];
|
|
15380
|
-
return new ParseSourceSpan(startNode.sourceSpan.start, endNode.sourceSpan.end, startNode.sourceSpan.details);
|
|
15412
|
+
return new ParseSourceSpan(startNode.sourceSpan.start, endNode.sourceSpan.end, startNode.sourceSpan.fullStart, startNode.sourceSpan.details);
|
|
15381
15413
|
}
|
|
15382
15414
|
/**
|
|
15383
15415
|
* Convert the list of serialized MessagePieces into two arrays.
|
|
@@ -15404,7 +15436,7 @@ define(['exports', 'typescript/lib/tsserverlibrary', 'typescript', 'path'], func
|
|
|
15404
15436
|
placeHolders.push(part);
|
|
15405
15437
|
if (pieces[i - 1] instanceof PlaceholderPiece) {
|
|
15406
15438
|
// There were two placeholders in a row, so we need to add an empty message part.
|
|
15407
|
-
messageParts.push(createEmptyMessagePart(
|
|
15439
|
+
messageParts.push(createEmptyMessagePart(pieces[i - 1].sourceSpan.end));
|
|
15408
15440
|
}
|
|
15409
15441
|
}
|
|
15410
15442
|
}
|
|
@@ -17963,7 +17995,7 @@ define(['exports', 'typescript/lib/tsserverlibrary', 'typescript', 'path'], func
|
|
|
17963
17995
|
* Use of this source code is governed by an MIT-style license that can be
|
|
17964
17996
|
* found in the LICENSE file at https://angular.io/license
|
|
17965
17997
|
*/
|
|
17966
|
-
const VERSION$1 = new Version('10.2.
|
|
17998
|
+
const VERSION$1 = new Version('10.2.5');
|
|
17967
17999
|
|
|
17968
18000
|
/**
|
|
17969
18001
|
* @license
|
|
@@ -18536,6 +18568,7 @@ define(['exports', 'typescript/lib/tsserverlibrary', 'typescript', 'path'], func
|
|
|
18536
18568
|
* found in the LICENSE file at https://angular.io/license
|
|
18537
18569
|
*/
|
|
18538
18570
|
const ERROR_COMPONENT_TYPE = 'ngComponentType';
|
|
18571
|
+
const MISSING_NG_MODULE_METADATA_ERROR_DATA = 'ngMissingNgModuleMetadataErrorData';
|
|
18539
18572
|
// Design notes:
|
|
18540
18573
|
// - don't lazily create metadata:
|
|
18541
18574
|
// For some metadata, we need to do async work sometimes,
|
|
@@ -19003,7 +19036,16 @@ define(['exports', 'typescript/lib/tsserverlibrary', 'typescript', 'path'], func
|
|
|
19003
19036
|
const importedModuleSummary = this.getNgModuleSummary(importedModuleType, alreadyCollecting);
|
|
19004
19037
|
alreadyCollecting.delete(importedModuleType);
|
|
19005
19038
|
if (!importedModuleSummary) {
|
|
19006
|
-
|
|
19039
|
+
const err = syntaxError(`Unexpected ${this._getTypeDescriptor(importedType)} '${stringifyType(importedType)}' imported by the module '${stringifyType(moduleType)}'. Please add a @NgModule annotation.`);
|
|
19040
|
+
// If possible, record additional context for this error to enable more useful
|
|
19041
|
+
// diagnostics on the compiler side.
|
|
19042
|
+
if (importedType instanceof StaticSymbol) {
|
|
19043
|
+
err[MISSING_NG_MODULE_METADATA_ERROR_DATA] = {
|
|
19044
|
+
fileName: importedType.filePath,
|
|
19045
|
+
className: importedType.name,
|
|
19046
|
+
};
|
|
19047
|
+
}
|
|
19048
|
+
this._reportError(err, moduleType);
|
|
19007
19049
|
return;
|
|
19008
19050
|
}
|
|
19009
19051
|
importedModules.push(importedModuleSummary);
|
|
@@ -34115,7 +34157,7 @@ define(['exports', 'typescript/lib/tsserverlibrary', 'typescript', 'path'], func
|
|
|
34115
34157
|
/**
|
|
34116
34158
|
* @publicApi
|
|
34117
34159
|
*/
|
|
34118
|
-
const VERSION$2 = new Version$1('10.2.
|
|
34160
|
+
const VERSION$2 = new Version$1('10.2.5');
|
|
34119
34161
|
|
|
34120
34162
|
/**
|
|
34121
34163
|
* @license
|