Skip to content

Commit

Permalink
make label for the code action for extracting a local module to a sep…
Browse files Browse the repository at this point in the history
…arate file clearer (rescript-lang#996)
  • Loading branch information
zth authored and jfrolich committed Sep 3, 2024
1 parent dba290f commit c6c7951
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 4 deletions.
5 changes: 4 additions & 1 deletion analysis/src/Xform.ml
Original file line number Diff line number Diff line change
Expand Up @@ -173,7 +173,10 @@ module ModuleToFile = struct
in
changed :=
Some
(CodeActions.makeWithDocumentChanges ~title:"Extract module as file"
(CodeActions.makeWithDocumentChanges
~title:
(Printf.sprintf "Extract local module \"%s\" to file \"%s\""
moduleName (moduleName ^ ".res"))
~kind:RefactorRewrite
~documentChanges:
[
Expand Down
4 changes: 2 additions & 2 deletions analysis/tests/not_compiled/expected/DocTemplate.res.txt
Original file line number Diff line number Diff line change
Expand Up @@ -69,7 +69,7 @@ module T = {
let b = 1
// ^xfm
}
Hit: Extract module as file
Hit: Extract local module "T" to file "T.res"

CreateFile: T.res

Expand Down Expand Up @@ -100,7 +100,7 @@ newText:

*/
let b = 1
Hit: Extract module as file
Hit: Extract local module "T" to file "T.res"

CreateFile: T.res

Expand Down
2 changes: 1 addition & 1 deletion analysis/tests/src/expected/Xform.res.txt
Original file line number Diff line number Diff line change
Expand Up @@ -168,7 +168,7 @@ newText:
}

Xform src/Xform.res 72:5
Hit: Extract module as file
Hit: Extract local module "ExtractableModule" to file "ExtractableModule.res"

CreateFile: ExtractableModule.res

Expand Down

0 comments on commit c6c7951

Please sign in to comment.