-
Notifications
You must be signed in to change notification settings - Fork 57
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 our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Nested expression completion #682
Conversation
@@ -931,6 +931,30 @@ let findLocalCompletionsForValuesAndConstructors ~(localTables : LocalTables.t) | |||
(processLocalModule ~prefix ~exact ~env ~localTables); | |||
List.rev_append localTables.resultRev valuesFromOpens | |||
|
|||
let findLocalCompletionsForValues ~(localTables : LocalTables.t) ~env ~prefix |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Slimmed down version of a pre-existing function (but that handles both this + constructors). We don't want constructors in typed completion, since they are handled by the typed completion itself.
@@ -1098,6 +1122,28 @@ let extractFunctionType ~env ~package typ = | |||
in | |||
loop ~env [] typ | |||
|
|||
let getComplementaryCompletionsForTypedValue ~opens ~allFiles ~scope ~env prefix |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Also a slimmed down version of a pre-existing fn.
@@ -1193,6 +1239,111 @@ let findReturnTypeOfFunctionAtLoc loc ~(env : QueryEnv.t) ~full ~debug = | |||
| _ -> None) | |||
| _ -> None | |||
|
|||
let getJsxLabels ~componentPath ~findTypeOfValue ~package = |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Moved, not changed.
typ |> getLabels | ||
| None -> [] | ||
|
||
let getArgs ~env (t : Types.type_expr) ~full = |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Moved, not changed.
analysis/tests/src/expected/CompletionFunctionArguments.res.txt
Outdated
Show resolved
Hide resolved
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
some minor comments
… regular completions
5a031fd
to
3245210
Compare
This extends the current expression completion to handle more cases (records, arrays, tuples, etc), and also handle nested expressions (record fields, constructor payloads, etc etc).
It's essentially a one-to-one port of the nested pattern completion, but for expressions instead.
After this lands, we can soon start refactoring and break up the giant CompletionFrontend/CompletionBackend a bit in my opinion.