rescript-vscode icon indicating copy to clipboard operation
rescript-vscode copied to clipboard

Make rename work for component names

Open cristianoc opened this issue 4 years ago • 2 comments
trafficstars

Renaming the module name used in a component does not automatically propagate to JSX, because JSX indirectly refers to the make/makeProps functions.

cristianoc avatar May 17 '21 13:05 cristianoc

Came here to report this.

alex35mil avatar Mar 29 '23 07:03 alex35mil

Briefly on how this could be done. The rename command should recognise when a module C is a component, and in that case look in the typed Ast for references to C.make. When a reference is found, use the location to find in the parse tree whether C.make is part of a jsx expression. If it is, change the name of the component.

cristianoc avatar Mar 29 '23 07:03 cristianoc