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
200200 DocumentFormattingRequest . type ,
201201 {
202202 textDocument : TextDocumentIdentifier . create ( document . uri . toString ( ) ) ,
203- options : {
204- insertSpaces : true ,
205- tabSize : 4
206- }
203+ options : this . getEditorSettings ( )
207204 } ) ;
208205 }
209206
@@ -449,6 +446,14 @@ class PSDocumentFormattingEditProvider implements
449446 return settings ;
450447 }
451448
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+
452457 private static showStatusBar ( document : TextDocument , hideWhenDone : Thenable < any > ) : void {
453458 let statusBar = AnimatedStatusBar . showAnimatedStatusBarMessage ( "Formatting PowerShell document" , hideWhenDone ) ;
454459 this . statusBarTracker [ document . uri . toString ( ) ] = statusBar ;
You can’t perform that action at this time.
0 commit comments