scastie icon indicating copy to clipboard operation
scastie copied to clipboard

Autocomplete

Open vincenzobaz opened this issue 4 years ago • 2 comments

To get started https://github.com/scalacenter/scastie/search?q=autocomplete and #330

vincenzobaz avatar Aug 02 '21 09:08 vincenzobaz

refs: https://github.com/scalacenter/scastie/issues/602 duplicated

He-Pin avatar Apr 01 '22 08:04 He-Pin

I think the best path forward would be to upgrade to CodeMirror 6, which does support LSP (see https://github.com/furqansoftware/codemirror-languageserver), which could communicate to the build server started by scastie. A challenge will be to keep the build server live (currently, we keep a pool of sbt instances live, but we kill them when a user works on a code snippet that uses a different build configuration). Also, to reduce the load on the server, IDE features should be triggered only if explicitly requested (so, not on every key stroke).

A tentative roadmap would be:

  • [x] Update CodeMirror to version 6
  • [ ] Start Metals instances along with the sbt instances and expose BSP servers to the browser through HTTP, and connect CodeMirror to them
  • [ ] Assess usability / performance
  • [ ] Discuss options, if necessary, to improve the usability (e.g. restrict IDE features to snippets that use a “bare” build configuration, replace sbt instances with a bloop server, cache more information in execution results so that “type on hover” does not need to perform a client-server roundtrip, etc.)

Any other idea?

(an alternative code editor might be Theia, or maybe VS Code / Monaco itself if we could make it more lightweight)

julienrf avatar Jul 06 '22 14:07 julienrf