Skip to content
This repository has been archived by the owner on Dec 21, 2021. It is now read-only.

name refactoring #12

Open
radiatoryang opened this issue Sep 8, 2018 · 1 comment
Open

name refactoring #12

radiatoryang opened this issue Sep 8, 2018 · 1 comment
Labels
enhancement New feature or request help wanted Extra attention is needed

Comments

@radiatoryang
Copy link
Owner

radiatoryang commented Sep 8, 2018

there are at least two Yarn name types we'd want to be able to refactor:

  • node names
  • variable names

node names in Yarn are very important...

  • nodes link to each other via node names
  • there can be no duplicate node names, validation is needed

however, "never changing your node names" makes it difficult to reorganize a complicated story sometimes

so, it would be great if Merino could automatically change node name references if you rename a node

  • renaming a node that is referenced in another node should prompt a refactoring confirmation pop-up, where merino asks to find and replace all instances of that node name throughout the whole yarn file
    • detecting node references would likely require a regex, to make sure it's referenced within double brackets like [[NodeName]]
  • also perform validation and make sure there are no duplicate node names in the file
  • also include a "disable refactoring pop-up" etc. setting in the Merino Editor Preferences page

and then, do the same for variable names (like $variableName) as well

for now, unassigned / with no timeline on when this will happen, unless everyone starts screaming that they need this much sooner

@radiatoryang radiatoryang added enhancement New feature or request help wanted Extra attention is needed good first issue Good for newcomers and removed good first issue Good for newcomers labels Sep 8, 2018
@addie-lombardo
Copy link
Collaborator

addie-lombardo commented Sep 8, 2018

Renaming nodes won't be an issue thanks to the RenameEnded method.

On the other hand, variable names will be a bit more tricky to implement UX wise, The quickest/easiest way to implement the functionality would be via a find and replace all prompt.

Edit: Due to variables being used across a project it would actually be best if variable refactoring was implemented through a prompt so the user can specify the scope of the files which would be affected.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
enhancement New feature or request help wanted Extra attention is needed
Projects
None yet
Development

No branches or pull requests

2 participants