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

Rework multi-line output handling in the worksheet #5582

Merged
merged 3 commits into from
Dec 10, 2018

Conversation

smarter
Copy link
Member

@smarter smarter commented Dec 9, 2018

Even after #5552 there were still situations were the worksheet output
was not displayed properly due to all the complications needed to handle
multi-line output.

Getting this right seems hopeless until vscode gets some better
API (microsoft/vscode#63600), so instead in
this commit we avoid the problem by only displaying the first line of
multi-line output. The complete output is still available by hovering
over the decoration which should be good enough.

Copy link
Contributor

@Duhemm Duhemm left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

Have you considered showing (+n lines) or or ↩️ instead of <truncated output>?

I think it may be clearer that more will be shown on hover if it says (+n lines).

Even after scala#5552 there were still situations were the worksheet output
was not displayed properly due to all the complications needed to handle
multi-line output.

Getting this right seems hopeless until vscode gets some better
API (microsoft/vscode#63600), so instead in
this commit we avoid the problem by only displaying the first line of
multi-line output. The complete output is still available by hovering
over the decoration which should be good enough.
@smarter
Copy link
Member Author

smarter commented Dec 10, 2018

I've settled for <n lines hidden>, it'd be even better if it was displayed in a different color but that would require using multiple decorations and I didn't want to add more complexity for now. Also when you're on the last line of the file and press Enter, if the line is decorated, then the decoration will be moved to the new last line of the file. I haven't found a way to avoid that and am wondering if it should be considered a vscode bug.

@smarter smarter merged commit 3c89d53 into scala:master Dec 10, 2018
@allanrenucci allanrenucci deleted the fix/worksheet-multiline branch December 10, 2018 22:47
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants