aboutsummaryrefslogtreecommitdiff
path: root/crates/hir_def/src/nameres
Commit message (Collapse)AuthorAgeFilesLines
* Track in-scope derive helpers during nameresJonas Schievink2021-05-191-8/+26
|
* Fix unresolved attribute fallback againJonas Schievink2021-05-192-4/+33
|
*-. Merge #8885 #8887bors[bot]2021-05-192-14/+35
|\ \ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 8885: internal: greatly simplify eager macro representation r=jonas-schievink a=jonas-schievink - Share structures with lazy macros, make both use `MacroCallLoc`. - Remove `intern_eager_expansion`, `EagerCallLoc`, `EagerMacroId`, and *many* matches on `MacroCallId`. - Make a lot of FIXMEs obsolete since the code no longer distinguishes between eager and lazy macros. - Add `EagerCallInfo`, which is `Some` for calls to eager macros and holds the argument or expansion result and the included file. 8887: fix: fix derive collection after unresolved attribute fallback r=jonas-schievink a=jonas-schievink Fixes https://github.com/rust-analyzer/rust-analyzer/pull/8882#issuecomment-844379170 bors r+ Co-authored-by: Jonas Schievink <[email protected]>
| | * Fix derive collection after unresolved attribute fallbackJonas Schievink2021-05-192-2/+26
| |/ |/|
| * Simplify eager macro representationJonas Schievink2021-05-191-12/+9
|/
* Merge #8882bors[bot]2021-05-191-27/+153
|\ | | | | | | | | | | | | | | | | | | | | | | 8882: internal: resolve attributes in name resolution (minimal version) r=jonas-schievink a=jonas-schievink Closes https://github.com/rust-analyzer/rust-analyzer/pull/7049 This should not have any observable effect, since we don't attempt to expand attribute macros yet, and I have implemented a fallback that treats items with unresolved attributes as if the attribute wasn't there. Derive helpers are not yet resolved. `#![register_{attr,tool}]` are not yet supported. Co-authored-by: Jonas Schievink <[email protected]>
| * Rewrite `resolve_imports` to use an iteratorJonas Schievink2021-05-191-19/+23
| | | | | | | | This allows reusing the original vector's allocation
| * Restructure nameres loop to be a bit clearerJonas Schievink2021-05-191-38/+41
| |
| * internal: resolve attributes in name resolutionJonas Schievink2021-05-191-2/+121
| |
* | Merge #8871bors[bot]2021-05-181-23/+13
|\ \ | | | | | | | | | | | | | | | | | | | | | 8871: internal: Simplify `DefCollector::resolve_macros` r=jonas-schievink a=jonas-schievink bors r+ Co-authored-by: Jonas Schievink <[email protected]>
| * | Simplify `DefCollector::resolve_macros`Jonas Schievink2021-05-181-23/+13
| |/
* | Added cov markivan7702021-05-172-1/+3
| |
* | Fix #8834ivan7702021-05-162-0/+19
|/
* Move `AttrId` back into `hir_def`Jonas Schievink2021-05-101-2/+2
|
* Test that none of the macros are reparsedJonas Schievink2021-05-091-0/+6
|
* Precompute macro fragment kindJonas Schievink2021-05-091-6/+14
|
* Update crates/hir_def/src/nameres/tests/incremental.rsAleksey Kladov2021-05-061-1/+1
| | | Co-authored-by: Jonas Schievink <[email protected]>
* internal: add failing incremental testAleksey Kladov2021-05-061-0/+52
|
* Merge #8542bors[bot]2021-04-162-6/+7
|\ | | | | | | | | | | | | | | 8542: Include path in `unresolved-macro-call` diagnostic r=matklad a=jonas-schievink Co-authored-by: Jonas Schievink <[email protected]>
| * Include path in `unresolved-macro-call` diagnosticJonas Schievink2021-04-162-6/+7
| |
* | Fix primitive shadowing with inner itemsJonas Schievink2021-04-161-1/+7
|/
* Resolve prelude and crate root names in the root DefMapJonas Schievink2021-04-092-7/+34
|
*-. Merge #8443 #8446bors[bot]2021-04-092-16/+15
|\ \ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 8443: Rewrite `#[derive]` removal code to be based on AST r=jonas-schievink a=jonas-schievink We now remove any `#[derive]` before and including the one we want to expand, in the `macro_arg` query. The same infra will be needed by attribute macros (except we only remove the attribute we're expanding, not any preceding ones). Part of https://github.com/rust-analyzer/rust-analyzer/issues/8434 (doesn't implement the cfg-expansion yet, because that's more difficult) 8446: Undo path resolution hack for extern prelude r=jonas-schievink a=jonas-schievink Reverts the change made in https://github.com/rust-analyzer/rust-analyzer/pull/7959 We don't populate the extern prelude for block DefMaps anymore, so this is unnecessary bors r+ Co-authored-by: Jonas Schievink <[email protected]>
| | * Undo path resolution hack for extern preludeJonas Schievink2021-04-091-9/+4
| |/ |/| | | | | | | We don't populate the extern prelude for block DefMaps anymore, so this is unnecessary
| * Store `#[derive]` attribute ID along macro invocJonas Schievink2021-04-091-7/+11
|/
* Use named fields in `MacroCallKind`Jonas Schievink2021-04-081-1/+1
|
* Track recursion limit when expanding custom deriveJonas Schievink2021-04-081-1/+1
|
* Update `OUT_DIR` diagnostic to match settingJonas Schievink2021-04-071-1/+1
|
* nameres: collect unnamed constsJonas Schievink2021-04-071-13/+21
|
* Merge #8352bors[bot]2021-04-051-9/+3
|\ | | | | | | | | | | | | | | 8352: Remove dead legacy macro expansion code r=lnicola a=brandondong I was investigating some unrelated macro issue when I noticed this dead code. This legacy macro expansion logic was changed in https://github.com/rust-analyzer/rust-analyzer/pull/8128. Co-authored-by: Brandon <[email protected]>
| * Remove dead legacy macro expansion codeBrandon2021-04-051-9/+3
| |
* | 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
|