Skip to content
This repository was archived by the owner on Apr 24, 2021. It is now read-only.

Commit 670cce5

Browse files
committed
Fix issue where type variables are printed with global renaming when hovering or autocompleting a module
Fixes #38. Turns out `Printtyp` keeps global state when converting to outcome printer data structures. Reses the data before converting types to strings.
1 parent ea0c11a commit 670cce5

File tree

2 files changed

+3
-0
lines changed

2 files changed

+3
-0
lines changed

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).

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)