Skip to content
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

Offer rename refactoring of Rascal identifiers #382

Open
DavyLandman opened this issue May 29, 2024 · 6 comments · Fixed by #389 or #397
Open

Offer rename refactoring of Rascal identifiers #382

DavyLandman opened this issue May 29, 2024 · 6 comments · Fixed by #389 or #397
Assignees
Labels
enhancement New feature or request good first issue Good for newcomers

Comments

@DavyLandman
Copy link
Member

DavyLandman commented May 29, 2024

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:

  • function
  • variable
  • module name

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

  • write the refactoring in Java: would be a bad idea, will be quite verbose
  • create a generic refactoring framework that models any refactoring of LSP to rascal, such that we can leverage that: too much work as an initial addition. First get rename right, use that implementation to learn how to do the rest.

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

@DavyLandman DavyLandman added enhancement New feature or request good first issue Good for newcomers labels May 29, 2024
@jurgenvinju
Copy link
Member

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

@jurgenvinju
Copy link
Member

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
Copy link
Contributor

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
Copy link
Contributor

toinehartman commented Jun 17, 2024

Feature milestones

Milestone 1 [boilerplate] (#389)

  • Testing framework
  • Support for renaming local variables

Milestone 2 [locals] (#389)

  • Nested function names
  • Formal parameters
  • Pattern variables

Milestone 3 [globals] (#397)

  • Global variables
  • Functions (private)
  • Functions (public)
  • Aliases
  • Overloads
  • Extends
  • Collection fields
  • Data fields
  • Type parameters
  • Annotations
  • Tags
  • Function keyword parameters
  • Constructor keyword parameters

Milestone 4 [modules] (#397)

  • Module names

Milestone 5 [grammars]

  • Symbols
  • Productions
  • Production fields

@DavyLandman DavyLandman reopened this Jul 8, 2024
@toinehartman toinehartman linked a pull request Aug 1, 2024 that will close this issue
@toinehartman toinehartman changed the title Offer rename refactoring of rascal identifiers Offer rename refactoring of Rascal identifiers Aug 19, 2024
@urbanfly
Copy link

urbanfly commented Sep 5, 2024

@DavyLandman when will this be available in a new release?

@DavyLandman
Copy link
Member Author

hi @urbanfly I hope soon, but there are some bugs we're still ironing out for the typechecker.

Once those are squashed, our priority will be to make a full release.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request good first issue Good for newcomers
Projects
None yet
4 participants