mirror of
https://github.com/microsoft/TypeScript.git
synced 2025-11-18 17:21:48 +00:00
Update LKG
This commit is contained in:
Vendored
+384
-1
File diff suppressed because it is too large
Load Diff
Vendored
+384
-1
File diff suppressed because it is too large
Load Diff
Vendored
+384
-1
File diff suppressed because it is too large
Load Diff
Vendored
+384
-1
File diff suppressed because it is too large
Load Diff
Vendored
+384
-1
File diff suppressed because it is too large
Load Diff
Vendored
+384
-1
File diff suppressed because it is too large
Load Diff
Vendored
+40
-2
@@ -463,6 +463,8 @@ interface FileReader extends EventTarget, MSBaseReader {
|
||||
readAsText(blob: Blob, encoding?: string): void;
|
||||
addEventListener<K extends keyof MSBaseReaderEventMap>(type: K, listener: (this: FileReader, ev: MSBaseReaderEventMap[K]) => any, useCapture?: boolean): void;
|
||||
addEventListener(type: string, listener: EventListenerOrEventListenerObject, useCapture?: boolean): void;
|
||||
removeEventListener<K extends keyof MSBaseReaderEventMap>(type: K, listener: (this: FileReader, ev: MSBaseReaderEventMap[K]) => any, useCapture?: boolean): void;
|
||||
removeEventListener(type: string, listener: EventListenerOrEventListenerObject, useCapture?: boolean): void;
|
||||
}
|
||||
|
||||
declare var FileReader: {
|
||||
@@ -545,6 +547,8 @@ interface IDBDatabase extends EventTarget {
|
||||
addEventListener(type: "versionchange", listener: (ev: IDBVersionChangeEvent) => any, useCapture?: boolean): void;
|
||||
addEventListener<K extends keyof IDBDatabaseEventMap>(type: K, listener: (this: IDBDatabase, ev: IDBDatabaseEventMap[K]) => any, useCapture?: boolean): void;
|
||||
addEventListener(type: string, listener: EventListenerOrEventListenerObject, useCapture?: boolean): void;
|
||||
removeEventListener<K extends keyof IDBDatabaseEventMap>(type: K, listener: (this: IDBDatabase, ev: IDBDatabaseEventMap[K]) => any, useCapture?: boolean): void;
|
||||
removeEventListener(type: string, listener: EventListenerOrEventListenerObject, useCapture?: boolean): void;
|
||||
}
|
||||
|
||||
declare var IDBDatabase: {
|
||||
@@ -630,6 +634,8 @@ interface IDBOpenDBRequest extends IDBRequest {
|
||||
onupgradeneeded: (this: IDBOpenDBRequest, ev: IDBVersionChangeEvent) => any;
|
||||
addEventListener<K extends keyof IDBOpenDBRequestEventMap>(type: K, listener: (this: IDBOpenDBRequest, ev: IDBOpenDBRequestEventMap[K]) => any, useCapture?: boolean): void;
|
||||
addEventListener(type: string, listener: EventListenerOrEventListenerObject, useCapture?: boolean): void;
|
||||
removeEventListener<K extends keyof IDBOpenDBRequestEventMap>(type: K, listener: (this: IDBOpenDBRequest, ev: IDBOpenDBRequestEventMap[K]) => any, useCapture?: boolean): void;
|
||||
removeEventListener(type: string, listener: EventListenerOrEventListenerObject, useCapture?: boolean): void;
|
||||
}
|
||||
|
||||
declare var IDBOpenDBRequest: {
|
||||
@@ -652,6 +658,8 @@ interface IDBRequest extends EventTarget {
|
||||
readonly transaction: IDBTransaction;
|
||||
addEventListener<K extends keyof IDBRequestEventMap>(type: K, listener: (this: IDBRequest, ev: IDBRequestEventMap[K]) => any, useCapture?: boolean): void;
|
||||
addEventListener(type: string, listener: EventListenerOrEventListenerObject, useCapture?: boolean): void;
|
||||
removeEventListener<K extends keyof IDBRequestEventMap>(type: K, listener: (this: IDBRequest, ev: IDBRequestEventMap[K]) => any, useCapture?: boolean): void;
|
||||
removeEventListener(type: string, listener: EventListenerOrEventListenerObject, useCapture?: boolean): void;
|
||||
}
|
||||
|
||||
declare var IDBRequest: {
|
||||
@@ -679,6 +687,8 @@ interface IDBTransaction extends EventTarget {
|
||||
readonly VERSION_CHANGE: string;
|
||||
addEventListener<K extends keyof IDBTransactionEventMap>(type: K, listener: (this: IDBTransaction, ev: IDBTransactionEventMap[K]) => any, useCapture?: boolean): void;
|
||||
addEventListener(type: string, listener: EventListenerOrEventListenerObject, useCapture?: boolean): void;
|
||||
removeEventListener<K extends keyof IDBTransactionEventMap>(type: K, listener: (this: IDBTransaction, ev: IDBTransactionEventMap[K]) => any, useCapture?: boolean): void;
|
||||
removeEventListener(type: string, listener: EventListenerOrEventListenerObject, useCapture?: boolean): void;
|
||||
}
|
||||
|
||||
declare var IDBTransaction: {
|
||||
@@ -745,6 +755,8 @@ interface MessagePort extends EventTarget {
|
||||
start(): void;
|
||||
addEventListener<K extends keyof MessagePortEventMap>(type: K, listener: (this: MessagePort, ev: MessagePortEventMap[K]) => any, useCapture?: boolean): void;
|
||||
addEventListener(type: string, listener: EventListenerOrEventListenerObject, useCapture?: boolean): void;
|
||||
removeEventListener<K extends keyof MessagePortEventMap>(type: K, listener: (this: MessagePort, ev: MessagePortEventMap[K]) => any, useCapture?: boolean): void;
|
||||
removeEventListener(type: string, listener: EventListenerOrEventListenerObject, useCapture?: boolean): void;
|
||||
}
|
||||
|
||||
declare var MessagePort: {
|
||||
@@ -774,6 +786,8 @@ interface Notification extends EventTarget {
|
||||
close(): void;
|
||||
addEventListener<K extends keyof NotificationEventMap>(type: K, listener: (this: Notification, ev: NotificationEventMap[K]) => any, useCapture?: boolean): void;
|
||||
addEventListener(type: string, listener: EventListenerOrEventListenerObject, useCapture?: boolean): void;
|
||||
removeEventListener<K extends keyof NotificationEventMap>(type: K, listener: (this: Notification, ev: NotificationEventMap[K]) => any, useCapture?: boolean): void;
|
||||
removeEventListener(type: string, listener: EventListenerOrEventListenerObject, useCapture?: boolean): void;
|
||||
}
|
||||
|
||||
declare var Notification: {
|
||||
@@ -1002,6 +1016,8 @@ interface ServiceWorker extends EventTarget, AbstractWorker {
|
||||
postMessage(message: any, transfer?: any[]): void;
|
||||
addEventListener<K extends keyof ServiceWorkerEventMap>(type: K, listener: (this: ServiceWorker, ev: ServiceWorkerEventMap[K]) => any, useCapture?: boolean): void;
|
||||
addEventListener(type: string, listener: EventListenerOrEventListenerObject, useCapture?: boolean): void;
|
||||
removeEventListener<K extends keyof ServiceWorkerEventMap>(type: K, listener: (this: ServiceWorker, ev: ServiceWorkerEventMap[K]) => any, useCapture?: boolean): void;
|
||||
removeEventListener(type: string, listener: EventListenerOrEventListenerObject, useCapture?: boolean): void;
|
||||
}
|
||||
|
||||
declare var ServiceWorker: {
|
||||
@@ -1027,6 +1043,8 @@ interface ServiceWorkerRegistration extends EventTarget {
|
||||
update(): Promise<void>;
|
||||
addEventListener<K extends keyof ServiceWorkerRegistrationEventMap>(type: K, listener: (this: ServiceWorkerRegistration, ev: ServiceWorkerRegistrationEventMap[K]) => any, useCapture?: boolean): void;
|
||||
addEventListener(type: string, listener: EventListenerOrEventListenerObject, useCapture?: boolean): void;
|
||||
removeEventListener<K extends keyof ServiceWorkerRegistrationEventMap>(type: K, listener: (this: ServiceWorkerRegistration, ev: ServiceWorkerRegistrationEventMap[K]) => any, useCapture?: boolean): void;
|
||||
removeEventListener(type: string, listener: EventListenerOrEventListenerObject, useCapture?: boolean): void;
|
||||
}
|
||||
|
||||
declare var ServiceWorkerRegistration: {
|
||||
@@ -1093,6 +1111,8 @@ interface WebSocket extends EventTarget {
|
||||
readonly OPEN: number;
|
||||
addEventListener<K extends keyof WebSocketEventMap>(type: K, listener: (this: WebSocket, ev: WebSocketEventMap[K]) => any, useCapture?: boolean): void;
|
||||
addEventListener(type: string, listener: EventListenerOrEventListenerObject, useCapture?: boolean): void;
|
||||
removeEventListener<K extends keyof WebSocketEventMap>(type: K, listener: (this: WebSocket, ev: WebSocketEventMap[K]) => any, useCapture?: boolean): void;
|
||||
removeEventListener(type: string, listener: EventListenerOrEventListenerObject, useCapture?: boolean): void;
|
||||
}
|
||||
|
||||
declare var WebSocket: {
|
||||
@@ -1114,6 +1134,8 @@ interface Worker extends EventTarget, AbstractWorker {
|
||||
terminate(): void;
|
||||
addEventListener<K extends keyof WorkerEventMap>(type: K, listener: (this: Worker, ev: WorkerEventMap[K]) => any, useCapture?: boolean): void;
|
||||
addEventListener(type: string, listener: EventListenerOrEventListenerObject, useCapture?: boolean): void;
|
||||
removeEventListener<K extends keyof WorkerEventMap>(type: K, listener: (this: Worker, ev: WorkerEventMap[K]) => any, useCapture?: boolean): void;
|
||||
removeEventListener(type: string, listener: EventListenerOrEventListenerObject, useCapture?: boolean): void;
|
||||
}
|
||||
|
||||
declare var Worker: {
|
||||
@@ -1155,6 +1177,8 @@ interface XMLHttpRequest extends EventTarget, XMLHttpRequestEventTarget {
|
||||
readonly UNSENT: number;
|
||||
addEventListener<K extends keyof XMLHttpRequestEventMap>(type: K, listener: (this: XMLHttpRequest, ev: XMLHttpRequestEventMap[K]) => any, useCapture?: boolean): void;
|
||||
addEventListener(type: string, listener: EventListenerOrEventListenerObject, useCapture?: boolean): void;
|
||||
removeEventListener<K extends keyof XMLHttpRequestEventMap>(type: K, listener: (this: XMLHttpRequest, ev: XMLHttpRequestEventMap[K]) => any, useCapture?: boolean): void;
|
||||
removeEventListener(type: string, listener: EventListenerOrEventListenerObject, useCapture?: boolean): void;
|
||||
}
|
||||
|
||||
declare var XMLHttpRequest: {
|
||||
@@ -1170,6 +1194,8 @@ declare var XMLHttpRequest: {
|
||||
interface XMLHttpRequestUpload extends EventTarget, XMLHttpRequestEventTarget {
|
||||
addEventListener<K extends keyof XMLHttpRequestEventTargetEventMap>(type: K, listener: (this: XMLHttpRequestUpload, ev: XMLHttpRequestEventTargetEventMap[K]) => any, useCapture?: boolean): void;
|
||||
addEventListener(type: string, listener: EventListenerOrEventListenerObject, useCapture?: boolean): void;
|
||||
removeEventListener<K extends keyof XMLHttpRequestEventTargetEventMap>(type: K, listener: (this: XMLHttpRequestUpload, ev: XMLHttpRequestEventTargetEventMap[K]) => any, useCapture?: boolean): void;
|
||||
removeEventListener(type: string, listener: EventListenerOrEventListenerObject, useCapture?: boolean): void;
|
||||
}
|
||||
|
||||
declare var XMLHttpRequestUpload: {
|
||||
@@ -1185,6 +1211,8 @@ interface AbstractWorker {
|
||||
onerror: (this: AbstractWorker, ev: ErrorEvent) => any;
|
||||
addEventListener<K extends keyof AbstractWorkerEventMap>(type: K, listener: (this: AbstractWorker, ev: AbstractWorkerEventMap[K]) => any, useCapture?: boolean): void;
|
||||
addEventListener(type: string, listener: EventListenerOrEventListenerObject, useCapture?: boolean): void;
|
||||
removeEventListener<K extends keyof AbstractWorkerEventMap>(type: K, listener: (this: AbstractWorker, ev: AbstractWorkerEventMap[K]) => any, useCapture?: boolean): void;
|
||||
removeEventListener(type: string, listener: EventListenerOrEventListenerObject, useCapture?: boolean): void;
|
||||
}
|
||||
|
||||
interface Body {
|
||||
@@ -1223,6 +1251,8 @@ interface MSBaseReader {
|
||||
readonly LOADING: number;
|
||||
addEventListener<K extends keyof MSBaseReaderEventMap>(type: K, listener: (this: MSBaseReader, ev: MSBaseReaderEventMap[K]) => any, useCapture?: boolean): void;
|
||||
addEventListener(type: string, listener: EventListenerOrEventListenerObject, useCapture?: boolean): void;
|
||||
removeEventListener<K extends keyof MSBaseReaderEventMap>(type: K, listener: (this: MSBaseReader, ev: MSBaseReaderEventMap[K]) => any, useCapture?: boolean): void;
|
||||
removeEventListener(type: string, listener: EventListenerOrEventListenerObject, useCapture?: boolean): void;
|
||||
}
|
||||
|
||||
interface NavigatorBeacon {
|
||||
@@ -1278,6 +1308,8 @@ interface XMLHttpRequestEventTarget {
|
||||
ontimeout: (this: XMLHttpRequest, ev: ProgressEvent) => any;
|
||||
addEventListener<K extends keyof XMLHttpRequestEventTargetEventMap>(type: K, listener: (this: XMLHttpRequestEventTarget, ev: XMLHttpRequestEventTargetEventMap[K]) => any, useCapture?: boolean): void;
|
||||
addEventListener(type: string, listener: EventListenerOrEventListenerObject, useCapture?: boolean): void;
|
||||
removeEventListener<K extends keyof XMLHttpRequestEventTargetEventMap>(type: K, listener: (this: XMLHttpRequestEventTarget, ev: XMLHttpRequestEventTargetEventMap[K]) => any, useCapture?: boolean): void;
|
||||
removeEventListener(type: string, listener: EventListenerOrEventListenerObject, useCapture?: boolean): void;
|
||||
}
|
||||
|
||||
interface Client {
|
||||
@@ -1314,6 +1346,8 @@ interface DedicatedWorkerGlobalScope extends WorkerGlobalScope {
|
||||
postMessage(message: any, transfer?: any[]): void;
|
||||
addEventListener<K extends keyof DedicatedWorkerGlobalScopeEventMap>(type: K, listener: (this: DedicatedWorkerGlobalScope, ev: DedicatedWorkerGlobalScopeEventMap[K]) => any, useCapture?: boolean): void;
|
||||
addEventListener(type: string, listener: EventListenerOrEventListenerObject, useCapture?: boolean): void;
|
||||
removeEventListener<K extends keyof DedicatedWorkerGlobalScopeEventMap>(type: K, listener: (this: DedicatedWorkerGlobalScope, ev: DedicatedWorkerGlobalScopeEventMap[K]) => any, useCapture?: boolean): void;
|
||||
removeEventListener(type: string, listener: EventListenerOrEventListenerObject, useCapture?: boolean): void;
|
||||
}
|
||||
|
||||
declare var DedicatedWorkerGlobalScope: {
|
||||
@@ -1425,6 +1459,8 @@ interface ServiceWorkerGlobalScope extends WorkerGlobalScope {
|
||||
skipWaiting(): Promise<void>;
|
||||
addEventListener<K extends keyof ServiceWorkerGlobalScopeEventMap>(type: K, listener: (this: ServiceWorkerGlobalScope, ev: ServiceWorkerGlobalScopeEventMap[K]) => any, useCapture?: boolean): void;
|
||||
addEventListener(type: string, listener: EventListenerOrEventListenerObject, useCapture?: boolean): void;
|
||||
removeEventListener<K extends keyof ServiceWorkerGlobalScopeEventMap>(type: K, listener: (this: ServiceWorkerGlobalScope, ev: ServiceWorkerGlobalScopeEventMap[K]) => any, useCapture?: boolean): void;
|
||||
removeEventListener(type: string, listener: EventListenerOrEventListenerObject, useCapture?: boolean): void;
|
||||
}
|
||||
|
||||
declare var ServiceWorkerGlobalScope: {
|
||||
@@ -1470,6 +1506,8 @@ interface WorkerGlobalScope extends EventTarget, WorkerUtils, WindowConsole, Glo
|
||||
createImageBitmap(image: ImageBitmap | ImageData | Blob, sx: number, sy: number, sw: number, sh: number, options?: ImageBitmapOptions): Promise<ImageBitmap>;
|
||||
addEventListener<K extends keyof WorkerGlobalScopeEventMap>(type: K, listener: (this: WorkerGlobalScope, ev: WorkerGlobalScopeEventMap[K]) => any, useCapture?: boolean): void;
|
||||
addEventListener(type: string, listener: EventListenerOrEventListenerObject, useCapture?: boolean): void;
|
||||
removeEventListener<K extends keyof WorkerGlobalScopeEventMap>(type: K, listener: (this: WorkerGlobalScope, ev: WorkerGlobalScopeEventMap[K]) => any, useCapture?: boolean): void;
|
||||
removeEventListener(type: string, listener: EventListenerOrEventListenerObject, useCapture?: boolean): void;
|
||||
}
|
||||
|
||||
declare var WorkerGlobalScope: {
|
||||
@@ -1839,7 +1877,6 @@ declare function msWriteProfilerMark(profilerMarkName: string): void;
|
||||
declare function createImageBitmap(image: ImageBitmap | ImageData | Blob, options?: ImageBitmapOptions): Promise<ImageBitmap>;
|
||||
declare function createImageBitmap(image: ImageBitmap | ImageData | Blob, sx: number, sy: number, sw: number, sh: number, options?: ImageBitmapOptions): Promise<ImageBitmap>;
|
||||
declare function dispatchEvent(evt: Event): boolean;
|
||||
declare function removeEventListener(type: string, listener?: EventListenerOrEventListenerObject, options?: boolean | EventListenerOptions): void;
|
||||
declare var indexedDB: IDBFactory;
|
||||
declare var msIndexedDB: IDBFactory;
|
||||
declare var navigator: WorkerNavigator;
|
||||
@@ -1858,9 +1895,10 @@ declare function btoa(rawString: string): string;
|
||||
declare var console: Console;
|
||||
declare function fetch(input: RequestInfo, init?: RequestInit): Promise<Response>;
|
||||
declare function dispatchEvent(evt: Event): boolean;
|
||||
declare function removeEventListener(type: string, listener?: EventListenerOrEventListenerObject, options?: boolean | EventListenerOptions): void;
|
||||
declare function addEventListener<K extends keyof DedicatedWorkerGlobalScopeEventMap>(type: K, listener: (this: DedicatedWorkerGlobalScope, ev: DedicatedWorkerGlobalScopeEventMap[K]) => any, useCapture?: boolean): void;
|
||||
declare function addEventListener(type: string, listener: EventListenerOrEventListenerObject, useCapture?: boolean): void;
|
||||
declare function removeEventListener<K extends keyof DedicatedWorkerGlobalScopeEventMap>(type: K, listener: (this: DedicatedWorkerGlobalScope, ev: DedicatedWorkerGlobalScopeEventMap[K]) => any, useCapture?: boolean): void;
|
||||
declare function removeEventListener(type: string, listener: EventListenerOrEventListenerObject, useCapture?: boolean): void;
|
||||
type AlgorithmIdentifier = string | Algorithm;
|
||||
type BodyInit = any;
|
||||
type IDBKeyPath = string;
|
||||
|
||||
+46
-27
@@ -6750,35 +6750,49 @@ var ts;
|
||||
return getJSDocCommentsAndTags(node);
|
||||
}
|
||||
ts.getAllJSDocs = getAllJSDocs;
|
||||
function getSourceOfAssignment(node) {
|
||||
return ts.isExpressionStatement(node) &&
|
||||
node.expression && ts.isBinaryExpression(node.expression) &&
|
||||
node.expression.operatorToken.kind === 58 &&
|
||||
node.expression.right;
|
||||
}
|
||||
ts.getSourceOfAssignment = getSourceOfAssignment;
|
||||
function getSingleInitializerOfVariableStatement(node, child) {
|
||||
return ts.isVariableStatement(node) &&
|
||||
node.declarationList.declarations.length > 0 &&
|
||||
(!child || node.declarationList.declarations[0].initializer === child) &&
|
||||
node.declarationList.declarations[0].initializer;
|
||||
}
|
||||
ts.getSingleInitializerOfVariableStatement = getSingleInitializerOfVariableStatement;
|
||||
function getSingleVariableOfVariableStatement(node, child) {
|
||||
return ts.isVariableStatement(node) &&
|
||||
node.declarationList.declarations.length > 0 &&
|
||||
(!child || node.declarationList.declarations[0] === child) &&
|
||||
node.declarationList.declarations[0];
|
||||
}
|
||||
ts.getSingleVariableOfVariableStatement = getSingleVariableOfVariableStatement;
|
||||
function getNestedModuleDeclaration(node) {
|
||||
return node.kind === 233 &&
|
||||
node.body &&
|
||||
node.body.kind === 233 &&
|
||||
node.body;
|
||||
}
|
||||
ts.getNestedModuleDeclaration = getNestedModuleDeclaration;
|
||||
function getJSDocCommentsAndTags(node) {
|
||||
var result;
|
||||
getJSDocCommentsAndTagsWorker(node);
|
||||
return result || ts.emptyArray;
|
||||
function getJSDocCommentsAndTagsWorker(node) {
|
||||
var parent = node.parent;
|
||||
var isInitializerOfVariableDeclarationInStatement = isVariableLike(parent) &&
|
||||
parent.initializer === node &&
|
||||
parent.parent.parent.kind === 208;
|
||||
var isVariableOfVariableDeclarationStatement = isVariableLike(node) &&
|
||||
parent.parent.kind === 208;
|
||||
var variableStatementNode = isInitializerOfVariableDeclarationInStatement ? parent.parent.parent :
|
||||
isVariableOfVariableDeclarationStatement ? parent.parent :
|
||||
undefined;
|
||||
if (variableStatementNode) {
|
||||
getJSDocCommentsAndTagsWorker(variableStatementNode);
|
||||
if (parent && (parent.kind === 261 || getNestedModuleDeclaration(parent))) {
|
||||
getJSDocCommentsAndTagsWorker(parent);
|
||||
}
|
||||
var isSourceOfAssignmentExpressionStatement = parent && parent.parent &&
|
||||
parent.kind === 194 &&
|
||||
parent.operatorToken.kind === 58 &&
|
||||
parent.parent.kind === 210;
|
||||
if (isSourceOfAssignmentExpressionStatement) {
|
||||
if (parent && parent.parent &&
|
||||
(getSingleVariableOfVariableStatement(parent.parent, node) || getSourceOfAssignment(parent.parent))) {
|
||||
getJSDocCommentsAndTagsWorker(parent.parent);
|
||||
}
|
||||
var isModuleDeclaration = node.kind === 233 &&
|
||||
parent && parent.kind === 233;
|
||||
var isPropertyAssignmentExpression = parent && parent.kind === 261;
|
||||
if (isModuleDeclaration || isPropertyAssignmentExpression) {
|
||||
getJSDocCommentsAndTagsWorker(parent);
|
||||
if (parent && parent.parent && parent.parent.parent && getSingleInitializerOfVariableStatement(parent.parent.parent, node)) {
|
||||
getJSDocCommentsAndTagsWorker(parent.parent.parent);
|
||||
}
|
||||
if (node.kind === 146) {
|
||||
result = ts.addRange(result, ts.getJSDocParameterTags(node));
|
||||
@@ -6800,14 +6814,16 @@ var ts;
|
||||
return undefined;
|
||||
}
|
||||
var name = node.name.escapedText;
|
||||
var func = getJSDocHost(node);
|
||||
if (!ts.isFunctionLike(func)) {
|
||||
return undefined;
|
||||
var host = getJSDocHost(node);
|
||||
var decl = getSourceOfAssignment(host) ||
|
||||
getSingleInitializerOfVariableStatement(host) ||
|
||||
getSingleVariableOfVariableStatement(host) ||
|
||||
getNestedModuleDeclaration(host) ||
|
||||
host;
|
||||
if (decl && ts.isFunctionLike(decl)) {
|
||||
var parameter = ts.find(decl.parameters, function (p) { return p.name.kind === 71 && p.name.escapedText === name; });
|
||||
return parameter && parameter.symbol;
|
||||
}
|
||||
var parameter = ts.find(func.parameters, function (p) {
|
||||
return p.name.kind === 71 && p.name.escapedText === name;
|
||||
});
|
||||
return parameter && parameter.symbol;
|
||||
}
|
||||
ts.getParameterSymbolFromJSDoc = getParameterSymbolFromJSDoc;
|
||||
function getJSDocHost(node) {
|
||||
@@ -57844,6 +57860,9 @@ var ts;
|
||||
missingFilePaths = oldProgram.getMissingFilePaths();
|
||||
for (var i = 0; i < newSourceFiles.length; i++) {
|
||||
filesByName.set(filePaths[i], newSourceFiles[i]);
|
||||
if (oldProgram.isSourceFileFromExternalLibrary(oldProgram.getSourceFileByPath(filePaths[i]))) {
|
||||
sourceFilesFoundSearchingNodeModules.set(filePaths[i], true);
|
||||
}
|
||||
}
|
||||
files = newSourceFiles;
|
||||
fileProcessingDiagnostics = oldProgram.getFileProcessingDiagnostics();
|
||||
|
||||
+49
-29
@@ -7026,35 +7026,49 @@ var ts;
|
||||
return getJSDocCommentsAndTags(node);
|
||||
}
|
||||
ts.getAllJSDocs = getAllJSDocs;
|
||||
function getSourceOfAssignment(node) {
|
||||
return ts.isExpressionStatement(node) &&
|
||||
node.expression && ts.isBinaryExpression(node.expression) &&
|
||||
node.expression.operatorToken.kind === 58 &&
|
||||
node.expression.right;
|
||||
}
|
||||
ts.getSourceOfAssignment = getSourceOfAssignment;
|
||||
function getSingleInitializerOfVariableStatement(node, child) {
|
||||
return ts.isVariableStatement(node) &&
|
||||
node.declarationList.declarations.length > 0 &&
|
||||
(!child || node.declarationList.declarations[0].initializer === child) &&
|
||||
node.declarationList.declarations[0].initializer;
|
||||
}
|
||||
ts.getSingleInitializerOfVariableStatement = getSingleInitializerOfVariableStatement;
|
||||
function getSingleVariableOfVariableStatement(node, child) {
|
||||
return ts.isVariableStatement(node) &&
|
||||
node.declarationList.declarations.length > 0 &&
|
||||
(!child || node.declarationList.declarations[0] === child) &&
|
||||
node.declarationList.declarations[0];
|
||||
}
|
||||
ts.getSingleVariableOfVariableStatement = getSingleVariableOfVariableStatement;
|
||||
function getNestedModuleDeclaration(node) {
|
||||
return node.kind === 233 &&
|
||||
node.body &&
|
||||
node.body.kind === 233 &&
|
||||
node.body;
|
||||
}
|
||||
ts.getNestedModuleDeclaration = getNestedModuleDeclaration;
|
||||
function getJSDocCommentsAndTags(node) {
|
||||
var result;
|
||||
getJSDocCommentsAndTagsWorker(node);
|
||||
return result || ts.emptyArray;
|
||||
function getJSDocCommentsAndTagsWorker(node) {
|
||||
var parent = node.parent;
|
||||
var isInitializerOfVariableDeclarationInStatement = isVariableLike(parent) &&
|
||||
parent.initializer === node &&
|
||||
parent.parent.parent.kind === 208;
|
||||
var isVariableOfVariableDeclarationStatement = isVariableLike(node) &&
|
||||
parent.parent.kind === 208;
|
||||
var variableStatementNode = isInitializerOfVariableDeclarationInStatement ? parent.parent.parent :
|
||||
isVariableOfVariableDeclarationStatement ? parent.parent :
|
||||
undefined;
|
||||
if (variableStatementNode) {
|
||||
getJSDocCommentsAndTagsWorker(variableStatementNode);
|
||||
if (parent && (parent.kind === 261 || getNestedModuleDeclaration(parent))) {
|
||||
getJSDocCommentsAndTagsWorker(parent);
|
||||
}
|
||||
var isSourceOfAssignmentExpressionStatement = parent && parent.parent &&
|
||||
parent.kind === 194 &&
|
||||
parent.operatorToken.kind === 58 &&
|
||||
parent.parent.kind === 210;
|
||||
if (isSourceOfAssignmentExpressionStatement) {
|
||||
if (parent && parent.parent &&
|
||||
(getSingleVariableOfVariableStatement(parent.parent, node) || getSourceOfAssignment(parent.parent))) {
|
||||
getJSDocCommentsAndTagsWorker(parent.parent);
|
||||
}
|
||||
var isModuleDeclaration = node.kind === 233 &&
|
||||
parent && parent.kind === 233;
|
||||
var isPropertyAssignmentExpression = parent && parent.kind === 261;
|
||||
if (isModuleDeclaration || isPropertyAssignmentExpression) {
|
||||
getJSDocCommentsAndTagsWorker(parent);
|
||||
if (parent && parent.parent && parent.parent.parent && getSingleInitializerOfVariableStatement(parent.parent.parent, node)) {
|
||||
getJSDocCommentsAndTagsWorker(parent.parent.parent);
|
||||
}
|
||||
if (node.kind === 146) {
|
||||
result = ts.addRange(result, ts.getJSDocParameterTags(node));
|
||||
@@ -7076,14 +7090,16 @@ var ts;
|
||||
return undefined;
|
||||
}
|
||||
var name = node.name.escapedText;
|
||||
var func = getJSDocHost(node);
|
||||
if (!ts.isFunctionLike(func)) {
|
||||
return undefined;
|
||||
var host = getJSDocHost(node);
|
||||
var decl = getSourceOfAssignment(host) ||
|
||||
getSingleInitializerOfVariableStatement(host) ||
|
||||
getSingleVariableOfVariableStatement(host) ||
|
||||
getNestedModuleDeclaration(host) ||
|
||||
host;
|
||||
if (decl && ts.isFunctionLike(decl)) {
|
||||
var parameter = ts.find(decl.parameters, function (p) { return p.name.kind === 71 && p.name.escapedText === name; });
|
||||
return parameter && parameter.symbol;
|
||||
}
|
||||
var parameter = ts.find(func.parameters, function (p) {
|
||||
return p.name.kind === 71 && p.name.escapedText === name;
|
||||
});
|
||||
return parameter && parameter.symbol;
|
||||
}
|
||||
ts.getParameterSymbolFromJSDoc = getParameterSymbolFromJSDoc;
|
||||
function getJSDocHost(node) {
|
||||
@@ -59239,6 +59255,9 @@ var ts;
|
||||
missingFilePaths = oldProgram.getMissingFilePaths();
|
||||
for (var i = 0; i < newSourceFiles.length; i++) {
|
||||
filesByName.set(filePaths[i], newSourceFiles[i]);
|
||||
if (oldProgram.isSourceFileFromExternalLibrary(oldProgram.getSourceFileByPath(filePaths[i]))) {
|
||||
sourceFilesFoundSearchingNodeModules.set(filePaths[i], true);
|
||||
}
|
||||
}
|
||||
files = newSourceFiles;
|
||||
fileProcessingDiagnostics = oldProgram.getFileProcessingDiagnostics();
|
||||
@@ -75297,7 +75316,6 @@ var ts;
|
||||
(function (codefix) {
|
||||
codefix.registerCodeFix({
|
||||
errorCodes: [
|
||||
ts.Diagnostics.Cannot_find_module_0.code,
|
||||
ts.Diagnostics.Could_not_find_a_declaration_file_for_module_0_1_implicitly_has_an_any_type.code,
|
||||
],
|
||||
getCodeActions: function (context) {
|
||||
@@ -78778,7 +78796,9 @@ var ts;
|
||||
};
|
||||
refactor.registerRefactor(installTypesForPackage);
|
||||
function getAvailableActions(context) {
|
||||
if (context.program.getCompilerOptions().noImplicitAny) {
|
||||
var options = context.program.getCompilerOptions();
|
||||
var noImplicitAny = options.noImplicitAny === undefined ? options.strict : options.noImplicitAny;
|
||||
if (noImplicitAny) {
|
||||
return undefined;
|
||||
}
|
||||
var action = getAction(context);
|
||||
|
||||
+50
-30
@@ -6905,6 +6905,34 @@ var ts;
|
||||
return getJSDocCommentsAndTags(node);
|
||||
}
|
||||
ts.getAllJSDocs = getAllJSDocs;
|
||||
function getSourceOfAssignment(node) {
|
||||
return ts.isExpressionStatement(node) &&
|
||||
node.expression && ts.isBinaryExpression(node.expression) &&
|
||||
node.expression.operatorToken.kind === 58 /* EqualsToken */ &&
|
||||
node.expression.right;
|
||||
}
|
||||
ts.getSourceOfAssignment = getSourceOfAssignment;
|
||||
function getSingleInitializerOfVariableStatement(node, child) {
|
||||
return ts.isVariableStatement(node) &&
|
||||
node.declarationList.declarations.length > 0 &&
|
||||
(!child || node.declarationList.declarations[0].initializer === child) &&
|
||||
node.declarationList.declarations[0].initializer;
|
||||
}
|
||||
ts.getSingleInitializerOfVariableStatement = getSingleInitializerOfVariableStatement;
|
||||
function getSingleVariableOfVariableStatement(node, child) {
|
||||
return ts.isVariableStatement(node) &&
|
||||
node.declarationList.declarations.length > 0 &&
|
||||
(!child || node.declarationList.declarations[0] === child) &&
|
||||
node.declarationList.declarations[0];
|
||||
}
|
||||
ts.getSingleVariableOfVariableStatement = getSingleVariableOfVariableStatement;
|
||||
function getNestedModuleDeclaration(node) {
|
||||
return node.kind === 233 /* ModuleDeclaration */ &&
|
||||
node.body &&
|
||||
node.body.kind === 233 /* ModuleDeclaration */ &&
|
||||
node.body;
|
||||
}
|
||||
ts.getNestedModuleDeclaration = getNestedModuleDeclaration;
|
||||
function getJSDocCommentsAndTags(node) {
|
||||
var result;
|
||||
getJSDocCommentsAndTagsWorker(node);
|
||||
@@ -6917,30 +6945,15 @@ var ts;
|
||||
// * @returns {number}
|
||||
// */
|
||||
// var x = function(name) { return name.length; }
|
||||
var isInitializerOfVariableDeclarationInStatement = isVariableLike(parent) &&
|
||||
parent.initializer === node &&
|
||||
parent.parent.parent.kind === 208 /* VariableStatement */;
|
||||
var isVariableOfVariableDeclarationStatement = isVariableLike(node) &&
|
||||
parent.parent.kind === 208 /* VariableStatement */;
|
||||
var variableStatementNode = isInitializerOfVariableDeclarationInStatement ? parent.parent.parent :
|
||||
isVariableOfVariableDeclarationStatement ? parent.parent :
|
||||
undefined;
|
||||
if (variableStatementNode) {
|
||||
getJSDocCommentsAndTagsWorker(variableStatementNode);
|
||||
if (parent && (parent.kind === 261 /* PropertyAssignment */ || getNestedModuleDeclaration(parent))) {
|
||||
getJSDocCommentsAndTagsWorker(parent);
|
||||
}
|
||||
// Also recognize when the node is the RHS of an assignment expression
|
||||
var isSourceOfAssignmentExpressionStatement = parent && parent.parent &&
|
||||
parent.kind === 194 /* BinaryExpression */ &&
|
||||
parent.operatorToken.kind === 58 /* EqualsToken */ &&
|
||||
parent.parent.kind === 210 /* ExpressionStatement */;
|
||||
if (isSourceOfAssignmentExpressionStatement) {
|
||||
if (parent && parent.parent &&
|
||||
(getSingleVariableOfVariableStatement(parent.parent, node) || getSourceOfAssignment(parent.parent))) {
|
||||
getJSDocCommentsAndTagsWorker(parent.parent);
|
||||
}
|
||||
var isModuleDeclaration = node.kind === 233 /* ModuleDeclaration */ &&
|
||||
parent && parent.kind === 233 /* ModuleDeclaration */;
|
||||
var isPropertyAssignmentExpression = parent && parent.kind === 261 /* PropertyAssignment */;
|
||||
if (isModuleDeclaration || isPropertyAssignmentExpression) {
|
||||
getJSDocCommentsAndTagsWorker(parent);
|
||||
if (parent && parent.parent && parent.parent.parent && getSingleInitializerOfVariableStatement(parent.parent.parent, node)) {
|
||||
getJSDocCommentsAndTagsWorker(parent.parent.parent);
|
||||
}
|
||||
// Pull parameter comments from declaring function as well
|
||||
if (node.kind === 146 /* Parameter */) {
|
||||
@@ -6964,14 +6977,16 @@ var ts;
|
||||
return undefined;
|
||||
}
|
||||
var name = node.name.escapedText;
|
||||
var func = getJSDocHost(node);
|
||||
if (!ts.isFunctionLike(func)) {
|
||||
return undefined;
|
||||
var host = getJSDocHost(node);
|
||||
var decl = getSourceOfAssignment(host) ||
|
||||
getSingleInitializerOfVariableStatement(host) ||
|
||||
getSingleVariableOfVariableStatement(host) ||
|
||||
getNestedModuleDeclaration(host) ||
|
||||
host;
|
||||
if (decl && ts.isFunctionLike(decl)) {
|
||||
var parameter = ts.find(decl.parameters, function (p) { return p.name.kind === 71 /* Identifier */ && p.name.escapedText === name; });
|
||||
return parameter && parameter.symbol;
|
||||
}
|
||||
var parameter = ts.find(func.parameters, function (p) {
|
||||
return p.name.kind === 71 /* Identifier */ && p.name.escapedText === name;
|
||||
});
|
||||
return parameter && parameter.symbol;
|
||||
}
|
||||
ts.getParameterSymbolFromJSDoc = getParameterSymbolFromJSDoc;
|
||||
function getJSDocHost(node) {
|
||||
@@ -74238,6 +74253,10 @@ var ts;
|
||||
// update fileName -> file mapping
|
||||
for (var i = 0; i < newSourceFiles.length; i++) {
|
||||
filesByName.set(filePaths[i], newSourceFiles[i]);
|
||||
// Set the file as found during node modules search if it was found that way in old progra,
|
||||
if (oldProgram.isSourceFileFromExternalLibrary(oldProgram.getSourceFileByPath(filePaths[i]))) {
|
||||
sourceFilesFoundSearchingNodeModules.set(filePaths[i], true);
|
||||
}
|
||||
}
|
||||
files = newSourceFiles;
|
||||
fileProcessingDiagnostics = oldProgram.getFileProcessingDiagnostics();
|
||||
@@ -91076,7 +91095,6 @@ var ts;
|
||||
(function (codefix) {
|
||||
codefix.registerCodeFix({
|
||||
errorCodes: [
|
||||
ts.Diagnostics.Cannot_find_module_0.code,
|
||||
ts.Diagnostics.Could_not_find_a_declaration_file_for_module_0_1_implicitly_has_an_any_type.code,
|
||||
],
|
||||
getCodeActions: function (context) {
|
||||
@@ -95013,7 +95031,9 @@ var ts;
|
||||
};
|
||||
refactor.registerRefactor(installTypesForPackage);
|
||||
function getAvailableActions(context) {
|
||||
if (context.program.getCompilerOptions().noImplicitAny) {
|
||||
var options = context.program.getCompilerOptions();
|
||||
var noImplicitAny = options.noImplicitAny === undefined ? options.strict : options.noImplicitAny;
|
||||
if (noImplicitAny) {
|
||||
// Then it will be available via `fixCannotFindModule`.
|
||||
return undefined;
|
||||
}
|
||||
|
||||
+50
-30
@@ -8692,6 +8692,34 @@ var ts;
|
||||
return getJSDocCommentsAndTags(node);
|
||||
}
|
||||
ts.getAllJSDocs = getAllJSDocs;
|
||||
function getSourceOfAssignment(node) {
|
||||
return ts.isExpressionStatement(node) &&
|
||||
node.expression && ts.isBinaryExpression(node.expression) &&
|
||||
node.expression.operatorToken.kind === 58 /* EqualsToken */ &&
|
||||
node.expression.right;
|
||||
}
|
||||
ts.getSourceOfAssignment = getSourceOfAssignment;
|
||||
function getSingleInitializerOfVariableStatement(node, child) {
|
||||
return ts.isVariableStatement(node) &&
|
||||
node.declarationList.declarations.length > 0 &&
|
||||
(!child || node.declarationList.declarations[0].initializer === child) &&
|
||||
node.declarationList.declarations[0].initializer;
|
||||
}
|
||||
ts.getSingleInitializerOfVariableStatement = getSingleInitializerOfVariableStatement;
|
||||
function getSingleVariableOfVariableStatement(node, child) {
|
||||
return ts.isVariableStatement(node) &&
|
||||
node.declarationList.declarations.length > 0 &&
|
||||
(!child || node.declarationList.declarations[0] === child) &&
|
||||
node.declarationList.declarations[0];
|
||||
}
|
||||
ts.getSingleVariableOfVariableStatement = getSingleVariableOfVariableStatement;
|
||||
function getNestedModuleDeclaration(node) {
|
||||
return node.kind === 233 /* ModuleDeclaration */ &&
|
||||
node.body &&
|
||||
node.body.kind === 233 /* ModuleDeclaration */ &&
|
||||
node.body;
|
||||
}
|
||||
ts.getNestedModuleDeclaration = getNestedModuleDeclaration;
|
||||
function getJSDocCommentsAndTags(node) {
|
||||
var result;
|
||||
getJSDocCommentsAndTagsWorker(node);
|
||||
@@ -8704,30 +8732,15 @@ var ts;
|
||||
// * @returns {number}
|
||||
// */
|
||||
// var x = function(name) { return name.length; }
|
||||
var isInitializerOfVariableDeclarationInStatement = isVariableLike(parent) &&
|
||||
parent.initializer === node &&
|
||||
parent.parent.parent.kind === 208 /* VariableStatement */;
|
||||
var isVariableOfVariableDeclarationStatement = isVariableLike(node) &&
|
||||
parent.parent.kind === 208 /* VariableStatement */;
|
||||
var variableStatementNode = isInitializerOfVariableDeclarationInStatement ? parent.parent.parent :
|
||||
isVariableOfVariableDeclarationStatement ? parent.parent :
|
||||
undefined;
|
||||
if (variableStatementNode) {
|
||||
getJSDocCommentsAndTagsWorker(variableStatementNode);
|
||||
if (parent && (parent.kind === 261 /* PropertyAssignment */ || getNestedModuleDeclaration(parent))) {
|
||||
getJSDocCommentsAndTagsWorker(parent);
|
||||
}
|
||||
// Also recognize when the node is the RHS of an assignment expression
|
||||
var isSourceOfAssignmentExpressionStatement = parent && parent.parent &&
|
||||
parent.kind === 194 /* BinaryExpression */ &&
|
||||
parent.operatorToken.kind === 58 /* EqualsToken */ &&
|
||||
parent.parent.kind === 210 /* ExpressionStatement */;
|
||||
if (isSourceOfAssignmentExpressionStatement) {
|
||||
if (parent && parent.parent &&
|
||||
(getSingleVariableOfVariableStatement(parent.parent, node) || getSourceOfAssignment(parent.parent))) {
|
||||
getJSDocCommentsAndTagsWorker(parent.parent);
|
||||
}
|
||||
var isModuleDeclaration = node.kind === 233 /* ModuleDeclaration */ &&
|
||||
parent && parent.kind === 233 /* ModuleDeclaration */;
|
||||
var isPropertyAssignmentExpression = parent && parent.kind === 261 /* PropertyAssignment */;
|
||||
if (isModuleDeclaration || isPropertyAssignmentExpression) {
|
||||
getJSDocCommentsAndTagsWorker(parent);
|
||||
if (parent && parent.parent && parent.parent.parent && getSingleInitializerOfVariableStatement(parent.parent.parent, node)) {
|
||||
getJSDocCommentsAndTagsWorker(parent.parent.parent);
|
||||
}
|
||||
// Pull parameter comments from declaring function as well
|
||||
if (node.kind === 146 /* Parameter */) {
|
||||
@@ -8751,14 +8764,16 @@ var ts;
|
||||
return undefined;
|
||||
}
|
||||
var name = node.name.escapedText;
|
||||
var func = getJSDocHost(node);
|
||||
if (!ts.isFunctionLike(func)) {
|
||||
return undefined;
|
||||
var host = getJSDocHost(node);
|
||||
var decl = getSourceOfAssignment(host) ||
|
||||
getSingleInitializerOfVariableStatement(host) ||
|
||||
getSingleVariableOfVariableStatement(host) ||
|
||||
getNestedModuleDeclaration(host) ||
|
||||
host;
|
||||
if (decl && ts.isFunctionLike(decl)) {
|
||||
var parameter = ts.find(decl.parameters, function (p) { return p.name.kind === 71 /* Identifier */ && p.name.escapedText === name; });
|
||||
return parameter && parameter.symbol;
|
||||
}
|
||||
var parameter = ts.find(func.parameters, function (p) {
|
||||
return p.name.kind === 71 /* Identifier */ && p.name.escapedText === name;
|
||||
});
|
||||
return parameter && parameter.symbol;
|
||||
}
|
||||
ts.getParameterSymbolFromJSDoc = getParameterSymbolFromJSDoc;
|
||||
function getJSDocHost(node) {
|
||||
@@ -72205,6 +72220,10 @@ var ts;
|
||||
// update fileName -> file mapping
|
||||
for (var i = 0; i < newSourceFiles.length; i++) {
|
||||
filesByName.set(filePaths[i], newSourceFiles[i]);
|
||||
// Set the file as found during node modules search if it was found that way in old progra,
|
||||
if (oldProgram.isSourceFileFromExternalLibrary(oldProgram.getSourceFileByPath(filePaths[i]))) {
|
||||
sourceFilesFoundSearchingNodeModules.set(filePaths[i], true);
|
||||
}
|
||||
}
|
||||
files = newSourceFiles;
|
||||
fileProcessingDiagnostics = oldProgram.getFileProcessingDiagnostics();
|
||||
@@ -90472,7 +90491,6 @@ var ts;
|
||||
(function (codefix) {
|
||||
codefix.registerCodeFix({
|
||||
errorCodes: [
|
||||
ts.Diagnostics.Cannot_find_module_0.code,
|
||||
ts.Diagnostics.Could_not_find_a_declaration_file_for_module_0_1_implicitly_has_an_any_type.code,
|
||||
],
|
||||
getCodeActions: function (context) {
|
||||
@@ -94409,7 +94427,9 @@ var ts;
|
||||
};
|
||||
refactor.registerRefactor(installTypesForPackage);
|
||||
function getAvailableActions(context) {
|
||||
if (context.program.getCompilerOptions().noImplicitAny) {
|
||||
var options = context.program.getCompilerOptions();
|
||||
var noImplicitAny = options.noImplicitAny === undefined ? options.strict : options.noImplicitAny;
|
||||
if (noImplicitAny) {
|
||||
// Then it will be available via `fixCannotFindModule`.
|
||||
return undefined;
|
||||
}
|
||||
|
||||
+50
-30
@@ -8692,6 +8692,34 @@ var ts;
|
||||
return getJSDocCommentsAndTags(node);
|
||||
}
|
||||
ts.getAllJSDocs = getAllJSDocs;
|
||||
function getSourceOfAssignment(node) {
|
||||
return ts.isExpressionStatement(node) &&
|
||||
node.expression && ts.isBinaryExpression(node.expression) &&
|
||||
node.expression.operatorToken.kind === 58 /* EqualsToken */ &&
|
||||
node.expression.right;
|
||||
}
|
||||
ts.getSourceOfAssignment = getSourceOfAssignment;
|
||||
function getSingleInitializerOfVariableStatement(node, child) {
|
||||
return ts.isVariableStatement(node) &&
|
||||
node.declarationList.declarations.length > 0 &&
|
||||
(!child || node.declarationList.declarations[0].initializer === child) &&
|
||||
node.declarationList.declarations[0].initializer;
|
||||
}
|
||||
ts.getSingleInitializerOfVariableStatement = getSingleInitializerOfVariableStatement;
|
||||
function getSingleVariableOfVariableStatement(node, child) {
|
||||
return ts.isVariableStatement(node) &&
|
||||
node.declarationList.declarations.length > 0 &&
|
||||
(!child || node.declarationList.declarations[0] === child) &&
|
||||
node.declarationList.declarations[0];
|
||||
}
|
||||
ts.getSingleVariableOfVariableStatement = getSingleVariableOfVariableStatement;
|
||||
function getNestedModuleDeclaration(node) {
|
||||
return node.kind === 233 /* ModuleDeclaration */ &&
|
||||
node.body &&
|
||||
node.body.kind === 233 /* ModuleDeclaration */ &&
|
||||
node.body;
|
||||
}
|
||||
ts.getNestedModuleDeclaration = getNestedModuleDeclaration;
|
||||
function getJSDocCommentsAndTags(node) {
|
||||
var result;
|
||||
getJSDocCommentsAndTagsWorker(node);
|
||||
@@ -8704,30 +8732,15 @@ var ts;
|
||||
// * @returns {number}
|
||||
// */
|
||||
// var x = function(name) { return name.length; }
|
||||
var isInitializerOfVariableDeclarationInStatement = isVariableLike(parent) &&
|
||||
parent.initializer === node &&
|
||||
parent.parent.parent.kind === 208 /* VariableStatement */;
|
||||
var isVariableOfVariableDeclarationStatement = isVariableLike(node) &&
|
||||
parent.parent.kind === 208 /* VariableStatement */;
|
||||
var variableStatementNode = isInitializerOfVariableDeclarationInStatement ? parent.parent.parent :
|
||||
isVariableOfVariableDeclarationStatement ? parent.parent :
|
||||
undefined;
|
||||
if (variableStatementNode) {
|
||||
getJSDocCommentsAndTagsWorker(variableStatementNode);
|
||||
if (parent && (parent.kind === 261 /* PropertyAssignment */ || getNestedModuleDeclaration(parent))) {
|
||||
getJSDocCommentsAndTagsWorker(parent);
|
||||
}
|
||||
// Also recognize when the node is the RHS of an assignment expression
|
||||
var isSourceOfAssignmentExpressionStatement = parent && parent.parent &&
|
||||
parent.kind === 194 /* BinaryExpression */ &&
|
||||
parent.operatorToken.kind === 58 /* EqualsToken */ &&
|
||||
parent.parent.kind === 210 /* ExpressionStatement */;
|
||||
if (isSourceOfAssignmentExpressionStatement) {
|
||||
if (parent && parent.parent &&
|
||||
(getSingleVariableOfVariableStatement(parent.parent, node) || getSourceOfAssignment(parent.parent))) {
|
||||
getJSDocCommentsAndTagsWorker(parent.parent);
|
||||
}
|
||||
var isModuleDeclaration = node.kind === 233 /* ModuleDeclaration */ &&
|
||||
parent && parent.kind === 233 /* ModuleDeclaration */;
|
||||
var isPropertyAssignmentExpression = parent && parent.kind === 261 /* PropertyAssignment */;
|
||||
if (isModuleDeclaration || isPropertyAssignmentExpression) {
|
||||
getJSDocCommentsAndTagsWorker(parent);
|
||||
if (parent && parent.parent && parent.parent.parent && getSingleInitializerOfVariableStatement(parent.parent.parent, node)) {
|
||||
getJSDocCommentsAndTagsWorker(parent.parent.parent);
|
||||
}
|
||||
// Pull parameter comments from declaring function as well
|
||||
if (node.kind === 146 /* Parameter */) {
|
||||
@@ -8751,14 +8764,16 @@ var ts;
|
||||
return undefined;
|
||||
}
|
||||
var name = node.name.escapedText;
|
||||
var func = getJSDocHost(node);
|
||||
if (!ts.isFunctionLike(func)) {
|
||||
return undefined;
|
||||
var host = getJSDocHost(node);
|
||||
var decl = getSourceOfAssignment(host) ||
|
||||
getSingleInitializerOfVariableStatement(host) ||
|
||||
getSingleVariableOfVariableStatement(host) ||
|
||||
getNestedModuleDeclaration(host) ||
|
||||
host;
|
||||
if (decl && ts.isFunctionLike(decl)) {
|
||||
var parameter = ts.find(decl.parameters, function (p) { return p.name.kind === 71 /* Identifier */ && p.name.escapedText === name; });
|
||||
return parameter && parameter.symbol;
|
||||
}
|
||||
var parameter = ts.find(func.parameters, function (p) {
|
||||
return p.name.kind === 71 /* Identifier */ && p.name.escapedText === name;
|
||||
});
|
||||
return parameter && parameter.symbol;
|
||||
}
|
||||
ts.getParameterSymbolFromJSDoc = getParameterSymbolFromJSDoc;
|
||||
function getJSDocHost(node) {
|
||||
@@ -72205,6 +72220,10 @@ var ts;
|
||||
// update fileName -> file mapping
|
||||
for (var i = 0; i < newSourceFiles.length; i++) {
|
||||
filesByName.set(filePaths[i], newSourceFiles[i]);
|
||||
// Set the file as found during node modules search if it was found that way in old progra,
|
||||
if (oldProgram.isSourceFileFromExternalLibrary(oldProgram.getSourceFileByPath(filePaths[i]))) {
|
||||
sourceFilesFoundSearchingNodeModules.set(filePaths[i], true);
|
||||
}
|
||||
}
|
||||
files = newSourceFiles;
|
||||
fileProcessingDiagnostics = oldProgram.getFileProcessingDiagnostics();
|
||||
@@ -90472,7 +90491,6 @@ var ts;
|
||||
(function (codefix) {
|
||||
codefix.registerCodeFix({
|
||||
errorCodes: [
|
||||
ts.Diagnostics.Cannot_find_module_0.code,
|
||||
ts.Diagnostics.Could_not_find_a_declaration_file_for_module_0_1_implicitly_has_an_any_type.code,
|
||||
],
|
||||
getCodeActions: function (context) {
|
||||
@@ -94409,7 +94427,9 @@ var ts;
|
||||
};
|
||||
refactor.registerRefactor(installTypesForPackage);
|
||||
function getAvailableActions(context) {
|
||||
if (context.program.getCompilerOptions().noImplicitAny) {
|
||||
var options = context.program.getCompilerOptions();
|
||||
var noImplicitAny = options.noImplicitAny === undefined ? options.strict : options.noImplicitAny;
|
||||
if (noImplicitAny) {
|
||||
// Then it will be available via `fixCannotFindModule`.
|
||||
return undefined;
|
||||
}
|
||||
|
||||
+43
-27
@@ -5158,35 +5158,49 @@ var ts;
|
||||
return getJSDocCommentsAndTags(node);
|
||||
}
|
||||
ts.getAllJSDocs = getAllJSDocs;
|
||||
function getSourceOfAssignment(node) {
|
||||
return ts.isExpressionStatement(node) &&
|
||||
node.expression && ts.isBinaryExpression(node.expression) &&
|
||||
node.expression.operatorToken.kind === 58 &&
|
||||
node.expression.right;
|
||||
}
|
||||
ts.getSourceOfAssignment = getSourceOfAssignment;
|
||||
function getSingleInitializerOfVariableStatement(node, child) {
|
||||
return ts.isVariableStatement(node) &&
|
||||
node.declarationList.declarations.length > 0 &&
|
||||
(!child || node.declarationList.declarations[0].initializer === child) &&
|
||||
node.declarationList.declarations[0].initializer;
|
||||
}
|
||||
ts.getSingleInitializerOfVariableStatement = getSingleInitializerOfVariableStatement;
|
||||
function getSingleVariableOfVariableStatement(node, child) {
|
||||
return ts.isVariableStatement(node) &&
|
||||
node.declarationList.declarations.length > 0 &&
|
||||
(!child || node.declarationList.declarations[0] === child) &&
|
||||
node.declarationList.declarations[0];
|
||||
}
|
||||
ts.getSingleVariableOfVariableStatement = getSingleVariableOfVariableStatement;
|
||||
function getNestedModuleDeclaration(node) {
|
||||
return node.kind === 233 &&
|
||||
node.body &&
|
||||
node.body.kind === 233 &&
|
||||
node.body;
|
||||
}
|
||||
ts.getNestedModuleDeclaration = getNestedModuleDeclaration;
|
||||
function getJSDocCommentsAndTags(node) {
|
||||
var result;
|
||||
getJSDocCommentsAndTagsWorker(node);
|
||||
return result || ts.emptyArray;
|
||||
function getJSDocCommentsAndTagsWorker(node) {
|
||||
var parent = node.parent;
|
||||
var isInitializerOfVariableDeclarationInStatement = isVariableLike(parent) &&
|
||||
parent.initializer === node &&
|
||||
parent.parent.parent.kind === 208;
|
||||
var isVariableOfVariableDeclarationStatement = isVariableLike(node) &&
|
||||
parent.parent.kind === 208;
|
||||
var variableStatementNode = isInitializerOfVariableDeclarationInStatement ? parent.parent.parent :
|
||||
isVariableOfVariableDeclarationStatement ? parent.parent :
|
||||
undefined;
|
||||
if (variableStatementNode) {
|
||||
getJSDocCommentsAndTagsWorker(variableStatementNode);
|
||||
if (parent && (parent.kind === 261 || getNestedModuleDeclaration(parent))) {
|
||||
getJSDocCommentsAndTagsWorker(parent);
|
||||
}
|
||||
var isSourceOfAssignmentExpressionStatement = parent && parent.parent &&
|
||||
parent.kind === 194 &&
|
||||
parent.operatorToken.kind === 58 &&
|
||||
parent.parent.kind === 210;
|
||||
if (isSourceOfAssignmentExpressionStatement) {
|
||||
if (parent && parent.parent &&
|
||||
(getSingleVariableOfVariableStatement(parent.parent, node) || getSourceOfAssignment(parent.parent))) {
|
||||
getJSDocCommentsAndTagsWorker(parent.parent);
|
||||
}
|
||||
var isModuleDeclaration = node.kind === 233 &&
|
||||
parent && parent.kind === 233;
|
||||
var isPropertyAssignmentExpression = parent && parent.kind === 261;
|
||||
if (isModuleDeclaration || isPropertyAssignmentExpression) {
|
||||
getJSDocCommentsAndTagsWorker(parent);
|
||||
if (parent && parent.parent && parent.parent.parent && getSingleInitializerOfVariableStatement(parent.parent.parent, node)) {
|
||||
getJSDocCommentsAndTagsWorker(parent.parent.parent);
|
||||
}
|
||||
if (node.kind === 146) {
|
||||
result = ts.addRange(result, ts.getJSDocParameterTags(node));
|
||||
@@ -5208,14 +5222,16 @@ var ts;
|
||||
return undefined;
|
||||
}
|
||||
var name = node.name.escapedText;
|
||||
var func = getJSDocHost(node);
|
||||
if (!ts.isFunctionLike(func)) {
|
||||
return undefined;
|
||||
var host = getJSDocHost(node);
|
||||
var decl = getSourceOfAssignment(host) ||
|
||||
getSingleInitializerOfVariableStatement(host) ||
|
||||
getSingleVariableOfVariableStatement(host) ||
|
||||
getNestedModuleDeclaration(host) ||
|
||||
host;
|
||||
if (decl && ts.isFunctionLike(decl)) {
|
||||
var parameter = ts.find(decl.parameters, function (p) { return p.name.kind === 71 && p.name.escapedText === name; });
|
||||
return parameter && parameter.symbol;
|
||||
}
|
||||
var parameter = ts.find(func.parameters, function (p) {
|
||||
return p.name.kind === 71 && p.name.escapedText === name;
|
||||
});
|
||||
return parameter && parameter.symbol;
|
||||
}
|
||||
ts.getParameterSymbolFromJSDoc = getParameterSymbolFromJSDoc;
|
||||
function getJSDocHost(node) {
|
||||
|
||||
Reference in New Issue
Block a user