@angular/language-service 11.2.5 → 11.2.9
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 +1306 -628
- package/bundles/language-service.js +121 -51
- package/ivy/compiler_factory.js +9 -3
- package/ivy/language_service.d.ts +20 -1
- package/ivy/language_service.js +158 -124
- package/ivy/references.js +98 -82
- package/package.json +1 -1
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
/**
|
|
2
|
-
* @license Angular v11.2.
|
|
2
|
+
* @license Angular v11.2.9
|
|
3
3
|
* Copyright Google LLC All Rights Reserved.
|
|
4
4
|
* License: MIT
|
|
5
5
|
*/
|
|
@@ -3914,6 +3914,21 @@ define(['exports', 'typescript/lib/tsserverlibrary', 'typescript', 'path'], func
|
|
|
3914
3914
|
* Use of this source code is governed by an MIT-style license that can be
|
|
3915
3915
|
* found in the LICENSE file at https://angular.io/license
|
|
3916
3916
|
*/
|
|
3917
|
+
/**
|
|
3918
|
+
* This is an R3 `Node`-like wrapper for a raw `html.Comment` node. We do not currently
|
|
3919
|
+
* require the implementation of a visitor for Comments as they are only collected at
|
|
3920
|
+
* the top-level of the R3 AST, and only if `Render3ParseOptions['collectCommentNodes']`
|
|
3921
|
+
* is true.
|
|
3922
|
+
*/
|
|
3923
|
+
class Comment {
|
|
3924
|
+
constructor(value, sourceSpan) {
|
|
3925
|
+
this.value = value;
|
|
3926
|
+
this.sourceSpan = sourceSpan;
|
|
3927
|
+
}
|
|
3928
|
+
visit(_visitor) {
|
|
3929
|
+
throw new Error('visit() not implemented for Comment');
|
|
3930
|
+
}
|
|
3931
|
+
}
|
|
3917
3932
|
class Text {
|
|
3918
3933
|
constructor(value, sourceSpan) {
|
|
3919
3934
|
this.value = value;
|
|
@@ -8596,6 +8611,7 @@ define(['exports', 'typescript/lib/tsserverlibrary', 'typescript', 'path'], func
|
|
|
8596
8611
|
*/
|
|
8597
8612
|
function combineHostContextSelectors(contextSelectors, otherSelectors) {
|
|
8598
8613
|
const hostMarker = _polyfillHostNoCombinator;
|
|
8614
|
+
_polyfillHostRe.lastIndex = 0; // reset the regex to ensure we get an accurate test
|
|
8599
8615
|
const otherSelectorsHasHost = _polyfillHostRe.test(otherSelectors);
|
|
8600
8616
|
// If there are no context selectors then just output a host marker
|
|
8601
8617
|
if (contextSelectors.length === 0) {
|
|
@@ -8784,7 +8800,7 @@ define(['exports', 'typescript/lib/tsserverlibrary', 'typescript', 'path'], func
|
|
|
8784
8800
|
return visitor.visitElement(this, context);
|
|
8785
8801
|
}
|
|
8786
8802
|
}
|
|
8787
|
-
class Comment {
|
|
8803
|
+
class Comment$1 {
|
|
8788
8804
|
constructor(value, sourceSpan) {
|
|
8789
8805
|
this.value = value;
|
|
8790
8806
|
this.sourceSpan = sourceSpan;
|
|
@@ -9842,7 +9858,7 @@ define(['exports', 'typescript/lib/tsserverlibrary', 'typescript', 'path'], func
|
|
|
9842
9858
|
const text = this._advanceIf(TokenType.RAW_TEXT);
|
|
9843
9859
|
this._advanceIf(TokenType.COMMENT_END);
|
|
9844
9860
|
const value = text != null ? text.parts[0].trim() : null;
|
|
9845
|
-
this._addToParent(new Comment(value, token.sourceSpan));
|
|
9861
|
+
this._addToParent(new Comment$1(value, token.sourceSpan));
|
|
9846
9862
|
}
|
|
9847
9863
|
_consumeExpansion(token) {
|
|
9848
9864
|
const switchValue = this._advance();
|
|
@@ -12536,7 +12552,11 @@ define(['exports', 'typescript/lib/tsserverlibrary', 'typescript', 'path'], func
|
|
|
12536
12552
|
if (isEmptyExpression(value)) {
|
|
12537
12553
|
return null;
|
|
12538
12554
|
}
|
|
12539
|
-
|
|
12555
|
+
// CSS custom properties are case-sensitive so we shouldn't normalize them.
|
|
12556
|
+
// See: https://www.w3.org/TR/css-variables-1/#defining-variables
|
|
12557
|
+
if (!isCssCustomProperty(name)) {
|
|
12558
|
+
name = hyphenate(name);
|
|
12559
|
+
}
|
|
12540
12560
|
const { property, hasOverrideFlag, suffix: bindingSuffix } = parseProperty(name);
|
|
12541
12561
|
suffix = typeof suffix === 'string' && suffix.length !== 0 ? suffix : bindingSuffix;
|
|
12542
12562
|
const entry = { name: property, suffix: suffix, value, sourceSpan, hasOverrideFlag };
|
|
@@ -12560,9 +12580,6 @@ define(['exports', 'typescript/lib/tsserverlibrary', 'typescript', 'path'], func
|
|
|
12560
12580
|
const { property, hasOverrideFlag } = parseProperty(name);
|
|
12561
12581
|
const entry = { name: property, value, sourceSpan, hasOverrideFlag, suffix: null };
|
|
12562
12582
|
if (isMapBased) {
|
|
12563
|
-
if (this._classMapInput) {
|
|
12564
|
-
throw new Error('[class] and [className] bindings cannot be used on the same element simultaneously');
|
|
12565
|
-
}
|
|
12566
12583
|
this._classMapInput = entry;
|
|
12567
12584
|
}
|
|
12568
12585
|
else {
|
|
@@ -12884,8 +12901,12 @@ define(['exports', 'typescript/lib/tsserverlibrary', 'typescript', 'path'], func
|
|
|
12884
12901
|
return Identifiers$1.stylePropInterpolateV;
|
|
12885
12902
|
}
|
|
12886
12903
|
}
|
|
12887
|
-
|
|
12888
|
-
|
|
12904
|
+
/**
|
|
12905
|
+
* Checks whether property name is a custom CSS property.
|
|
12906
|
+
* See: https://www.w3.org/TR/css-variables-1
|
|
12907
|
+
*/
|
|
12908
|
+
function isCssCustomProperty(name) {
|
|
12909
|
+
return name.startsWith('--');
|
|
12889
12910
|
}
|
|
12890
12911
|
|
|
12891
12912
|
/**
|
|
@@ -15003,26 +15024,33 @@ define(['exports', 'typescript/lib/tsserverlibrary', 'typescript', 'path'], func
|
|
|
15003
15024
|
EVENT: { start: '(', end: ')' },
|
|
15004
15025
|
};
|
|
15005
15026
|
const TEMPLATE_ATTR_PREFIX$2 = '*';
|
|
15006
|
-
function htmlAstToRender3Ast(htmlNodes, bindingParser) {
|
|
15007
|
-
const transformer = new HtmlAstToIvyAst(bindingParser);
|
|
15027
|
+
function htmlAstToRender3Ast(htmlNodes, bindingParser, options) {
|
|
15028
|
+
const transformer = new HtmlAstToIvyAst(bindingParser, options);
|
|
15008
15029
|
const ivyNodes = visitAll$1(transformer, htmlNodes);
|
|
15009
15030
|
// Errors might originate in either the binding parser or the html to ivy transformer
|
|
15010
15031
|
const allErrors = bindingParser.errors.concat(transformer.errors);
|
|
15011
|
-
|
|
15032
|
+
const result = {
|
|
15012
15033
|
nodes: ivyNodes,
|
|
15013
15034
|
errors: allErrors,
|
|
15014
15035
|
styleUrls: transformer.styleUrls,
|
|
15015
15036
|
styles: transformer.styles,
|
|
15016
|
-
ngContentSelectors: transformer.ngContentSelectors
|
|
15037
|
+
ngContentSelectors: transformer.ngContentSelectors
|
|
15017
15038
|
};
|
|
15039
|
+
if (options.collectCommentNodes) {
|
|
15040
|
+
result.commentNodes = transformer.commentNodes;
|
|
15041
|
+
}
|
|
15042
|
+
return result;
|
|
15018
15043
|
}
|
|
15019
15044
|
class HtmlAstToIvyAst {
|
|
15020
|
-
constructor(bindingParser) {
|
|
15045
|
+
constructor(bindingParser, options) {
|
|
15021
15046
|
this.bindingParser = bindingParser;
|
|
15047
|
+
this.options = options;
|
|
15022
15048
|
this.errors = [];
|
|
15023
15049
|
this.styles = [];
|
|
15024
15050
|
this.styleUrls = [];
|
|
15025
15051
|
this.ngContentSelectors = [];
|
|
15052
|
+
// This array will be populated if `Render3ParseOptions['collectCommentNodes']` is true
|
|
15053
|
+
this.commentNodes = [];
|
|
15026
15054
|
this.inI18nBlock = false;
|
|
15027
15055
|
}
|
|
15028
15056
|
// HTML visitor
|
|
@@ -15191,6 +15219,9 @@ define(['exports', 'typescript/lib/tsserverlibrary', 'typescript', 'path'], func
|
|
|
15191
15219
|
return null;
|
|
15192
15220
|
}
|
|
15193
15221
|
visitComment(comment) {
|
|
15222
|
+
if (this.options.collectCommentNodes) {
|
|
15223
|
+
this.commentNodes.push(new Comment(comment.value || '', comment.sourceSpan));
|
|
15224
|
+
}
|
|
15194
15225
|
return null;
|
|
15195
15226
|
}
|
|
15196
15227
|
// convert view engine `ParsedProperty` to a format suitable for IVY
|
|
@@ -15382,7 +15413,7 @@ define(['exports', 'typescript/lib/tsserverlibrary', 'typescript', 'path'], func
|
|
|
15382
15413
|
return node instanceof Text$2 && node.value.trim().length == 0;
|
|
15383
15414
|
}
|
|
15384
15415
|
function isCommentNode(node) {
|
|
15385
|
-
return node instanceof Comment;
|
|
15416
|
+
return node instanceof Comment$1;
|
|
15386
15417
|
}
|
|
15387
15418
|
function textContents(node) {
|
|
15388
15419
|
if (node.children.length !== 1 || !(node.children[0] instanceof Text$2)) {
|
|
@@ -17959,7 +17990,7 @@ define(['exports', 'typescript/lib/tsserverlibrary', 'typescript', 'path'], func
|
|
|
17959
17990
|
const parseResult = htmlParser.parse(template, templateUrl, Object.assign(Object.assign({ leadingTriviaChars: LEADING_TRIVIA_CHARS }, options), { tokenizeExpansionForms: true }));
|
|
17960
17991
|
if (!options.alwaysAttemptHtmlToR3AstConversion && parseResult.errors &&
|
|
17961
17992
|
parseResult.errors.length > 0) {
|
|
17962
|
-
|
|
17993
|
+
const parsedTemplate = {
|
|
17963
17994
|
interpolationConfig,
|
|
17964
17995
|
preserveWhitespaces,
|
|
17965
17996
|
template,
|
|
@@ -17971,6 +18002,10 @@ define(['exports', 'typescript/lib/tsserverlibrary', 'typescript', 'path'], func
|
|
|
17971
18002
|
styles: [],
|
|
17972
18003
|
ngContentSelectors: []
|
|
17973
18004
|
};
|
|
18005
|
+
if (options.collectCommentNodes) {
|
|
18006
|
+
parsedTemplate.commentNodes = [];
|
|
18007
|
+
}
|
|
18008
|
+
return parsedTemplate;
|
|
17974
18009
|
}
|
|
17975
18010
|
let rootNodes = parseResult.rootNodes;
|
|
17976
18011
|
// process i18n meta information (scan attributes, generate ids)
|
|
@@ -17981,7 +18016,7 @@ define(['exports', 'typescript/lib/tsserverlibrary', 'typescript', 'path'], func
|
|
|
17981
18016
|
const i18nMetaResult = i18nMetaVisitor.visitAllWithErrors(rootNodes);
|
|
17982
18017
|
if (!options.alwaysAttemptHtmlToR3AstConversion && i18nMetaResult.errors &&
|
|
17983
18018
|
i18nMetaResult.errors.length > 0) {
|
|
17984
|
-
|
|
18019
|
+
const parsedTemplate = {
|
|
17985
18020
|
interpolationConfig,
|
|
17986
18021
|
preserveWhitespaces,
|
|
17987
18022
|
template,
|
|
@@ -17993,6 +18028,10 @@ define(['exports', 'typescript/lib/tsserverlibrary', 'typescript', 'path'], func
|
|
|
17993
18028
|
styles: [],
|
|
17994
18029
|
ngContentSelectors: []
|
|
17995
18030
|
};
|
|
18031
|
+
if (options.collectCommentNodes) {
|
|
18032
|
+
parsedTemplate.commentNodes = [];
|
|
18033
|
+
}
|
|
18034
|
+
return parsedTemplate;
|
|
17996
18035
|
}
|
|
17997
18036
|
rootNodes = i18nMetaResult.rootNodes;
|
|
17998
18037
|
if (!preserveWhitespaces) {
|
|
@@ -18005,9 +18044,9 @@ define(['exports', 'typescript/lib/tsserverlibrary', 'typescript', 'path'], func
|
|
|
18005
18044
|
rootNodes = visitAll$1(new I18nMetaVisitor(interpolationConfig, /* keepI18nAttrs */ false), rootNodes);
|
|
18006
18045
|
}
|
|
18007
18046
|
}
|
|
18008
|
-
const { nodes, errors, styleUrls, styles, ngContentSelectors } = htmlAstToRender3Ast(rootNodes, bindingParser);
|
|
18047
|
+
const { nodes, errors, styleUrls, styles, ngContentSelectors, commentNodes } = htmlAstToRender3Ast(rootNodes, bindingParser, { collectCommentNodes: !!options.collectCommentNodes });
|
|
18009
18048
|
errors.push(...parseResult.errors, ...i18nMetaResult.errors);
|
|
18010
|
-
|
|
18049
|
+
const parsedTemplate = {
|
|
18011
18050
|
interpolationConfig,
|
|
18012
18051
|
preserveWhitespaces,
|
|
18013
18052
|
errors: errors.length > 0 ? errors : null,
|
|
@@ -18019,6 +18058,10 @@ define(['exports', 'typescript/lib/tsserverlibrary', 'typescript', 'path'], func
|
|
|
18019
18058
|
styles,
|
|
18020
18059
|
ngContentSelectors
|
|
18021
18060
|
};
|
|
18061
|
+
if (options.collectCommentNodes) {
|
|
18062
|
+
parsedTemplate.commentNodes = commentNodes;
|
|
18063
|
+
}
|
|
18064
|
+
return parsedTemplate;
|
|
18022
18065
|
}
|
|
18023
18066
|
const elementRegistry = new DomElementSchemaRegistry();
|
|
18024
18067
|
/**
|
|
@@ -19137,7 +19180,7 @@ define(['exports', 'typescript/lib/tsserverlibrary', 'typescript', 'path'], func
|
|
|
19137
19180
|
* Use of this source code is governed by an MIT-style license that can be
|
|
19138
19181
|
* found in the LICENSE file at https://angular.io/license
|
|
19139
19182
|
*/
|
|
19140
|
-
const VERSION$1 = new Version('11.2.
|
|
19183
|
+
const VERSION$1 = new Version('11.2.9');
|
|
19141
19184
|
|
|
19142
19185
|
/**
|
|
19143
19186
|
* @license
|
|
@@ -27577,6 +27620,28 @@ define(['exports', 'typescript/lib/tsserverlibrary', 'typescript', 'path'], func
|
|
|
27577
27620
|
Object.freeze(EMPTY_ARRAY);
|
|
27578
27621
|
}
|
|
27579
27622
|
|
|
27623
|
+
/**
|
|
27624
|
+
* @license
|
|
27625
|
+
* Copyright Google LLC All Rights Reserved.
|
|
27626
|
+
*
|
|
27627
|
+
* Use of this source code is governed by an MIT-style license that can be
|
|
27628
|
+
* found in the LICENSE file at https://angular.io/license
|
|
27629
|
+
*/
|
|
27630
|
+
/**
|
|
27631
|
+
* This file contains reuseable "empty" symbols that can be used as default return values
|
|
27632
|
+
* in different parts of the rendering code. Because the same symbols are returned, this
|
|
27633
|
+
* allows for identity checks against these values to be consistently used by the framework
|
|
27634
|
+
* code.
|
|
27635
|
+
*/
|
|
27636
|
+
const EMPTY_ARRAY$1 = [];
|
|
27637
|
+
// freezing the values prevents any code from accidentally inserting new values in
|
|
27638
|
+
if ((typeof ngDevMode === 'undefined' || ngDevMode) && initNgDevMode()) {
|
|
27639
|
+
// These property accesses can be ignored because ngDevMode will be set to false
|
|
27640
|
+
// when optimizing code and the whole if statement will be dropped.
|
|
27641
|
+
// tslint:disable-next-line:no-toplevel-property-access
|
|
27642
|
+
Object.freeze(EMPTY_ARRAY$1);
|
|
27643
|
+
}
|
|
27644
|
+
|
|
27580
27645
|
/**
|
|
27581
27646
|
* @license
|
|
27582
27647
|
* Copyright Google LLC All Rights Reserved.
|
|
@@ -27937,6 +28002,25 @@ define(['exports', 'typescript/lib/tsserverlibrary', 'typescript', 'path'], func
|
|
|
27937
28002
|
return instance[SIMPLE_CHANGES_STORE] = store;
|
|
27938
28003
|
}
|
|
27939
28004
|
|
|
28005
|
+
/**
|
|
28006
|
+
* @license
|
|
28007
|
+
* Copyright Google LLC All Rights Reserved.
|
|
28008
|
+
*
|
|
28009
|
+
* Use of this source code is governed by an MIT-style license that can be
|
|
28010
|
+
* found in the LICENSE file at https://angular.io/license
|
|
28011
|
+
*/
|
|
28012
|
+
/**
|
|
28013
|
+
* Profiler function which wraps user code executed by the runtime.
|
|
28014
|
+
*
|
|
28015
|
+
* @param event ProfilerEvent corresponding to the execution context
|
|
28016
|
+
* @param instance component instance
|
|
28017
|
+
* @param hookOrListener lifecycle hook function or output listener. The value depends on the
|
|
28018
|
+
* execution context
|
|
28019
|
+
* @returns
|
|
28020
|
+
*/
|
|
28021
|
+
const profiler = function (event, instance, hookOrListener) {
|
|
28022
|
+
};
|
|
28023
|
+
|
|
27940
28024
|
/**
|
|
27941
28025
|
* @license
|
|
27942
28026
|
* Copyright Google LLC All Rights Reserved.
|
|
@@ -28640,11 +28724,19 @@ define(['exports', 'typescript/lib/tsserverlibrary', 'typescript', 'path'], func
|
|
|
28640
28724
|
(currentView[PREORDER_HOOK_FLAGS] >> 16 /* NumberOfInitHooksCalledShift */) &&
|
|
28641
28725
|
(currentView[FLAGS] & 3 /* InitPhaseStateMask */) === initPhase) {
|
|
28642
28726
|
currentView[FLAGS] += 2048 /* IndexWithinInitPhaseIncrementer */;
|
|
28643
|
-
|
|
28727
|
+
try {
|
|
28728
|
+
hook.call(directive);
|
|
28729
|
+
}
|
|
28730
|
+
finally {
|
|
28731
|
+
}
|
|
28644
28732
|
}
|
|
28645
28733
|
}
|
|
28646
28734
|
else {
|
|
28647
|
-
|
|
28735
|
+
try {
|
|
28736
|
+
hook.call(directive);
|
|
28737
|
+
}
|
|
28738
|
+
finally {
|
|
28739
|
+
}
|
|
28648
28740
|
}
|
|
28649
28741
|
}
|
|
28650
28742
|
|
|
@@ -32571,13 +32663,16 @@ define(['exports', 'typescript/lib/tsserverlibrary', 'typescript', 'path'], func
|
|
|
32571
32663
|
}
|
|
32572
32664
|
function executeTemplate(tView, lView, templateFn, rf, context) {
|
|
32573
32665
|
const prevSelectedIndex = getSelectedIndex();
|
|
32666
|
+
const isUpdatePhase = rf & 2 /* Update */;
|
|
32574
32667
|
try {
|
|
32575
32668
|
setSelectedIndex(-1);
|
|
32576
|
-
if (
|
|
32669
|
+
if (isUpdatePhase && lView.length > HEADER_OFFSET) {
|
|
32577
32670
|
// When we're updating, inherently select 0 so we don't
|
|
32578
32671
|
// have to generate that instruction for most update blocks.
|
|
32579
32672
|
selectIndexInternal(tView, lView, HEADER_OFFSET, isInCheckNoChangesMode());
|
|
32580
32673
|
}
|
|
32674
|
+
const preHookType = isUpdatePhase ? 2 /* TemplateUpdateStart */ : 0 /* TemplateCreateStart */;
|
|
32675
|
+
profiler(preHookType, context);
|
|
32581
32676
|
templateFn(rf, context);
|
|
32582
32677
|
}
|
|
32583
32678
|
finally {
|
|
@@ -33849,7 +33944,7 @@ define(['exports', 'typescript/lib/tsserverlibrary', 'typescript', 'path'], func
|
|
|
33849
33944
|
*/
|
|
33850
33945
|
const ɵ0$7 = getClosureSafeProperty;
|
|
33851
33946
|
const USE_VALUE$4 = getClosureSafeProperty({ provide: String, useValue: ɵ0$7 });
|
|
33852
|
-
const EMPTY_ARRAY$
|
|
33947
|
+
const EMPTY_ARRAY$2 = [];
|
|
33853
33948
|
function convertInjectableProviderToFactory(type, provider) {
|
|
33854
33949
|
if (!provider) {
|
|
33855
33950
|
const reflectionCapabilities = new ReflectionCapabilities();
|
|
@@ -33867,7 +33962,7 @@ define(['exports', 'typescript/lib/tsserverlibrary', 'typescript', 'path'], func
|
|
|
33867
33962
|
}
|
|
33868
33963
|
else if (provider.useFactory) {
|
|
33869
33964
|
const factoryProvider = provider;
|
|
33870
|
-
return () => factoryProvider.useFactory(...injectArgs(factoryProvider.deps || EMPTY_ARRAY$
|
|
33965
|
+
return () => factoryProvider.useFactory(...injectArgs(factoryProvider.deps || EMPTY_ARRAY$2));
|
|
33871
33966
|
}
|
|
33872
33967
|
else if (provider.useClass) {
|
|
33873
33968
|
const classProvider = provider;
|
|
@@ -34792,31 +34887,6 @@ define(['exports', 'typescript/lib/tsserverlibrary', 'typescript', 'path'], func
|
|
|
34792
34887
|
return !!obj && typeof obj.then === 'function';
|
|
34793
34888
|
}
|
|
34794
34889
|
|
|
34795
|
-
/**
|
|
34796
|
-
* @license
|
|
34797
|
-
* Copyright Google LLC All Rights Reserved.
|
|
34798
|
-
*
|
|
34799
|
-
* Use of this source code is governed by an MIT-style license that can be
|
|
34800
|
-
* found in the LICENSE file at https://angular.io/license
|
|
34801
|
-
*/
|
|
34802
|
-
/**
|
|
34803
|
-
* This file contains reuseable "empty" symbols that can be used as default return values
|
|
34804
|
-
* in different parts of the rendering code. Because the same symbols are returned, this
|
|
34805
|
-
* allows for identity checks against these values to be consistently used by the framework
|
|
34806
|
-
* code.
|
|
34807
|
-
*/
|
|
34808
|
-
const EMPTY_OBJ$1 = {};
|
|
34809
|
-
const EMPTY_ARRAY$2 = [];
|
|
34810
|
-
// freezing the values prevents any code from accidentally inserting new values in
|
|
34811
|
-
if ((typeof ngDevMode === 'undefined' || ngDevMode) && initNgDevMode()) {
|
|
34812
|
-
// These property accesses can be ignored because ngDevMode will be set to false
|
|
34813
|
-
// when optimizing code and the whole if statement will be dropped.
|
|
34814
|
-
// tslint:disable-next-line:no-toplevel-property-access
|
|
34815
|
-
Object.freeze(EMPTY_OBJ$1);
|
|
34816
|
-
// tslint:disable-next-line:no-toplevel-property-access
|
|
34817
|
-
Object.freeze(EMPTY_ARRAY$2);
|
|
34818
|
-
}
|
|
34819
|
-
|
|
34820
34890
|
/**
|
|
34821
34891
|
* @license
|
|
34822
34892
|
* Copyright Google LLC All Rights Reserved.
|
|
@@ -35162,7 +35232,7 @@ define(['exports', 'typescript/lib/tsserverlibrary', 'typescript', 'path'], func
|
|
|
35162
35232
|
/**
|
|
35163
35233
|
* @publicApi
|
|
35164
35234
|
*/
|
|
35165
|
-
const VERSION$2 = new Version$1('11.2.
|
|
35235
|
+
const VERSION$2 = new Version$1('11.2.9');
|
|
35166
35236
|
|
|
35167
35237
|
/**
|
|
35168
35238
|
* @license
|
package/ivy/compiler_factory.js
CHANGED
|
@@ -47,14 +47,20 @@
|
|
|
47
47
|
var ticket_1 = core_1.resourceChangeTicket(this.compiler, modifiedResourceFiles);
|
|
48
48
|
this.compiler = core_1.NgCompiler.fromTicket(ticket_1, this.adapter);
|
|
49
49
|
}
|
|
50
|
+
else {
|
|
51
|
+
// The previous NgCompiler is being reused, but we still want to reset its performance
|
|
52
|
+
// tracker to capture only the operations that are needed to service the current request.
|
|
53
|
+
this.compiler.perfRecorder.reset();
|
|
54
|
+
}
|
|
50
55
|
return this.compiler;
|
|
51
56
|
}
|
|
52
57
|
var ticket;
|
|
53
58
|
if (this.compiler === null || this.lastKnownProgram === null) {
|
|
54
|
-
ticket = core_1.freshCompilationTicket(program, this.options, this.incrementalStrategy, this.programStrategy,
|
|
59
|
+
ticket = core_1.freshCompilationTicket(program, this.options, this.incrementalStrategy, this.programStrategy,
|
|
60
|
+
/* perfRecorder */ null, true, true);
|
|
55
61
|
}
|
|
56
62
|
else {
|
|
57
|
-
ticket = core_1.incrementalFromCompilerTicket(this.compiler, program, this.incrementalStrategy, this.programStrategy, modifiedResourceFiles);
|
|
63
|
+
ticket = core_1.incrementalFromCompilerTicket(this.compiler, program, this.incrementalStrategy, this.programStrategy, modifiedResourceFiles, /* perfRecorder */ null);
|
|
58
64
|
}
|
|
59
65
|
this.compiler = core_1.NgCompiler.fromTicket(ticket, this.adapter);
|
|
60
66
|
this.lastKnownProgram = program;
|
|
@@ -67,4 +73,4 @@
|
|
|
67
73
|
}());
|
|
68
74
|
exports.CompilerFactory = CompilerFactory;
|
|
69
75
|
});
|
|
70
|
-
//# sourceMappingURL=data:application/json;base64,
|
|
76
|
+
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiY29tcGlsZXJfZmFjdG9yeS5qcyIsInNvdXJjZVJvb3QiOiIiLCJzb3VyY2VzIjpbIi4uLy4uLy4uLy4uLy4uLy4uL3BhY2thZ2VzL2xhbmd1YWdlLXNlcnZpY2UvaXZ5L2NvbXBpbGVyX2ZhY3RvcnkudHMiXSwibmFtZXMiOltdLCJtYXBwaW5ncyI6IkFBQUE7Ozs7OztHQU1HOzs7Ozs7Ozs7Ozs7O0lBRUgsNkRBQWdLO0lBRWhLLDJFQUE0RjtJQVE1Rjs7Ozs7Ozs7T0FRRztJQUNIO1FBS0UseUJBQ3FCLE9BQStCLEVBQy9CLGVBQTRDLEVBQzVDLE9BQTBCO1lBRjFCLFlBQU8sR0FBUCxPQUFPLENBQXdCO1lBQy9CLG9CQUFlLEdBQWYsZUFBZSxDQUE2QjtZQUM1QyxZQUFPLEdBQVAsT0FBTyxDQUFtQjtZQVA5Qix3QkFBbUIsR0FBRyxJQUFJLDZDQUErQixFQUFFLENBQUM7WUFDckUsYUFBUSxHQUFvQixJQUFJLENBQUM7WUFDakMscUJBQWdCLEdBQW9CLElBQUksQ0FBQztRQU05QyxDQUFDO1FBRUoscUNBQVcsR0FBWDs7WUFDRSxJQUFNLE9BQU8sR0FBRyxJQUFJLENBQUMsZUFBZSxDQUFDLFVBQVUsRUFBRSxDQUFDO1lBQ2xELElBQU0scUJBQXFCLFNBQUcsSUFBSSxDQUFDLE9BQU8sQ0FBQyx3QkFBd0IsRUFBRSxtQ0FBSSxJQUFJLEdBQUcsRUFBRSxDQUFDO1lBRW5GLElBQUksSUFBSSxDQUFDLFFBQVEsS0FBSyxJQUFJ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nRhbFN0cmF0ZWd5LCB0aGlzLnByb2dyYW1TdHJhdGVneSxcbiAgICAgICAgICAvKiBwZXJmUmVjb3JkZXIgKi8gbnVsbCwgdHJ1ZSwgdHJ1ZSk7XG4gICAgfSBlbHNlIHtcbiAgICAgIHRpY2tldCA9IGluY3JlbWVudGFsRnJvbUNvbXBpbGVyVGlja2V0KFxuICAgICAgICAgIHRoaXMuY29tcGlsZXIsIHByb2dyYW0sIHRoaXMuaW5jcmVtZW50YWxTdHJhdGVneSwgdGhpcy5wcm9ncmFtU3RyYXRlZ3ksXG4gICAgICAgICAgbW9kaWZpZWRSZXNvdXJjZUZpbGVzLCAvKiBwZXJmUmVjb3JkZXIgKi8gbnVsbCk7XG4gICAgfVxuICAgIHRoaXMuY29tcGlsZXIgPSBOZ0NvbXBpbGVyLmZyb21UaWNrZXQodGlja2V0LCB0aGlzLmFkYXB0ZXIpO1xuICAgIHRoaXMubGFzdEtub3duUHJvZ3JhbSA9IHByb2dyYW07XG4gICAgcmV0dXJuIHRoaXMuY29tcGlsZXI7XG4gIH1cblxuICByZWdpc3Rlckxhc3RLbm93blByb2dyYW0oKSB7XG4gICAgdGhpcy5sYXN0S25vd25Qcm9ncmFtID0gdGhpcy5wcm9ncmFtU3RyYXRlZ3kuZ2V0UHJvZ3JhbSgpO1xuICB9XG59XG4iXX0=
|
|
@@ -32,15 +32,34 @@ export declare class LanguageService {
|
|
|
32
32
|
getDefinitionAndBoundSpan(fileName: string, position: number): ts.DefinitionInfoAndBoundSpan | undefined;
|
|
33
33
|
getTypeDefinitionAtPosition(fileName: string, position: number): readonly ts.DefinitionInfo[] | undefined;
|
|
34
34
|
getQuickInfoAtPosition(fileName: string, position: number): ts.QuickInfo | undefined;
|
|
35
|
+
private getQuickInfoAtPositionImpl;
|
|
35
36
|
getReferencesAtPosition(fileName: string, position: number): ts.ReferenceEntry[] | undefined;
|
|
36
37
|
getRenameInfo(fileName: string, position: number): ts.RenameInfo;
|
|
37
38
|
findRenameLocations(fileName: string, position: number): readonly ts.RenameLocation[] | undefined;
|
|
38
39
|
private getCompletionBuilder;
|
|
39
40
|
getCompletionsAtPosition(fileName: string, position: number, options: ts.GetCompletionsAtPositionOptions | undefined): ts.WithMetadata<ts.CompletionInfo> | undefined;
|
|
41
|
+
private getCompletionsAtPositionImpl;
|
|
40
42
|
getCompletionEntryDetails(fileName: string, position: number, entryName: string, formatOptions: ts.FormatCodeOptions | ts.FormatCodeSettings | undefined, preferences: ts.UserPreferences | undefined): ts.CompletionEntryDetails | undefined;
|
|
41
43
|
getCompletionEntrySymbol(fileName: string, position: number, entryName: string): ts.Symbol | undefined;
|
|
42
44
|
getTcb(fileName: string, position: number): GetTcbResponse | undefined;
|
|
43
|
-
|
|
45
|
+
/**
|
|
46
|
+
* Provides an instance of the `NgCompiler` and traces perf results. Perf results are logged only
|
|
47
|
+
* if the log level is verbose or higher. This method is intended to be called once per public
|
|
48
|
+
* method call.
|
|
49
|
+
*
|
|
50
|
+
* Here is an example of the log output.
|
|
51
|
+
*
|
|
52
|
+
* Perf 245 [16:16:39.353] LanguageService#getQuickInfoAtPosition(): {"events":{},"phases":{
|
|
53
|
+
* "Unaccounted":379,"TtcSymbol":4},"memory":{}}
|
|
54
|
+
*
|
|
55
|
+
* Passing name of caller instead of using `arguments.caller` because 'caller', 'callee', and
|
|
56
|
+
* 'arguments' properties may not be accessed in strict mode.
|
|
57
|
+
*
|
|
58
|
+
* @param phase the `PerfPhase` to execute the `p` callback in
|
|
59
|
+
* @param p callback to be run synchronously with an instance of the `NgCompiler` as argument
|
|
60
|
+
* @return the result of running the `p` callback
|
|
61
|
+
*/
|
|
62
|
+
private withCompilerAndPerfTracing;
|
|
44
63
|
getCompilerOptionsDiagnostics(): ts.Diagnostic[];
|
|
45
64
|
private watchConfigFile;
|
|
46
65
|
}
|