Skip to content

Commit 13d121c

Browse files
author
Kapil Borle
committed
Trigger formatting on new line
1 parent 558204c commit 13d121c

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

src/features/DocumentFormatter.ts

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -452,6 +452,7 @@ class PSDocumentFormattingEditProvider implements
452452

453453
export class DocumentFormatterFeature implements IFeature {
454454
private firstTriggerCharacter: string = "}";
455+
private moreTriggerCharacters: string[] = ["\n"];
455456
private formattingEditProvider: vscode.Disposable;
456457
private rangeFormattingEditProvider: vscode.Disposable;
457458
private onTypeFormattingEditProvider: vscode.Disposable;
@@ -469,7 +470,8 @@ export class DocumentFormatterFeature implements IFeature {
469470
this.onTypeFormattingEditProvider = vscode.languages.registerOnTypeFormattingEditProvider(
470471
"powershell",
471472
this.documentFormattingEditProvider,
472-
this.firstTriggerCharacter);
473+
this.firstTriggerCharacter,
474+
...this.moreTriggerCharacters);
473475
}
474476

475477
public setLanguageClient(languageclient: LanguageClient): void {

0 commit comments

Comments
 (0)