Skip to main content
Module

x/ts_morph/mod.ts>LanguageService#getEditsForRefactor

TypeScript Compiler API wrapper for static analysis and programmatic code changes.
Very Popular
Go to Latest
method LanguageService.prototype.getEditsForRefactor
import { LanguageService } from "https://deno.land/x/ts_morph@15.1.0/mod.ts";

Gets the edit information for applying a refactor at a the provided position in a source file.

Parameters

filePathOrSourceFile: string | SourceFile
  • File path or source file to get the edits for.
formatSettings: FormatCodeSettings
  • Fomat code settings.
positionOrRange: number | { getPos(): number; getEnd(): number; }
  • Position in the source file where to apply given refactor.
refactorName: string
  • Refactor name.
actionName: string
  • Refactor action name.
optional
preferences: UserPreferences
  • User preferences for refactoring.