mirror of
https://github.com/microsoft/TypeScript.git
synced 2026-05-30 11:24:49 -05:00
Lint
This commit is contained in:
@@ -561,7 +561,7 @@ namespace FourSlash {
|
||||
const errors = this.getDiagnostics(fileName);
|
||||
if (errors.length) {
|
||||
this.printErrorLog(/*expectErrors*/ false, errors);
|
||||
const error = errors[0]
|
||||
const error = errors[0];
|
||||
this.raiseError(`Found an error: ${error.file.fileName}@${error.start}: ${error.messageText}`);
|
||||
}
|
||||
});
|
||||
@@ -1174,7 +1174,7 @@ namespace FourSlash {
|
||||
let findInStrings: boolean, findInComments: boolean, ranges: Range[];
|
||||
if (ts.isArray(options)) {
|
||||
findInStrings = findInComments = false;
|
||||
ranges = options
|
||||
ranges = options;
|
||||
}
|
||||
else {
|
||||
findInStrings = !!options.findInStrings;
|
||||
|
||||
@@ -17,7 +17,7 @@ namespace ts.FindAllReferences {
|
||||
return (exportSymbol, exportInfo, isForRename) => {
|
||||
const { directImports, indirectUsers } = getImportersForExport(sourceFiles, allDirectImports, exportInfo, checker);
|
||||
return { indirectUsers, ...getSearchesFromDirectImports(directImports, exportSymbol, exportInfo.exportKind, checker, isForRename) };
|
||||
}
|
||||
};
|
||||
}
|
||||
|
||||
/** Info about an exported symbol to perform recursive search on. */
|
||||
@@ -86,7 +86,7 @@ namespace ts.FindAllReferences {
|
||||
case SyntaxKind.ImportDeclaration:
|
||||
const namedBindings = direct.importClause && direct.importClause.namedBindings;
|
||||
if (namedBindings && namedBindings.kind === SyntaxKind.NamespaceImport) {
|
||||
handleNamespaceImport(direct, namedBindings.name)
|
||||
handleNamespaceImport(direct, namedBindings.name);
|
||||
}
|
||||
else {
|
||||
directImports.push(direct);
|
||||
@@ -418,7 +418,7 @@ namespace ts.FindAllReferences {
|
||||
// Get the symbol for the `export =` node; its parent is the module it's the export of.
|
||||
const exportingModuleSymbol = parent.symbol.parent;
|
||||
Debug.assert(!!exportingModuleSymbol);
|
||||
return { kind: ImportExport.Export, symbol, exportInfo: { exportingModuleSymbol, exportKind: ExportKind.ExportEquals } }
|
||||
return { kind: ImportExport.Export, symbol, exportInfo: { exportingModuleSymbol, exportKind: ExportKind.ExportEquals } };
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -445,7 +445,7 @@ namespace ts.FindAllReferences {
|
||||
|
||||
function exportInfo(symbol: Symbol, kind: ExportKind): ExportedSymbol {
|
||||
const exportInfo = getExportInfo(symbol, kind, checker);
|
||||
return exportInfo && { kind: ImportExport.Export, symbol, exportInfo }
|
||||
return exportInfo && { kind: ImportExport.Export, symbol, exportInfo };
|
||||
}
|
||||
|
||||
// Not meant for use with export specifiers or export assignment.
|
||||
@@ -524,6 +524,6 @@ namespace ts.FindAllReferences {
|
||||
}
|
||||
|
||||
function isExternalModuleImportEquals({ moduleReference }: ImportEqualsDeclaration): boolean {
|
||||
return moduleReference.kind === SyntaxKind.ExternalModuleReference && moduleReference.expression.kind === SyntaxKind.StringLiteral
|
||||
return moduleReference.kind === SyntaxKind.ExternalModuleReference && moduleReference.expression.kind === SyntaxKind.StringLiteral;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -481,13 +481,9 @@ namespace ts {
|
||||
displayParts: SymbolDisplayPart[];
|
||||
}
|
||||
|
||||
//!!! internal implementation details leaked!!!
|
||||
export interface ReferencedSymbolOf<T extends DocumentSpan> {
|
||||
export interface ReferencedSymbol {
|
||||
definition: ReferencedSymbolDefinitionInfo;
|
||||
references: T[];
|
||||
}
|
||||
|
||||
export interface ReferencedSymbol extends ReferencedSymbolOf<ReferenceEntry> {
|
||||
references: ReferenceEntry[];
|
||||
}
|
||||
|
||||
export enum SymbolDisplayPartKind {
|
||||
|
||||
Reference in New Issue
Block a user