Matthias Krüger
56e4ea59d9
more clippy fixes:
...
clippy::match_like_matches_macro
clippy::to_string_in_format_args
clippy::single_char_add_str
clippy::filter_map_identity
clippy::clone_on_copy
clippy::useless_format
clippy::unused_unit
2022-03-12 16:50:49 +01:00
Matthias Krüger
62ed658311
fix clippy::useless_conversion
2022-03-12 16:50:49 +01:00
Lukas Wirth
a9dd606387
fix: Show what file paths were expected for unresolved modules
2022-03-11 17:08:30 +01:00
Lukas Wirth
3edc5dcea8
fix: Properly handle proc-macro crate types for nameres
2022-03-09 14:33:39 +01:00
Lukas Wirth
2537ad0d9e
Simplify
2022-03-09 11:26:06 +01:00
Lukas Wirth
4e94fb7028
Fix ProcMacroData recording wrong name for derives
2022-03-09 01:13:38 +01:00
Lukas Wirth
55ec93a337
Remove unnecessary macro_declarations from ItemScope
2022-03-09 00:19:53 +01:00
Lukas Wirth
dbada38b61
Only store derive<->derive-helper mapping in DefMap
2022-03-09 00:01:19 +01:00
Lukas Wirth
42d46325a1
Add MacroId to hir_def in attempt to unify Macros with ModuleDefId
2022-03-08 21:50:00 +01:00
Lukas Wirth
ffeec9dec9
Simplify
2022-02-23 15:55:06 +01:00
Lukas Wirth
d3d054f574
Reduce visibility of proc-macros to pub(crate)
2022-02-23 12:00:04 +01:00
Lukas Wirth
8db88df758
simplify and document
2022-02-22 10:45:29 +01:00
Lukas Wirth
7b89d5ede2
internal: Expand the derive attribute into a pseudo expansion
2022-02-22 10:20:40 +01:00
Lukas Wirth
035bedc28b
internal: Remove name fields from MacroCallKind
2022-02-21 00:02:10 +01:00
Maybe Waffle
6d18c5b69d
feat: Honor recursion limit configuration
...
This patch makes RA understand `#![recursion_limit = "N"]` annotations.
- `crate_limits` query is moved to `DefDatabase`
- `DefMap` now has `recursion_limit: Option<u32>` field
2022-01-28 11:31:59 +03:00
Lukas Wirth
ca4baa6e55
Use FileAstId<ast::Adt>
in nameres where appropriate instead
2022-01-07 14:20:27 +01:00
Jonas Schievink
3ff68f25b8
Expand attribute macros on impl and trait items
2022-01-06 12:30:16 +01:00
Jonas Schievink
3eddda6f4c
simplify
2022-01-05 17:26:34 +01:00
Lukas Wirth
6b7b09d329
internal: Record unresolved derive invocations in hir
2022-01-02 23:44:23 +01:00
Lukas Wirth
44d61766b5
internal: Record unresolved derive invocations in hir
2022-01-01 20:43:25 +01:00
Jonas Schievink
b365b6119c
Treat extern blocks as item containers
2021-12-07 17:31:26 +01:00
Lukas Wirth
e58af219a4
feat: Resolve builtin-attr and tools in ide layer
2021-12-03 16:32:17 +01:00
Jake Heinz
6cf9969546
collect macro_rules! macros into macro declarations
2021-11-29 05:28:22 +00:00
Jake Heinz
1ed5699355
collect macros
2021-11-29 05:22:30 +00:00
Jonas Schievink
c291e5e284
Use the right ItemTree
when re-resolving attr
2021-11-26 03:57:25 +01:00
Jonas Schievink
3bb6f506ee
Build per-block ItemTree
s
2021-11-26 00:17:20 +01:00
Lukas Wirth
ea03defeac
fix: Diagnose invalid derive attribute input
2021-11-19 13:17:35 +01:00
Lukas Wirth
6757910934
fix: Diagnose using derive
on non-adt items
2021-11-19 12:10:55 +01:00
Lukas Wirth
966cae384f
minor: Simplify
2021-11-18 21:43:54 +01:00
Lukas Wirth
f72512f1c6
Simplify
2021-11-17 21:02:33 +01:00
Lukas Wirth
91bbc55eed
Check for derive attributes by item path, not derive
identifier
2021-11-17 20:46:57 +01:00
bors[bot]
32f425d801
Merge #10787
...
10787: minor: Simplify r=Veykril a=Veykril
bors r+
Co-authored-by: Lukas Wirth <lukastw97@gmail.com>
2021-11-17 14:55:18 +00:00
Lukas Wirth
6e1ecaef4f
Simplify
2021-11-17 15:54:38 +01:00
Lukas Wirth
b57289c4cb
Skip test/bench attr expansion in resolution instead of collection
2021-11-16 20:23:56 +01:00
Lukas Wirth
5c0b895f69
Rename intern_macro -> intern_macro_call
2021-11-14 16:25:47 +01:00
Lukas Wirth
439a8194b0
Replace more Name::to_string usages with Name::to_smol_str
2021-11-04 18:12:05 +01:00
Lukas Wirth
7fdbdc4ab2
Enable auto-import and qualify-path in derive attributes
2021-10-28 18:40:38 +02:00
Laurențiu Nicola
ca44b6892e
Use array IntoIter
2021-10-22 09:23:29 +03:00
Lukas Wirth
ea2a2c52fc
Don't resolve attributes to non attribute macros
2021-10-21 12:22:40 +02:00
Aleksey Kladov
55d8be5a24
internal: consistent module naming
2021-10-10 15:44:03 +03:00
Jonas Schievink
033f87c2f0
Add some profiling calls to name resolution
2021-10-01 15:30:00 +02:00
Jonas Schievink
0b76b29512
support non-extern-prelude dependencies
2021-09-28 21:23:46 +02:00
Jonas Schievink
7860d6ade6
Fix item-level lazy macro errors
2021-09-24 21:17:25 +02:00
Jonas Schievink
9a320bcf38
Support the new rustc_builtin_macro
syntax
2021-09-09 21:32:41 +02:00
Aleksey Kladov
dbb702cfc1
internal: remove accidental code re-use
...
FragmentKind played two roles:
* entry point to the parser
* syntactic category of a macro call
These are different use-cases, and warrant different types. For example,
macro can't expand to visibility, but we have such fragment today.
This PR introduces `ExpandsTo` enum to separate this two use-cases.
I suspect we might further split `FragmentKind` into `$x:specifier` enum
specific to MBE, and a general parser entry point, but that's for
another PR!
2021-09-05 22:36:36 +03:00
Lukas Wirth
36a5ce9790
minor: fix some clippy lints
2021-09-03 16:00:50 +02:00
Dezhi Wu
ba0947dded
switch log
crate to tracing
2021-08-30 15:11:42 +08:00
bors[bot]
99e67f8998
Merge #10044
...
10044: minor: Ignore text and bench attributes again r=Veykril a=Veykril
Reverts part of #9943
Co-authored-by: Lukas Wirth <lukastw97@gmail.com>
2021-08-27 20:19:56 +00:00
Lukas Wirth
798c53925a
Ignore text and bench attributes again
2021-08-27 22:19:04 +02:00
bors[bot]
97409e5fc8
Merge #9970
...
9970: feat: Implement attribute input token mapping, fix attribute item token mapping r=Veykril a=Veykril
![image](https://user-images.githubusercontent.com/3757771/130328577-4c1ad72c-51b1-47c3-8d3d-3242ec44a355.png )
The token mapping for items with attributes got overwritten partially by the attributes non-item input, since attributes have two different inputs, the item and the direct input both.
This PR gives attributes a second TokenMap for its direct input. We now shift all normal input IDs by the item input maximum(we maybe wanna swap this see below) similar to what we do for macro-rules/def. For mapping down we then have to figure out whether we are inside the direct attribute input or its item input to pick the appropriate mapping which can be done with some token range comparisons.
Fixes https://github.com/rust-analyzer/rust-analyzer/issues/9867
Co-authored-by: Lukas Wirth <lukastw97@gmail.com>
2021-08-27 19:30:36 +00:00