Join GitHub today
GitHub is home to over 31 million developers working together to host and review code, manage projects, and build software together.
Sign upMerge `ModuleTree` and `ModuleItemMap` #723
Comments
matklad
added
E-hard
fun
labels
Feb 1, 2019
matklad
changed the title
Merge `ModleTree` and `ModuleItemMap`
Merge `ModuleTree` and `ModuleItemMap`
Feb 1, 2019
This comment has been minimized.
This comment has been minimized.
|
cc @pnkfelix @michaelwoerister, this the main "name resolution/macro expansion" issue in rust-analyzer. The code which handles this currently is #724 (in-progress PR which adds macro-expansion, outside of the resolution atm) |
DJMcNab
referenced this issue
Feb 11, 2019
Closed
Implement intial version of name resolution for items #231
matklad
self-assigned this
Mar 13, 2019
This comment has been minimized.
This comment has been minimized.
|
fixed |
matklad
closed this
Mar 21, 2019
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
matklad commentedFeb 1, 2019
Currently, building the tree of modules and resolving use items are separate phases. This is because we don't handle macros yet :-)
WIth macros, a module can be defined by a macro invocation, which is imported by a use path. To handle this, we should merge two things into one.
Specifically, we should create a new struct and query,
CrateSymbols, which contains a module tree, a mapping from module to declared/imported symbols and a mapping from macro invocations to the expansion results.The
LowerModulestep should work on the raw syntax and should be oblivious of the particular module. Specifically, it shouldn't do macro expansion, while it does it today.A possible further extension here is to split import into two categories: imports that can affect macro resolution, and other imports. Ideally, we should lazily resolve the second category.