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

Worksheet improvements #5277

Merged
merged 4 commits into from Oct 17, 2018

Conversation

Projects
None yet
2 participants
@smarter
Copy link
Member

smarter commented Oct 17, 2018

No description provided.

@smarter smarter requested a review from Duhemm Oct 17, 2018

smarter added some commits Oct 16, 2018

Use a CodeLens to run/cancel the worksheet
This makes it possible to run the worksheet without saving the document
or manually running the dotty.worksheet.run command. The new UI is also less
distracting since you don't get a notification pop-up every time the
worksheet is being run.
Remove worksheet cancellation on document change
This is unreliable because we change the document by adding newlines
when we receive a multi-line result for a given line of the worksheet
Use a color that is theme-specific for the worksheet output
This way we can be sure that our output is readable in all themes.

@smarter smarter force-pushed the dotty-staging:worksheet-fix-change branch from e619bc0 to 99ac060 Oct 17, 2018

@Duhemm

This comment has been minimized.

Copy link
Contributor

Duhemm commented Oct 17, 2018

I just noticed that cancellation doesn't work if the buffer has been changed:

val foo = 0
1 to 10 foreach println
while(true) {}
Run worksheets asynchronously
A worksheet in an infinite loop shouldn't block the whole language
server from responding to queries. We just need to be careful to lock
the language server when operating on trees since these operations may
not be thread-safe (for example, when a symbol gets forced). We could
also allow running multiple worksheets at the same time but this commit
doesn't implement that.

@smarter smarter force-pushed the dotty-staging:worksheet-fix-change branch from fcfb242 to 8c3319c Oct 17, 2018

@smarter smarter merged commit 965a2c0 into lampepfl:master Oct 17, 2018

2 checks passed

CLA User signed CLA
Details
continuous-integration/drone/pr the build was successful
Details
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment