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

Commit e103940

Browse files
committed
Fix issue for uncurried functions where the internal definition of Js.Fn.arity is shown on hover
Uncurried types are handled by the outcome printer. Add some additional logic on hover to recognize `Js.Fn.arityxx`, and avoid showing the type definition, which is internal.
1 parent 5afdd84 commit e103940

File tree

2 files changed

+8
-1
lines changed

2 files changed

+8
-1
lines changed

Changes.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
## master
22
- Add support for autocomplete for `foo->`: the type of `foo` is used to determine the module to take completions from.
33
- Add support for autocomplete for decorators such as `@module` and `@val`.
4+
- Fix issue for uncurried functions where the internal definition of `Js.Fn.arity` is shown on hover. (See https://github.com/rescript-lang/rescript-editor-support/issues/62).
45

56
## Release 1.0.5 of rescript-vscode
67
This [commit](https://github.com/rescript-lang/rescript-editor-support/commit/6bdd10f6af259edc5f9cbe5b9df06836de3ab865) is vendored in [rescript-vscode 1.0.5](https://github.com/rescript-lang/rescript-vscode/releases/tag/1.0.5).

src/rescript-editor-support/Hover.re

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -120,7 +120,13 @@ let newHover = (~rootUri, ~file: SharedTypes.file, ~getModule, loc) => {
120120
let%opt path = typ |> Shared.digConstructor;
121121
let%opt (_env, {docstring, name: {txt}, item: {decl}}) =
122122
digConstructor(~env, ~getModule, path);
123-
Some((decl |> Shared.declToString(txt), docstring));
123+
let isUncurriedInternal =
124+
Utils.startsWith(Path.name(path), "Js.Fn.arity");
125+
if (isUncurriedInternal) {
126+
None;
127+
} else {
128+
Some((decl |> Shared.declToString(txt), docstring));
129+
};
124130
};
125131
let (typeString, docstring) =
126132
switch (extraTypeInfo) {

0 commit comments

Comments
 (0)