Skip to content

Commit 1160398

Browse files
author
Kapil Borle
committed
Trigger formatting on new line
1 parent e70b678 commit 1160398

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
@@ -457,6 +457,7 @@ class PSDocumentFormattingEditProvider implements
457457

458458
export class DocumentFormatterFeature implements IFeature {
459459
private firstTriggerCharacter: string = "}";
460+
private moreTriggerCharacters: string[] = ["\n"];
460461
private formattingEditProvider: vscode.Disposable;
461462
private rangeFormattingEditProvider: vscode.Disposable;
462463
private onTypeFormattingEditProvider: vscode.Disposable;
@@ -474,7 +475,8 @@ export class DocumentFormatterFeature implements IFeature {
474475
this.onTypeFormattingEditProvider = vscode.languages.registerOnTypeFormattingEditProvider(
475476
"powershell",
476477
this.documentFormattingEditProvider,
477-
this.firstTriggerCharacter);
478+
this.firstTriggerCharacter,
479+
...this.moreTriggerCharacters);
478480
}
479481

480482
public setLanguageClient(languageclient: LanguageClient): void {

0 commit comments

Comments
 (0)