-
Notifications
You must be signed in to change notification settings - Fork 347
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 mode #1040
Comments
This feature would be killer for adoption. Worksheets worked pretty darn good in Scala IDE and some people are still hanging on to the tool because of that feature. Everyone wants to have worksheets like the kind you find for Python which is a big reason for the number of people using the language. These tools that make it easy for the masses are the key to greater adoption for Scala. |
Adding a few notes from offline discussions with several people including @jvican, @Baccata, @alexarchambault (Brainstorming) We could potentially support "worksheets" in several different forms:
We wouldn't have to implement all of these, I'm just exploring the possible solution space. Ammonite scriptsIt would be nice to support
We need the classpath and scalac options in order to provide completions/type-at-point/parameter-hints. To show the results of evaluating an ammonite script, we could
NotebooksAlmond has a nice library API The Python VS Code extension implements in TypeScript on the client side the splitting of code cells via magic I have a feeling it might be good to wait a few months and see if something moves with the vscode-python polyglot support. WorksheetsPossible implementation approaches:
MarkdownSimilarly to regular worksheets, we could build on top of mdoc to instrument and evaluate code fences inside markdown files. The worksheet mode ( |
Just a few comments about features related to notebook support. Thanks for the overview above. Lots of notebook type concepts are in engineering/math tools like Matlab, Maple, Mathematica etc. A good example I have used is Mathematica's notebooks. Links - http://www.wolfram.com/technologies/nb/ - and - https://reference.wolfram.com/language/guide/NotebookBasics.html Today of course there is Almond, spark-notebook, and notebook systems in Databricks and the like, let alone the Jupiter and other Python tools. Useful features:
I would like to see a minimal worksheet system to start with more features later. I think it might be an option to have the dependencies in a generated file/directory and be listed in sbt format or something you can just copy from Maven central if you need to add them. When creating a worksheet, maybe the file could be generated like is done for |
Have a basic working implementation that
A small preview Will try to open a PR as soon as I get around to clean up the branch. |
@ekrich this is a "minimal" worksheet implementation to get the ball moving. The current implementation doesn't provide several features that I would love to support down the road
|
Previously, there as no way for users to interactively explore APIs and evaluate small programs. This commit adds a new "worksheet mode" for files with the extension ".worksheet.sc". These files allow toplevel statements and the statements are evaluated on file save, with evaluated results displayed inline alongside the code using a new "Decoration Protocol", a LSP extension. Fixes scalameta#1040.
How to show the type, like intellij and scala-ide? |
@robsonpeixoto best to do it with Hover I think. |
It would be nice if there was a "worksheet mode" that allows you to interactively evaluate toplevel statements inside the editor and see the results.
Some challenges:
The text was updated successfully, but these errors were encountered: