Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

arity0 hovering issues#440

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to ourterms of service andprivacy statement. We’ll occasionally send you account related emails.

Already on GitHub?Sign in to your account

Merged
cristianoc merged 5 commits intomasterfromarity0
May 31, 2022
Merged
Show file tree
Hide file tree
Changes fromall commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
20 changes: 19 additions & 1 deletionanalysis/tests/src/Hover.res
View file
Open in desktop
Original file line numberDiff line numberDiff line change
Expand Up@@ -111,4 +111,22 @@ let typeDuplicate = AA.fnnxx
// ^hov

@live let dd = 34
// ^hov
// ^hov

let arity0a = (. ()) => {
//^hov
let f = () => 3
f
}

let arity0b = (. (), . ()) => 3
// ^hov

let arity0c = (. (), ()) => 3
// ^hov

let arity0d = (. ()) => {
// ^hov
let f = () => 3
f
}
12 changes: 12 additions & 0 deletionsanalysis/tests/src/expected/Hover.res.txt
View file
Open in desktop
Original file line numberDiff line numberDiff line change
Expand Up@@ -70,3 +70,15 @@ Attribute id:live:[112:0->112:5] label:live
Completable: Cdecorator(live)
{"contents": "The `@live` decorator is for reanalyze, a static analysis tool for ReScript that can do dead code analysis.\n\n`@live` tells the dead code analysis that the value should be considered live, even though it might appear to be dead. This is typically used in case of FFI where there are indirect ways to access values. It can be added to everything that could otherwise be considered unused by the dead code analysis - values, functions, arguments, records, individual record fields, and so on.\n\n[Read more and see examples in the documentation](https://rescript-lang.org/syntax-lookup#live-decorator).\n\nHint: Did you know you can run an interactive code analysis in your project by running the command `> ReScript: Start Code Analyzer`? Try it!"}

Hover tests/src/Hover.res 115:4
{"contents": "```rescript\n(.) => unit => int\n```"}

Hover tests/src/Hover.res 121:4
{"contents": "```rescript\n(.) => (.) => int\n```"}

Hover tests/src/Hover.res 124:4
{"contents": "```rescript\n(. unit, unit) => int\n```"}

Hover tests/src/Hover.res 127:5
{"contents": "```rescript\n(.) => unit => int\n```"}

14 changes: 6 additions & 8 deletionsanalysis/vendor/res_outcome_printer/res_outcome_printer.ml
View file
Open in desktop
Original file line numberDiff line numberDiff line change
Expand Up@@ -233,20 +233,18 @@ let printPolyVarIdent txt =
)
| Otyp_alias (typ, aliasTxt) ->
Doc.concat [
Doc.lparen;
printOutTypeDoc typ;
Doc.text " as '";
Doc.text aliasTxt;
Doc.rparen
Doc.text aliasTxt
]
| Otyp_constr (
Oide_dot (Oide_dot (Oide_ident "Js", "Fn") , "arity0"), (* Js.Fn.arity0 *)
[Otyp_constr (Oide_ident ident, [])] (* int or unit or string *)
[typ]
) ->
(* Js.Fn.arity0<int> -> (.) =>int*)
(* Js.Fn.arity0<t> -> (.) =>t*)
Doc.concat [
Doc.text "(. ()) => ";
Doc.text ident;
Doc.text "(.) => ";
printOutTypeDoc typ;
]
| Otyp_constr (
Oide_dot (Oide_dot (Oide_ident "Js", "Fn") , ident), (* Js.Fn.arity2 *)
Expand DownExpand Up@@ -352,7 +350,7 @@ let printPolyVarIdent txt =
let i = ref 0 in
let package = Doc.join ~sep:Doc.line ((List.map2 [@doesNotRaise]) (fun lbl typ ->
Doc.concat [
Doc.text (if i.contents > 0 then "andtype" else "with type ");
Doc.text (if i.contents > 0 then "and " else "with ");
Doc.text lbl;
Doc.text " = ";
printOutTypeDoc typ;
Expand Down

[8]ページ先頭

©2009-2025 Movatter.jp