Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Auto complete definitions within imports #2152
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
Auto complete definitions within imports #2152
Changes from 2 commits
47fd19d
34e3e7a
31471c7
8b9310e
dcfdbfc
863a483
9306c91
21af666
2111b5e
f899d00
987119b
b3a0ad7
b54678d
7a73509
10919e0
2c519c4
387e5d0
feaa4e9
5bfff3d
8a167a0
4f85abc
daf1915
1c1012d
80820bb
b79af6b
7454e6c
f0e25c3
fa7763e
1077480
88f2c56
110ce17
63fb733
6df51ae
440fb82
689b1b3
File filter
Filter by extension
Conversations
Jump to
There are no files selected for viewing
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.
What does this function do?
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 had a typo in the name, however, it builds a map of
"module.name" -> ["functions" .. ]
which I use to look up the available functions for that moduleThere 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.
And why is it needed? Can't you use the ExportsMap as it is?
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 believe I need it because I have to group on
"module.name"
and use that as the key to look up all functions within that module.ExportsMap
as it is seems to be a map of"function-name" -> [{moduleNameText: "module-name", name: "function-name" ...} ]
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.
Ah yes, you are right.
But why build a map to do only one lookup and then throw it away?
Neither is good enough, you want O(logN). How? Probably by changing the representation of the exports map to add a second index, the module name.
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.
Do you think the first suggestion would be a good first pass? With potential follow up commits to pull out a plugin?
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.
The ExportsMap only indexes package modules. You will need to fetch the ModIface for local modules. So both changes are needed
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 took a first pass at this. There is still more work to do. As of this comment, I am just generating the map based on the already existing map. I also see that this does not work for local modules, as you suggested.
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.
Second pass - I generate the map from the modIface rather than the existing map.. This still does not account for local modules
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.
OK, I now generate the map for local modules as well. I will take a look at your other comments.