usethesource / rascal-language-servers

An LSP server for Rascal which includes an easy-to-use LSP generator for languages implemented in Rascal, and an interactive terminal REPL.
BSD 2-Clause "Simplified" License
10 stars 7 forks source link

Run parametric/dsl `summary` on every change, not just on saves #356

Closed DavyLandman closed 4 months ago

DavyLandman commented 5 months ago

Is your feature request related to a problem? Please describe. Currently the summarizer is only run on a save. Apart from the issues with that (see #354), it also delays feedback to the user. I would like an option to run the summary as quickly as we can.

Describe the solution you'd like Give the summarizer a new kw param: bool runOnlyOnSave = true that a user can turn off if they've written a fast-enough summarizer.

Rascal-LSP would then run the summarizer on every change. Rate-limiting it based on the runtime of the past 5 summarizes of that file.

Describe alternatives you've considered Alternatives considered:

  1. Make a extra case of the summarizer that is run more frequently
  2. Make running the summerizer on every change the default, and introduce a build contribution, that is triggered on save (like we had in eclipse). I think that due to the insights in #355, this might be an even better solution long term.

Additional context

jurgenvinju commented 5 months ago

I don't see any reason not to implement the desired situation now. The more intermediate solutions we introduce the larger legacy we create.

jurgenvinju commented 5 months ago

The only reason we run the summarize on safe is because the current implementations are too slow to run during editing.

So let's have a build function that produces the same summaries. We can merge the output as we do know. And a simple analyzer contribution that also produces summaries for faster executing analyses.

This was the original plan which was delayed because the rascal type-checker was too slow. It follows the original design from the oopsla paper on IMP.

jurgenvinju commented 5 months ago

For backwards compatibility let's:

DavyLandman commented 4 months ago

This is now implemented in #357 and released in v0.11.0