Skip to content

Commit c2d0c26

Browse files
committed
Update LKG
1 parent c48b52f commit c2d0c26

12 files changed

+488
-94
lines changed

lib/lib.d.ts

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -7811,7 +7811,7 @@ interface Document extends Node, GlobalEventHandlers, ParentNode, DocumentEvent
78117811
/**
78127812
* Contains information about the current URL.
78137813
*/
7814-
location: Location | string;
7814+
location: Location;
78157815
msCSSOMElementFloatMetrics: boolean;
78167816
msCapsLockWarningOff: boolean;
78177817
/**
@@ -19066,7 +19066,7 @@ interface Window extends EventTarget, WindowTimers, WindowSessionStorage, Window
1906619066
readonly innerWidth: number;
1906719067
readonly isSecureContext: boolean;
1906819068
readonly length: number;
19069-
location: Location | string;
19069+
location: Location;
1907019070
readonly locationbar: BarProp;
1907119071
readonly menubar: BarProp;
1907219072
readonly msContentScript: ExtensionScriptApis;
@@ -19875,7 +19875,7 @@ declare var innerHeight: number;
1987519875
declare var innerWidth: number;
1987619876
declare var isSecureContext: boolean;
1987719877
declare var length: number;
19878-
declare var location: Location | string;
19878+
declare var location: Location;
1987919879
declare var locationbar: BarProp;
1988019880
declare var menubar: BarProp;
1988119881
declare var msContentScript: ExtensionScriptApis;

lib/lib.dom.d.ts

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -3674,7 +3674,7 @@ interface Document extends Node, GlobalEventHandlers, ParentNode, DocumentEvent
36743674
/**
36753675
* Contains information about the current URL.
36763676
*/
3677-
location: Location | string;
3677+
location: Location;
36783678
msCSSOMElementFloatMetrics: boolean;
36793679
msCapsLockWarningOff: boolean;
36803680
/**
@@ -14929,7 +14929,7 @@ interface Window extends EventTarget, WindowTimers, WindowSessionStorage, Window
1492914929
readonly innerWidth: number;
1493014930
readonly isSecureContext: boolean;
1493114931
readonly length: number;
14932-
location: Location | string;
14932+
location: Location;
1493314933
readonly locationbar: BarProp;
1493414934
readonly menubar: BarProp;
1493514935
readonly msContentScript: ExtensionScriptApis;
@@ -15738,7 +15738,7 @@ declare var innerHeight: number;
1573815738
declare var innerWidth: number;
1573915739
declare var isSecureContext: boolean;
1574015740
declare var length: number;
15741-
declare var location: Location | string;
15741+
declare var location: Location;
1574215742
declare var locationbar: BarProp;
1574315743
declare var menubar: BarProp;
1574415744
declare var msContentScript: ExtensionScriptApis;

lib/lib.es2016.full.d.ts

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -3677,7 +3677,7 @@ interface Document extends Node, GlobalEventHandlers, ParentNode, DocumentEvent
36773677
/**
36783678
* Contains information about the current URL.
36793679
*/
3680-
location: Location | string;
3680+
location: Location;
36813681
msCSSOMElementFloatMetrics: boolean;
36823682
msCapsLockWarningOff: boolean;
36833683
/**
@@ -14932,7 +14932,7 @@ interface Window extends EventTarget, WindowTimers, WindowSessionStorage, Window
1493214932
readonly innerWidth: number;
1493314933
readonly isSecureContext: boolean;
1493414934
readonly length: number;
14935-
location: Location | string;
14935+
location: Location;
1493614936
readonly locationbar: BarProp;
1493714937
readonly menubar: BarProp;
1493814938
readonly msContentScript: ExtensionScriptApis;
@@ -15741,7 +15741,7 @@ declare var innerHeight: number;
1574115741
declare var innerWidth: number;
1574215742
declare var isSecureContext: boolean;
1574315743
declare var length: number;
15744-
declare var location: Location | string;
15744+
declare var location: Location;
1574515745
declare var locationbar: BarProp;
1574615746
declare var menubar: BarProp;
1574715747
declare var msContentScript: ExtensionScriptApis;

lib/lib.es2017.full.d.ts

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -3682,7 +3682,7 @@ interface Document extends Node, GlobalEventHandlers, ParentNode, DocumentEvent
36823682
/**
36833683
* Contains information about the current URL.
36843684
*/
3685-
location: Location | string;
3685+
location: Location;
36863686
msCSSOMElementFloatMetrics: boolean;
36873687
msCapsLockWarningOff: boolean;
36883688
/**
@@ -14937,7 +14937,7 @@ interface Window extends EventTarget, WindowTimers, WindowSessionStorage, Window
1493714937
readonly innerWidth: number;
1493814938
readonly isSecureContext: boolean;
1493914939
readonly length: number;
14940-
location: Location | string;
14940+
location: Location;
1494114941
readonly locationbar: BarProp;
1494214942
readonly menubar: BarProp;
1494314943
readonly msContentScript: ExtensionScriptApis;
@@ -15746,7 +15746,7 @@ declare var innerHeight: number;
1574615746
declare var innerWidth: number;
1574715747
declare var isSecureContext: boolean;
1574815748
declare var length: number;
15749-
declare var location: Location | string;
15749+
declare var location: Location;
1575015750
declare var locationbar: BarProp;
1575115751
declare var menubar: BarProp;
1575215752
declare var msContentScript: ExtensionScriptApis;

lib/lib.es2018.full.d.ts

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -3678,7 +3678,7 @@ interface Document extends Node, GlobalEventHandlers, ParentNode, DocumentEvent
36783678
/**
36793679
* Contains information about the current URL.
36803680
*/
3681-
location: Location | string;
3681+
location: Location;
36823682
msCSSOMElementFloatMetrics: boolean;
36833683
msCapsLockWarningOff: boolean;
36843684
/**
@@ -14933,7 +14933,7 @@ interface Window extends EventTarget, WindowTimers, WindowSessionStorage, Window
1493314933
readonly innerWidth: number;
1493414934
readonly isSecureContext: boolean;
1493514935
readonly length: number;
14936-
location: Location | string;
14936+
location: Location;
1493714937
readonly locationbar: BarProp;
1493814938
readonly menubar: BarProp;
1493914939
readonly msContentScript: ExtensionScriptApis;
@@ -15742,7 +15742,7 @@ declare var innerHeight: number;
1574215742
declare var innerWidth: number;
1574315743
declare var isSecureContext: boolean;
1574415744
declare var length: number;
15745-
declare var location: Location | string;
15745+
declare var location: Location;
1574615746
declare var locationbar: BarProp;
1574715747
declare var menubar: BarProp;
1574815748
declare var msContentScript: ExtensionScriptApis;

lib/lib.es6.d.ts

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -9522,7 +9522,7 @@ interface Document extends Node, GlobalEventHandlers, ParentNode, DocumentEvent
95229522
/**
95239523
* Contains information about the current URL.
95249524
*/
9525-
location: Location | string;
9525+
location: Location;
95269526
msCSSOMElementFloatMetrics: boolean;
95279527
msCapsLockWarningOff: boolean;
95289528
/**
@@ -20777,7 +20777,7 @@ interface Window extends EventTarget, WindowTimers, WindowSessionStorage, Window
2077720777
readonly innerWidth: number;
2077820778
readonly isSecureContext: boolean;
2077920779
readonly length: number;
20780-
location: Location | string;
20780+
location: Location;
2078120781
readonly locationbar: BarProp;
2078220782
readonly menubar: BarProp;
2078320783
readonly msContentScript: ExtensionScriptApis;
@@ -21586,7 +21586,7 @@ declare var innerHeight: number;
2158621586
declare var innerWidth: number;
2158721587
declare var isSecureContext: boolean;
2158821588
declare var length: number;
21589-
declare var location: Location | string;
21589+
declare var location: Location;
2159021590
declare var locationbar: BarProp;
2159121591
declare var menubar: BarProp;
2159221592
declare var msContentScript: ExtensionScriptApis;

lib/lib.esnext.full.d.ts

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -3679,7 +3679,7 @@ interface Document extends Node, GlobalEventHandlers, ParentNode, DocumentEvent
36793679
/**
36803680
* Contains information about the current URL.
36813681
*/
3682-
location: Location | string;
3682+
location: Location;
36833683
msCSSOMElementFloatMetrics: boolean;
36843684
msCapsLockWarningOff: boolean;
36853685
/**
@@ -14934,7 +14934,7 @@ interface Window extends EventTarget, WindowTimers, WindowSessionStorage, Window
1493414934
readonly innerWidth: number;
1493514935
readonly isSecureContext: boolean;
1493614936
readonly length: number;
14937-
location: Location | string;
14937+
location: Location;
1493814938
readonly locationbar: BarProp;
1493914939
readonly menubar: BarProp;
1494014940
readonly msContentScript: ExtensionScriptApis;
@@ -15743,7 +15743,7 @@ declare var innerHeight: number;
1574315743
declare var innerWidth: number;
1574415744
declare var isSecureContext: boolean;
1574515745
declare var length: number;
15746-
declare var location: Location | string;
15746+
declare var location: Location;
1574715747
declare var locationbar: BarProp;
1574815748
declare var menubar: BarProp;
1574915749
declare var msContentScript: ExtensionScriptApis;

lib/tsc.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -62135,7 +62135,7 @@ var ts;
6213562135
}
6213662136
if (options.emitDeclarationOnly) {
6213762137
if (!options.declaration) {
62138-
createDiagnosticForOptionName(ts.Diagnostics.Option_0_cannot_be_specified_without_specifying_option_1, "emitDeclarationOnly", "declarations");
62138+
createDiagnosticForOptionName(ts.Diagnostics.Option_0_cannot_be_specified_without_specifying_option_1, "emitDeclarationOnly", "declaration");
6213962139
}
6214062140
if (options.noEmit) {
6214162141
createDiagnosticForOptionName(ts.Diagnostics.Option_0_cannot_be_specified_with_option_1, "emitDeclarationOnly", "noEmit");

lib/tsserver.js

Lines changed: 106 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -63491,7 +63491,7 @@ var ts;
6349163491
}
6349263492
if (options.emitDeclarationOnly) {
6349363493
if (!options.declaration) {
63494-
createDiagnosticForOptionName(ts.Diagnostics.Option_0_cannot_be_specified_without_specifying_option_1, "emitDeclarationOnly", "declarations");
63494+
createDiagnosticForOptionName(ts.Diagnostics.Option_0_cannot_be_specified_without_specifying_option_1, "emitDeclarationOnly", "declaration");
6349563495
}
6349663496
if (options.noEmit) {
6349763497
createDiagnosticForOptionName(ts.Diagnostics.Option_0_cannot_be_specified_with_option_1, "emitDeclarationOnly", "noEmit");
@@ -66368,6 +66368,88 @@ var ts;
6636866368
return ts.isTemplateLiteralKind(token.kind) && position > token.getStart(sourceFile);
6636966369
}
6637066370
ts.isInTemplateString = isInTemplateString;
66371+
function findPrecedingMatchingToken(token, matchingTokenKind, sourceFile) {
66372+
var tokenKind = token.kind;
66373+
var remainingMatchingTokens = 0;
66374+
while (true) {
66375+
token = findPrecedingToken(token.getFullStart(), sourceFile);
66376+
if (!token) {
66377+
return undefined;
66378+
}
66379+
if (token.kind === matchingTokenKind) {
66380+
if (remainingMatchingTokens === 0) {
66381+
return token;
66382+
}
66383+
remainingMatchingTokens--;
66384+
}
66385+
else if (token.kind === tokenKind) {
66386+
remainingMatchingTokens++;
66387+
}
66388+
}
66389+
}
66390+
ts.findPrecedingMatchingToken = findPrecedingMatchingToken;
66391+
function isPossiblyTypeArgumentPosition(token, sourceFile) {
66392+
var remainingLessThanTokens = 0;
66393+
while (token) {
66394+
switch (token.kind) {
66395+
case 27:
66396+
token = findPrecedingToken(token.getFullStart(), sourceFile);
66397+
var tokenIsIdentifier = token && ts.isIdentifier(token);
66398+
if (!remainingLessThanTokens || !tokenIsIdentifier) {
66399+
return tokenIsIdentifier;
66400+
}
66401+
remainingLessThanTokens--;
66402+
break;
66403+
case 47:
66404+
remainingLessThanTokens = +3;
66405+
break;
66406+
case 46:
66407+
remainingLessThanTokens = +2;
66408+
break;
66409+
case 29:
66410+
remainingLessThanTokens++;
66411+
break;
66412+
case 18:
66413+
token = findPrecedingMatchingToken(token, 17, sourceFile);
66414+
if (!token)
66415+
return false;
66416+
break;
66417+
case 20:
66418+
token = findPrecedingMatchingToken(token, 19, sourceFile);
66419+
if (!token)
66420+
return false;
66421+
break;
66422+
case 22:
66423+
token = findPrecedingMatchingToken(token, 21, sourceFile);
66424+
if (!token)
66425+
return false;
66426+
break;
66427+
case 26:
66428+
case 36:
66429+
case 71:
66430+
case 9:
66431+
case 8:
66432+
case 101:
66433+
case 86:
66434+
case 103:
66435+
case 85:
66436+
case 128:
66437+
case 23:
66438+
case 49:
66439+
case 55:
66440+
case 56:
66441+
break;
66442+
default:
66443+
if (ts.isTypeNode(token)) {
66444+
break;
66445+
}
66446+
return false;
66447+
}
66448+
token = findPrecedingToken(token.getFullStart(), sourceFile);
66449+
}
66450+
return false;
66451+
}
66452+
ts.isPossiblyTypeArgumentPosition = isPossiblyTypeArgumentPosition;
6637166453
function isInComment(sourceFile, position, tokenAtPosition, predicate) {
6637266454
return !!ts.formatting.getRangeOfEnclosingComment(sourceFile, position, false, undefined, tokenAtPosition, predicate);
6637366455
}
@@ -69110,6 +69192,7 @@ var ts;
6911069192
completionKind = 2;
6911169193
var isTypeLocation = insideJsDocTagTypeExpression || ts.isPartOfTypeNode(node.parent);
6911269194
var isRhsOfImportDeclaration = ts.isInRightSideOfInternalImportEqualsDeclaration(node);
69195+
var allowTypeOrValue = isRhsOfImportDeclaration || (!isTypeLocation && ts.isPossiblyTypeArgumentPosition(contextToken, sourceFile));
6911369196
if (ts.isEntityName(node)) {
6911469197
var symbol = typeChecker.getSymbolAtLocation(node);
6911569198
if (symbol) {
@@ -69118,7 +69201,7 @@ var ts;
6911869201
var exportedSymbols = ts.Debug.assertEachDefined(typeChecker.getExportsOfModule(symbol), "getExportsOfModule() should all be defined");
6911969202
var isValidValueAccess_1 = function (symbol) { return typeChecker.isValidPropertyAccess((node.parent), symbol.name); };
6912069203
var isValidTypeAccess_1 = function (symbol) { return symbolCanBeReferencedAtTypeLocation(symbol); };
69121-
var isValidAccess = isRhsOfImportDeclaration ?
69204+
var isValidAccess = allowTypeOrValue ?
6912269205
function (symbol) { return isValidTypeAccess_1(symbol) || isValidValueAccess_1(symbol); } :
6912369206
isTypeLocation ? isValidTypeAccess_1 : isValidValueAccess_1;
6912469207
for (var _i = 0, exportedSymbols_1 = exportedSymbols; _i < exportedSymbols_1.length; _i++) {
@@ -69227,8 +69310,9 @@ var ts;
6922769310
}
6922869311
}
6922969312
function filterGlobalCompletion(symbols) {
69230-
var isTypeCompletion = insideJsDocTagTypeExpression || !isContextTokenValueLocation(contextToken) && (ts.isPartOfTypeNode(location) || isContextTokenTypeLocation(contextToken));
69231-
if (isTypeCompletion)
69313+
var isTypeOnlyCompletion = insideJsDocTagTypeExpression || !isContextTokenValueLocation(contextToken) && (ts.isPartOfTypeNode(location) || isContextTokenTypeLocation(contextToken));
69314+
var allowTypes = isTypeOnlyCompletion || !isContextTokenValueLocation(contextToken) && ts.isPossiblyTypeArgumentPosition(contextToken, sourceFile);
69315+
if (isTypeOnlyCompletion)
6923269316
keywordFilters = 4;
6923369317
ts.filterMutate(symbols, function (symbol) {
6923469318
if (!ts.isSourceFile(location)) {
@@ -69239,8 +69323,11 @@ var ts;
6923969323
if (ts.isInRightSideOfInternalImportEqualsDeclaration(location)) {
6924069324
return !!(symbol.flags & 1920);
6924169325
}
69242-
if (isTypeCompletion) {
69243-
return symbolCanBeReferencedAtTypeLocation(symbol);
69326+
if (allowTypes) {
69327+
var symbolAllowedAsType = symbolCanBeReferencedAtTypeLocation(symbol);
69328+
if (symbolAllowedAsType || isTypeOnlyCompletion) {
69329+
return symbolAllowedAsType;
69330+
}
6924469331
}
6924569332
}
6924669333
return !!(ts.getCombinedLocalAndExportSymbolFlags(symbol) & 67216319);
@@ -69249,7 +69336,7 @@ var ts;
6924969336
function isContextTokenValueLocation(contextToken) {
6925069337
return contextToken &&
6925169338
contextToken.kind === 103 &&
69252-
contextToken.parent.kind === 164;
69339+
(contextToken.parent.kind === 164 || ts.isTypeOfExpression(contextToken.parent));
6925369340
}
6925469341
function isContextTokenTypeLocation(contextToken) {
6925569342
if (contextToken) {
@@ -75262,6 +75349,10 @@ var ts;
7526275349
var SymbolDisplay;
7526375350
(function (SymbolDisplay) {
7526475351
function getSymbolKind(typeChecker, symbol, location) {
75352+
var result = getSymbolKindOfConstructorPropertyMethodAccessorFunctionOrVar(typeChecker, symbol, location);
75353+
if (result !== "") {
75354+
return result;
75355+
}
7526575356
var flags = ts.getCombinedLocalAndExportSymbolFlags(symbol);
7526675357
if (flags & 32) {
7526775358
return ts.getDeclarationOfKind(symbol, 203) ?
@@ -75275,17 +75366,14 @@ var ts;
7527575366
return "interface";
7527675367
if (flags & 262144)
7527775368
return "type parameter";
75278-
var result = getSymbolKindOfConstructorPropertyMethodAccessorFunctionOrVar(typeChecker, symbol, location);
75279-
if (result === "") {
75280-
if (flags & 262144)
75281-
return "type parameter";
75282-
if (flags & 8)
75283-
return "enum member";
75284-
if (flags & 2097152)
75285-
return "alias";
75286-
if (flags & 1536)
75287-
return "module";
75288-
}
75369+
if (flags & 262144)
75370+
return "type parameter";
75371+
if (flags & 8)
75372+
return "enum member";
75373+
if (flags & 2097152)
75374+
return "alias";
75375+
if (flags & 1536)
75376+
return "module";
7528975377
return result;
7529075378
}
7529175379
SymbolDisplay.getSymbolKind = getSymbolKind;

0 commit comments

Comments
 (0)