diff --git a/src/server/protocol.ts b/src/server/protocol.ts index 1740f8ae0ba1d..44862c738cc04 100644 --- a/src/server/protocol.ts +++ b/src/server/protocol.ts @@ -494,7 +494,7 @@ namespace ts.server.protocol { refactor: string; /* The 'name' property from the refactoring action */ action: string; - formatOptions: FormatCodeSettings, + formatOptions?: FormatCodeSettings, }; diff --git a/src/server/session.ts b/src/server/session.ts index e6ba78b81c992..02eb76eeae861 100644 --- a/src/server/session.ts +++ b/src/server/session.ts @@ -1488,7 +1488,7 @@ namespace ts.server { const result = project.getLanguageService().getEditsForRefactor( file, - convertFormatOptions(args.formatOptions), + args.formatOptions ? convertFormatOptions(args.formatOptions) : this.projectService.getFormatCodeOptions(), position || textRange, args.refactor, args.action