File tree Expand file tree Collapse file tree 1 file changed +9
-4
lines changed Expand file tree Collapse file tree 1 file changed +9
-4
lines changed Original file line number Diff line number Diff line change @@ -200,10 +200,7 @@ class PSDocumentFormattingEditProvider implements
200
200
DocumentFormattingRequest . type ,
201
201
{
202
202
textDocument : TextDocumentIdentifier . create ( document . uri . toString ( ) ) ,
203
- options : {
204
- insertSpaces : true ,
205
- tabSize : 4
206
- }
203
+ options : this . getEditorSettings ( )
207
204
} ) ;
208
205
}
209
206
@@ -449,6 +446,14 @@ class PSDocumentFormattingEditProvider implements
449
446
return settings ;
450
447
}
451
448
449
+ private getEditorSettings ( ) : { insertSpaces : boolean , tabSize : number } {
450
+ let editorConfiguration = vscode . workspace . getConfiguration ( "editor" ) ;
451
+ return {
452
+ insertSpaces : editorConfiguration . get < boolean > ( "insertSpaces" ) ,
453
+ tabSize : editorConfiguration . get < number > ( "tabSize" )
454
+ } ;
455
+ }
456
+
452
457
private static showStatusBar ( document : TextDocument , hideWhenDone : Thenable < any > ) : void {
453
458
let statusBar = AnimatedStatusBar . showAnimatedStatusBarMessage ( "Formatting PowerShell document" , hideWhenDone ) ;
454
459
this . statusBarTracker [ document . uri . toString ( ) ] = statusBar ;
You can’t perform that action at this time.
0 commit comments