Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

VSCodeAPI 'showInformationMessage' do not support newlines. (\n) #7332

Closed
raphaelsantos opened this issue Mar 12, 2020 · 5 comments · Fixed by #7500
Closed

VSCodeAPI 'showInformationMessage' do not support newlines. (\n) #7332

raphaelsantos opened this issue Mar 12, 2020 · 5 comments · Fixed by #7500
Labels
bug bugs found in the application help wanted issues meant to be picked up, require help notifications issues related to notifications vscode issues related to VSCode compatibility

Comments

@raphaelsantos
Copy link

raphaelsantos commented Mar 12, 2020

Description

It should be possible for users to call showInformationMessage (VS Code API) with newlines included (\n). The following does not work for notification messages, but does work when passing MessageOption modal as true.

Reproduction Steps

  1. create a simple vscode extension which calls showInformationMessage passing modal: true and include newlines in the message.

Ex:

vscode.commands.registerCommand('extension.showModalMessage', () => {
  vscode.window.showInformationMessage('Hello World!\nHello World!\nHello World!', { modal: true });
})

OS and Theia version:

10.14.6
0.12.0

@vince-fugnitto vince-fugnitto added 🤔 needs more info issues that require more info from the author notifications issues related to notifications vscode issues related to VSCode compatibility labels Mar 12, 2020
@vince-fugnitto
Copy link
Member

@raphaelsantos are you certain it is supported in vscode?
I performed the following call in my extension, and the result was without newlines:

vscode.window.showInformationMessage('t\ne\ns\nt');

Screen Shot 2020-03-12 at 6 04 15 PM

Also, looking at their source code and past discussions, it looks like newlines aren't supported:

@vince-fugnitto
Copy link
Member

@raphaelsantos can you provide an example of a showInformationMessage extension which works in VS Code and not Theia?

@vince-fugnitto
Copy link
Member

vince-fugnitto commented Mar 26, 2020

@raphaelsantos are you certain it is supported in vscode?

@raphaelsantos can you provide an example of a showInformationMessage extension which works in VS Code and not Theia?

Please re-open the issue once the questions have been answered.
Based on findings it does not look like VS Code supports newlines either.

@raphaelsantos
Copy link
Author

raphaelsantos commented Apr 3, 2020

Hi @vince-fugnitto , I'm really sorry for taking all this time to answer.

Entering newline with \n actually works when calling showInformationMessage with MessageOptions {modal:true} on VSCode, but does not work on Theia.

@akosyakov akosyakov reopened this Apr 3, 2020
@akosyakov akosyakov added bug bugs found in the application help wanted issues meant to be picked up, require help and removed 🤔 needs more info issues that require more info from the author labels Apr 3, 2020
@vince-fugnitto
Copy link
Member

Hi @vince-fugnitto , I'm really sorry for taking all this time to answer.

Entering newline with \n actually works when calling showInformationMessage with MessageOptions {modal:true} on VSCode, but does not work on Theia.

No problem, thanks for getting back!
I confirmed it works for the modal dialog, I'll update the issue description to reflect that.

vince-fugnitto added a commit that referenced this issue Apr 3, 2020
Fixes #7332
Fixes #7491

The following commit fixes the following issues:
- it should now be possible for plugins to call the `showMessage` with newlines when using the `modal` MessageOption`.
- the `showMessage` should now support displaying the `isCloseAffordance` MessageType option.
- fixes the argument type for `MessageItem`.

Signed-off-by: vince-fugnitto <vincent.fugnitto@ericsson.com>
vince-fugnitto added a commit that referenced this issue Apr 23, 2020
Fixes #7332
Fixes #7491

The following commit fixes the following issues:
- it should now be possible for plugins to call the `showMessage` with newlines when using the `modal` MessageOption`.
- the `showMessage` should now support displaying the `isCloseAffordance` MessageType option.
- fixes the argument type for `MessageItem`.

Signed-off-by: vince-fugnitto <vincent.fugnitto@ericsson.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug bugs found in the application help wanted issues meant to be picked up, require help notifications issues related to notifications vscode issues related to VSCode compatibility
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants