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

Offer rename refactoring of rascal identifiers #382

Open DavyLandman opened 1 month ago

DavyLandman commented 1 month ago

Is your feature request related to a problem? Please describe. I want to have rename refactoring work for rascal.

When I as a user trigger rename on:

I want rascal to calculate the correct rename operation based on whats currently open in the workspace.

Describe the solution you'd like LSP has a dedicated api for rename. To pace our development, I would like to have support for rename first, and to the generic refactorings in a later stage. Similarly, if needed, we can split the support for rascal vs the support for DSLs.

Ideally the rename command is executed in a similar way as outline is done, we have rascal code that is invoked by the rascal-lsp server.

Describe alternatives you've considered

Additional context Good news is that we already have TextEdits in Rascal, which map cleanly on the edits that LSP needs.

jurgenvinju commented 1 month ago

Textedits also cover file renamings, so that's cool if we change a module name

jurgenvinju commented 1 month ago

It would be best if we can reuse information generated by the type-checker; for example the summaries, collect them for all modules in a project and then reverse the references.

I would limit the current functionality to within a current project and push cross project uses/renamings to an enhancement issue. We don't even have cross-project incremental type-checking

toinehartman commented 1 month ago

Thanks for the directions! I set up all the boilerplate today and was just looking into (re)using type checker information and collecting across all modules. @DavyLandman and I will discuss tomorrow.

toinehartman commented 3 weeks ago

Feature milestones

Milestone 1 [boilerplate] (#389)

Milestone 2 [locals] (#389)

Milestone 3 [globals]

Milestone 4 [modules]

Milestone 5 [grammars]