I want to use vscode.window.showInformationMessage
to show some message. But I cannot newline in it.
What I want:
title:xxx
description:xxx
I actual get:
title:xxx description:xxx
My code:
vscode.window.showInformationMessage("title:xxx\ndescription:xxx");
In the local searchbox ( ctrl + f ) you can insert newlines by pressing ctrl + enter . If you use the global search ( ctrl + shift + f ) you can insert newlines by pressing shift + enter . If you want to search for multilines by the character literal, remember to check the rightmost regex icon. Save this answer.
Fold (Ctrl+Shift+[) folds the innermost uncollapsed region at the cursor. Unfold (Ctrl+Shift+]) unfolds the collapsed region at the cursor. Toggle Fold (Ctrl+K Ctrl+L) folds or unfolds the region at the cursor.
This is not exactly the solution but you can use modal dialog option.
vscode.window.showInformationMessage('First line\nSecond line\nThird line', { modal: true });
With the custom dialog enabled in settings.json
it looks like:
"window.dialogStyle": "custom",// VSCode >= 1.50.0
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With