-
Notifications
You must be signed in to change notification settings - Fork 463
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
[WIP] Global per-project configuration of autocomplete #7330
base: master
Are you sure you want to change the base?
Conversation
@@ -415,6 +415,7 @@ ContextPath Value[String, split](Nolabel, Nolabel) | |||
ContextPath Value[String, split] | |||
Path String.split | |||
Path Stdlib.Array.ma | |||
Path ArrayUtils.ma |
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 change in output is fine.
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.
Notice how both "configured" global completions work in this file.
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.
Changes here seems related to changes in master that just hasn't been synced. So we can ignore this for now.
@@ -1135,6 +1135,32 @@ and getCompletionsForContextPath ~debug ~full ~opens ~rawOpens ~pos ~env ~exact | |||
| _ -> false | |||
else true) | |||
in | |||
|
|||
(* TODO(config-complete-builtins) This config and config resolution should come from `package` instead. *) |
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.
package
here is under full.package
I believe, and is a concept used throughout the analysis. It represents the information needed from rescript.json
.
(* TODO(config-complete-builtins) This config and config resolution should come from `package` instead. *) | ||
let pretendPackageBuiltinsConfig = | ||
Misc.StringMap.of_list | ||
[("array", ["ArrayUtils"]); ("Fastify.t", ["FastifyExt"])] |
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 is an array of identifiers because you could configure several modules to complete from.
The format should be Path.To.Module
. These examples are all single module paths, but could've just as easily been for example Utils.Array
instead of ArrayUtils
. Might be good adding test cases for that as well.
cc @fhammerschmidt
This hard codes a setup that works for doing global configuration of autocomplete. What's needed here is to connect the dots:
rescript.json
, and read from that in the analysis toolingrescript.json
<12
as well