Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit 50fd476

Browse files
committed
Make SymbolContext a subtype of TextChangesContext
1 parent 3a38c8e commit 50fd476

File tree

1 file changed

+4
-6
lines changed

1 file changed

+4
-6
lines changed

src/services/codefixes/importFixes.ts

Lines changed: 4 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -24,15 +24,13 @@ namespace ts.codefix {
2424
moduleSpecifier?: string;
2525
}
2626

27-
interface SymbolContext {
27+
interface SymbolContext extends textChanges.TextChangesContext {
2828
sourceFile: SourceFile;
2929
symbolName: string;
30-
formatContext: ts.formatting.FormatContext;
3130
}
3231

3332
interface ImportCodeFixContext extends SymbolContext {
3433
symbolToken: Identifier | undefined;
35-
host: LanguageServiceHost;
3634
program: Program;
3735
checker: TypeChecker;
3836
compilerOptions: CompilerOptions;
@@ -257,7 +255,7 @@ namespace ts.codefix {
257255
}
258256
}
259257

260-
function getCodeActionForNewImport(context: SymbolContext & textChanges.TextChangesContext & { kind: ImportKind }, moduleSpecifier: string): ImportCodeAction {
258+
function getCodeActionForNewImport(context: SymbolContext & { kind: ImportKind }, moduleSpecifier: string): ImportCodeAction {
261259
const { kind, sourceFile, symbolName } = context;
262260
const lastImportDeclaration = findLast(sourceFile.statements, isAnyImportSyntax);
263261

@@ -669,7 +667,7 @@ namespace ts.codefix {
669667
return expression && isStringLiteral(expression) ? expression.text : undefined;
670668
}
671669

672-
function tryUpdateExistingImport(context: SymbolContext & textChanges.TextChangesContext & { kind: ImportKind }, importClause: ImportClause | ImportEqualsDeclaration): FileTextChanges[] | undefined {
670+
function tryUpdateExistingImport(context: SymbolContext & { kind: ImportKind }, importClause: ImportClause | ImportEqualsDeclaration): FileTextChanges[] | undefined {
673671
const { symbolName, sourceFile, kind } = context;
674672
const { name } = importClause;
675673
const { namedBindings } = importClause.kind !== SyntaxKind.ImportEqualsDeclaration && importClause;
@@ -706,7 +704,7 @@ namespace ts.codefix {
706704
}
707705
}
708706

709-
function getCodeActionForUseExistingNamespaceImport(namespacePrefix: string, context: SymbolContext & textChanges.TextChangesContext, symbolToken: Identifier): ImportCodeAction {
707+
function getCodeActionForUseExistingNamespaceImport(namespacePrefix: string, context: SymbolContext, symbolToken: Identifier): ImportCodeAction {
710708
const { symbolName, sourceFile } = context;
711709

712710
/**

0 commit comments

Comments
 (0)