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

Renaming #2862

Draft
wants to merge 9 commits into
base: main
Choose a base branch
from
Draft

Renaming #2862

wants to merge 9 commits into from

Conversation

janmasrovira
Copy link
Collaborator

@janmasrovira janmasrovira commented Jun 26, 2024

This pr allows renaming identifiers from the command line by using juvix format --in-place --dev-rename <rename-spec>.

I've marked the flag as dev because it is considered unsafe as it can cause shadowing, ambiguity or similar problems. Alos, qualified names are not handled properly. At the moment, it should not be used by end-users.

The <rename-spec> part has the following syntax:

<rename-spec> := <PkgName> ; <TopModuleName> ; <OldName> -> <NewName>

<PkgName> and <TopModuleName> are allowed to be omitted with an _.

Example usage:

  1. Renames the if identifier defined in the stdlib package, in the module
    `Stdlib.Data.Bool.Base`, by an `ite`
    juvix format --dev-rename "_;_;if -> ite" --in-place
    
  2. Renames the if identifier defined in any package, in any module, by an ite
    juvix format --dev-rename "_;_;if -> ite" --in-place
    

@janmasrovira janmasrovira added enhancement New feature or request CLI labels Jun 26, 2024
@janmasrovira janmasrovira added this to the 0.6.3 milestone Jun 26, 2024
@janmasrovira janmasrovira self-assigned this Jun 26, 2024
@janmasrovira janmasrovira force-pushed the renaming branch 4 times, most recently from cc80b76 to c296bc5 Compare July 1, 2024 17:07
@jonaprieto
Copy link
Collaborator

This would be quite useful! Please open a PR on vscode-juvix once you merge this so we can implement the renaming provider in VsCode.

@paulcadman paulcadman modified the milestones: 0.6.5, 0.6.6 Aug 15, 2024
@lukaszcz lukaszcz modified the milestones: 0.6.6, 0.6.7 Sep 4, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
CLI enhancement New feature or request
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants