Skip to content

Commit 00b67da

Browse files
cristianocchenglou
authored andcommitted
Fix issue where type variables are printed with global renaming when hovering or autocompleting a module
Fixes rescript-lang#38. Turns out `Printtyp` keeps global state when converting to outcome printer data structures. Reses the data before converting types to strings.
1 parent b60dcd0 commit 00b67da

File tree

2 files changed

+3
-0
lines changed

2 files changed

+3
-0
lines changed

Diff for: Changes.md

+1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
## master
2+
- Fix issue where type variables are printed with global renaming when hovering or autocompleting a module (see https://github.com/rescript-lang/rescript-editor-support/issues/38).
23

34
## Release 1.0.1 of rescript-vscode
45
This [commit](https://github.com/rescript-lang/rescript-editor-support/commit/232ad609766c415048750c5cc828973a9995f382) is vendored in [rescript-vscode 1.0.1](https://github.com/rescript-lang/rescript-vscode/releases/tag/1.0.1).

Diff for: src/rescript-editor-support/PrintType.re

+2
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,13 @@
11
let printExpr = typ => {
2+
Printtyp.reset_names();
23
Res_doc.toString(
34
~width=60,
45
Res_outcome_printer.printOutTypeDoc(Printtyp.tree_of_typexp(false, typ)),
56
);
67
};
78

89
let printDecl = (~recStatus, name, decl) => {
10+
Printtyp.reset_names();
911
Res_doc.toString(
1012
~width=60,
1113
Res_outcome_printer.printOutSigItemDoc(

0 commit comments

Comments
 (0)