Skip to content

rename refactor#202

Merged
aviatesk merged 19 commits intomasterfrom
avi/renamerefactor
Oct 23, 2019
Merged

rename refactor#202
aviatesk merged 19 commits intomasterfrom
avi/renamerefactor

Conversation

@aviatesk
Copy link
Copy Markdown
Member

@aviatesk aviatesk commented Oct 23, 2019

UPDATED: moved to #203


Purpose

Implement rename refactoring command:

  • rename local binding
  • rename global bindings (module-based)

Approach

  • use MacroTools.jl for easy tokenizing and code replacing
  • for module-based global refactoring, CSTParser-based static file detection is used:
    • since our Revise-like module file detection will easily fail with the refactorings, which breaks precompilation cache
  • first tries local refactoring, and then move to global refactoring if needed
  • rename refactoring on fields is all suppressed, since not every code is statically typed and so I think we would end up with lots of false positive
  • global refactoring are designed to work only when it's called on the definition place

Task / Achievements

  • local refactor
  • module-based global refactor
  • graceful messages
    • notice the need of refactoring in the parent module if the refactored binding is imported/overloaded
    • report back error message
    • notice refactored files
    • show context
  • handle edge cases
    • suppress keyword refactoring
    • suppress field refactoring
    • suppress global refactoring that are not called at a definition place
    • halt global refactoring if files without write permission detected
    • global refactoring with dot accessor like Atom.isdebugging(), Base.countlines(args...)
    • global refactoring on macro
  • test

Loading
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant