Skip to content

Commit

Permalink
feat: Add UserPreferences on sourceFile.organizeImports()
Browse files Browse the repository at this point in the history
  • Loading branch information
dsherret committed Jun 4, 2018
1 parent 0bfa236 commit 6b0a089
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions src/compiler/file/SourceFile.ts
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ import { callBaseFill } from "../callBaseFill";
import { Node, Symbol } from "../common";
import { StringLiteral } from "../literal";
import { StatementedNode } from "../statement";
import { Diagnostic, EmitOptionsBase, EmitOutput, EmitResult, FormatCodeSettings, TextChange } from "../tools";
import { Diagnostic, EmitOptionsBase, EmitOutput, EmitResult, FormatCodeSettings, UserPreferences, TextChange } from "../tools";
import { ExportAssignment } from "./ExportAssignment";
import { ExportDeclaration } from "./ExportDeclaration";
import { ExportSpecifier } from "./ExportSpecifier";
Expand Down Expand Up @@ -978,9 +978,10 @@ export class SourceFile extends SourceFileBase<ts.SourceFile> {
*
* WARNING! This will forget all the nodes in the file! It's best to do this after you're all done with the file.
* @param settings - Format code settings.
* @param userPreferences - User preferences for refactoring.
*/
organizeImports(settings: FormatCodeSettings = {}) {
this.applyTextChanges(ArrayUtils.flatten(this.global.languageService.organizeImports(this, settings).map(r => r.getTextChanges())));
organizeImports(settings: FormatCodeSettings = {}, userPreferences: UserPreferences = {}) {
this.applyTextChanges(ArrayUtils.flatten(this.global.languageService.organizeImports(this, settings, userPreferences).map(r => r.getTextChanges())));
return this;
}

Expand Down

0 comments on commit 6b0a089

Please sign in to comment.