-
Notifications
You must be signed in to change notification settings - Fork 469
Add completions for included modules #7509
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
base: master
Are you sure you want to change the base?
Conversation
open Types | ||
|
||
@send | ||
external addPos: (context, float, float) => comp = "pos" |
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.
This becomes available in Wall
after its inclusion.
|
||
let make = () => { | ||
[ | ||
// k. |
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.
We should be able to complete k->addPos
and k->addPosFromVec2
.
@@ -357,6 +357,7 @@ let completePipeChain ~(inJsxContext : bool) (exp : Parsetree.expression) = | |||
|
|||
let completionWithParser1 ~currentFile ~debug ~offset ~path ~posCursor | |||
?findThisExprLoc text = | |||
let cursorPath = Stack.create () in |
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.
I'm trying to keep track of which nested modules we have visited so far.
So, I can construct the current path
of the cursor.
@@ -1180,8 +1182,17 @@ and getCompletionsForContextPath ~debug ~full ~opens ~rawOpens ~pos ~env ~exact | |||
|> TypeUtils.filterPipeableFunctions ~synthetic:true ~env ~full | |||
~targetTypeId:mainTypeId | |||
in | |||
(* Add completions from current fully qualified path module *) |
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.
Here, I use the cursorPath
collected via the frontend, to ask for DotPipeCompleteFromCurrentModule.Wall
completions.
This is the only way I get the addPos
and addPosFromVec2
completions.
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.
This, of course, doesn't take into account functions defined after the cursor.
So that is not ideal.
It also proposes fully qualified function calls instead of having no path at all.
I'm a little stuck on this one, could use a pointer @zth if you have any ideas.