File tree 1 file changed +6
-5
lines changed
1 file changed +6
-5
lines changed Original file line number Diff line number Diff line change @@ -246,7 +246,7 @@ class PSDocumentFormattingEditProvider implements
246
246
const requestParams : DocumentRangeFormattingParams = {
247
247
textDocument : TextDocumentIdentifier . create ( document . uri . toString ( ) ) ,
248
248
range : rangeParam ,
249
- options : this . getEditorSettings ( ) ,
249
+ options : this . getEditorSettings ( editor ) ,
250
250
} ;
251
251
252
252
const formattingStartTime = new Date ( ) . valueOf ( ) ;
@@ -309,11 +309,12 @@ class PSDocumentFormattingEditProvider implements
309
309
PSDocumentFormattingEditProvider . documentLocker . lock ( document , unlockWhenDone ) ;
310
310
}
311
311
312
- private getEditorSettings ( ) : { insertSpaces : boolean , tabSize : number } {
313
- const editorConfiguration = vscode . workspace . getConfiguration ( "editor" ) ;
312
+ private getEditorSettings ( editor : TextEditor ) : { insertSpaces : boolean , tabSize : number } {
313
+ // Writing the editor options allows string or strong types going in, but always
314
+ // resolves to an appropriate value on read.
314
315
return {
315
- insertSpaces : editorConfiguration . get < boolean > ( " insertSpaces" ) ,
316
- tabSize : editorConfiguration . get < number > ( " tabSize" ) ,
316
+ insertSpaces : editor . options . insertSpaces as boolean ,
317
+ tabSize : editor . options . tabSize as number ,
317
318
} ;
318
319
}
319
320
}
You can’t perform that action at this time.
0 commit comments