@@ -783,7 +783,8 @@ namespace ts.server {
783783 private getIndentation ( args : protocol . IndentationRequestArgs ) {
784784 const { file, project } = this . getFileAndProject ( args ) ;
785785 const position = this . getPosition ( args , project . getScriptInfoForNormalizedPath ( file ) ) ;
786- const indentation = project . languageService . getIndentationAtPosition ( file , position , args . options ) ;
786+ const options = args . options || this . projectService . getFormatCodeOptions ( file ) ;
787+ const indentation = project . languageService . getIndentationAtPosition ( file , position , options ) ;
787788 return { position, indentation } ;
788789 }
789790
@@ -855,17 +856,20 @@ namespace ts.server {
855856
856857 private getFormattingEditsForRangeFull ( args : protocol . FormatRequestArgs ) {
857858 const { file, project } = this . getFileAndProject ( args ) ;
858- return project . languageService . getFormattingEditsForRange ( file , args . position , args . endPosition , args . options ) ;
859+ const options = args . options || this . projectService . getFormatCodeOptions ( file ) ;
860+ return project . languageService . getFormattingEditsForRange ( file , args . position , args . endPosition , options ) ;
859861 }
860862
861863 private getFormattingEditsForDocumentFull ( args : protocol . FormatRequestArgs ) {
862864 const { file, project } = this . getFileAndProject ( args ) ;
863- return project . languageService . getFormattingEditsForDocument ( file , args . options ) ;
865+ const options = args . options || this . projectService . getFormatCodeOptions ( file ) ;
866+ return project . languageService . getFormattingEditsForDocument ( file , options ) ;
864867 }
865868
866869 private getFormattingEditsAfterKeystrokeFull ( args : protocol . FormatOnKeyRequestArgs ) {
867870 const { file, project } = this . getFileAndProject ( args ) ;
868- return project . languageService . getFormattingEditsAfterKeystroke ( file , args . position , args . key , args . options ) ;
871+ const options = args . options || this . projectService . getFormatCodeOptions ( file ) ;
872+ return project . languageService . getFormattingEditsAfterKeystroke ( file , args . position , args . key , options ) ;
869873 }
870874
871875 private getFormattingEditsAfterKeystroke ( args : protocol . FormatOnKeyRequestArgs ) : protocol . CodeEdit [ ] {
0 commit comments