Refactor Tool

From Adam Colton
Revision as of 19:09, 23 September 2019 by Adamcolton (talk | contribs) (Created page with "Like golangs eg. Takes a script (also in the Gryphon language) and manipulates the syntax tree. == Selector == This is actually something of a challenge. We need a way to de...")
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to navigation Jump to search

Like golangs eg.

Takes a script (also in the Gryphon language) and manipulates the syntax tree.

Selector

This is actually something of a challenge. We need a way to define what we're selecting.

If the tool is being used interactively this can just be a location.

If a user is writing a script, it can be done with contexts. So the ID property on the Foo struct would be "ID.Foo".

Scope

Targets a package. If the package is an application, it can cascade to the modules.

Operations

Rename

Yup.

Change Type

Requires a converter function. So changing Foo from type A to B requires a function of func(a A) B. If we enconter

 var foo A = someA

it becomes

 var foo B = Convert(someA)