aboutsummaryrefslogtreecommitdiff
path: root/crates/hir_def/src/nameres
Commit message (Collapse)AuthorAgeFilesLines
* Use shrink_to_fit to reduce DefMap sizesJonas Schievink2021-04-031-1/+3
|
* Intern `ModPath` in `Import`Jonas Schievink2021-04-031-2/+6
| | | | Minor savings only
* Allow include! an empty content fileEdwin Cheng2021-04-031-0/+20
|
* Support `#[rustc_builtin_macro = "builtin_name"]`Jonas Schievink2021-04-031-1/+11
|
* Only populate prelude for crate-level DefMapsJonas Schievink2021-04-021-14/+16
|
* Intern Attr, MacroCall and Path componentsJonas Schievink2021-04-011-1/+1
|
* Remove unused test fixturesEdwin Cheng2021-03-281-4/+0
|
* Basic Support Macro 2.0Edwin Cheng2021-03-272-39/+85
|
* Merge bang-macros and derives in name resolutionJonas Schievink2021-03-231-86/+79
|
* resolver: manually traverse nested block scopesJonas Schievink2021-03-221-1/+1
|
* Merge #8134bors[bot]2021-03-211-4/+9
|\ | | | | | | | | | | | | | | 8134: Correct the paths of submodules from the include! macro r=edwin0cheng a=sticnarf This PR should fix #7846. It mostly follows the instructions from @edwin0cheng in that issue. Co-authored-by: Yilin Chen <[email protected]>
| * check is_include_macro only when attr_path is not specifiedYilin Chen2021-03-211-4/+3
| | | | | | | | Signed-off-by: Yilin Chen <[email protected]>
| * use the included file as the source of expanded include macroYilin Chen2021-03-211-2/+8
| | | | | | | | Signed-off-by: Yilin Chen <[email protected]>
* | Expand legacy-scoped macro during collectionJonas Schievink2021-03-212-6/+28
|/
* Fix handling of `#![cfg]` in outline module fileJonas Schievink2021-03-192-21/+48
|
* Rename derive-specific APIsJonas Schievink2021-03-191-4/+4
|
* Add testJonas Schievink2021-03-181-0/+26
|
* Record custom derive helpers in `DefMap`Jonas Schievink2021-03-182-24/+80
| | | | Also clean up proc macro attribute parsing a bit
* Store an `AstId` for procedural macrosJonas Schievink2021-03-181-6/+7
|
* Make MacroDefId's `AstId` mandatory when possibleJonas Schievink2021-03-181-4/+1
|
* Rename `item_tree` query to `file_item_tree`Jonas Schievink2021-03-181-4/+4
|
* Make `ItemTreeId` its own typeJonas Schievink2021-03-181-6/+6
|
* Merge #8075bors[bot]2021-03-172-16/+37
|\ | | | | | | | | | | | | | | | | | | 8075: Fix `use crate as <name>;` imports r=jonas-schievink a=jonas-schievink Fixes https://github.com/rust-analyzer/rust-analyzer/issues/4644 bors r+ Co-authored-by: Jonas Schievink <[email protected]>
| * Fix `use crate as <name>;` importsJonas Schievink2021-03-172-16/+37
| |
* | Improve diagnostic when including nonexistent fileJonas Schievink2021-03-171-1/+1
|/
* Use first early expansion error during nameresJonas Schievink2021-03-172-1/+20
|
* Merge #7970bors[bot]2021-03-152-10/+68
|\ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 7970: Fix incorrect diagnostics for failing built in macros r=jonas-schievink a=brandondong **Reproduction:** 1. Use a built in macro in such a way that rust-analyzer fails to expand it. For example: **lib.rs** ``` include!("<valid file but without a .rs extension so it is not indexed by rust-analyzer>"); ``` 2. rust-analyzer highlights the macro call and says the macro itself cannot be resolved even though include! is in the standard library (unresolved-macro-call diagnostic). 3. No macro-error diagnostic is raised. **Root cause for incorrect unresolved-macro-call diagnostic:** 1. collector:collect_macro_call is able to resolve include! in legacy scope but the expansion fails. Therefore, it's pushed into unexpanded_macros to be retried with module scope. 2. include! fails at the resolution step in collector:resolve_macros now that it's using module scope. Therefore, it's retained in unexpanded_macros. 3. Finally, collector:finish tries resolving the remaining unexpanded macros but only with module scope. include! again fails at the resolution step so a diagnostic is created. **Root cause for missing macro-error diagnostic:** 1. In collector:resolve_macros, directive.legacy is None since eager expansion failed in collector:collect_macro_call. The macro_call_as_call_id fails to resolve since we're retrying in module scope. Therefore, collect_macro_expansion is not called for the macro and no macro-error diagnostic is generated. **Fix:** - In collector:collect_macro_call, do not add failing built-in macros to the unexpanded_macros list and immediately raise the macro-error diagnostic. This is in contrast to lazy macros which are resolved in collector::resolve_macros and later expanded in collect_macro_expansion where a macro-error diagnostic may be raised. Co-authored-by: Brandon <[email protected]> Co-authored-by: brandondong <[email protected]>
| * Update crates/hir_def/src/nameres/collector.rsbrandondong2021-03-151-1/+1
| | | | | | Co-authored-by: Jonas Schievink <[email protected]>
| * Fix incorrect diagnositics for failing built in eager macrosBrandon2021-03-142-10/+68
| |
* | Extend cfg_attr testJonas Schievink2021-03-131-0/+3
|/
* Prefer names from outer DefMap over extern preludeJonas Schievink2021-03-101-5/+11
|
* Delete `ContainerId`Jonas Schievink2021-03-091-12/+11
|
* Stop using `ContainerId` in `AssocContainerId`Jonas Schievink2021-03-091-3/+3
|
* Use upstream cov-markLaurențiu Nicola2021-03-088-36/+31
|
* For unresolved macros, hightlight only the last segmentAleksey Kladov2021-02-281-33/+48
|
* Restrict visibilities to the containing DefMapJonas Schievink2021-02-281-4/+17
|
* is_visible_from_def_map: handle block expressionsJonas Schievink2021-02-231-2/+2
|
* Fix resolution of `self` module within blocksJonas Schievink2021-02-051-1/+9
|
* Fix merging of `segment_index` in path resolutionJonas Schievink2021-02-051-2/+5
|
* Make `ModPath`'s representation privateJonas Schievink2021-02-042-12/+12
|
* Don't keep the parent DefMap alive via ArcJonas Schievink2021-02-043-13/+23
| | | | | This seems like it could easily leak a lot of memory since we don't currently run GC
* Use body lowering for block_def_map testsJonas Schievink2021-02-032-252/+2
| | | | Removes the hacky and buggy custom lowering code
* Fix resolution of `crate` paths from within blocksJonas Schievink2021-02-021-2/+2
| | | | | They resolve to the crate root, not the DefMap's root module (which can be a block)
* Use the right `DefMap` when looking up modulesJonas Schievink2021-02-022-2/+16
|
* Revert "Use block_def_map in body lowering"Jonas Schievink2021-02-022-2/+252
|
* Use body lowering for block_def_map testsJonas Schievink2021-02-012-252/+2
| | | | Removes the hacky and buggy custom lowering code
* Honor #![macro_use] in mod source filesLukas Wirth2021-01-312-8/+23
|
* Fix incorrect `FileId` and remove broken shortcutJonas Schievink2021-01-281-7/+6
| | | | | Apparently we were using the crate's root file instead of the file containing the block.
* block_def_map: add a few macro testsJonas Schievink2021-01-281-0/+63
|
* Update `original_module` when ascending `DefMap`sJonas Schievink2021-01-281-2/+5
|