You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Commit aac2e68
Browse filesBrowse the repository at this point in the historyBrowse files
Why:
Editor analysis models a functor by the structure of its result, so
hover on a functor showed its body as if it were a plain module, and
nothing said it takes arguments. The result structure now records the
parameters, and hover prints them in front of the body.
Diagnostic modified (hover on a functor):
Example:
module type Ord = {
type t
let compare: (t, t) => int
}
module MakeSet = (O: Ord) => {
type t = array<O.t>
let add = (s: t, x: O.t) => s->Array.concat([x])
}
Before (rescript): tests/analysis_tests/tests/src/HoverFunctor.res
module MakeSet: {
type t = array<O.t>
let add: (t, O.t) => array<O.t>
}
After (rescript): tests/analysis_tests/tests/src/HoverFunctor.res
module MakeSet: (O: Ord) => {
type t = array<O.t>
let add: (t, O.t) => array<O.t>
}
Review: Why not add a functor case to the analysis module type?
Completion, references and path resolution all treat a functor as its
result and would each need the new case; only hover displays the
parameters, so they are recorded on the result structure.
Review: What does hover show for an applied functor?
A plain module: an application is modelled by its signature, so
`module IntSet = MakeSet(IntOrd)` shows no parameters, and a partial
application such as `Pair(IntOrd)` shows only the remaining one.
Fixes: #9071
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01Kbf3gLMawVgtmiKy3TMBc3
Signed-off-by: Christoph Knittel <ck@cca.io>
0 commit comments