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
dc135cc076
internal: Support registered tools and attributes in ide layer
2022-01-06 14:56:50 +01:00
Jonas Schievink
3ff68f25b8
Expand attribute macros on impl and trait items
2022-01-06 12:30:16 +01:00
Jake Heinz
0447be7589
wip
2021-11-27 11:25:05 +00:00
Jonas Schievink
3bb6f506ee
Build per-block ItemTree
s
2021-11-26 00:17:20 +01:00
Lukas Wirth
ebd63ec1cf
feat: Make unqualified derive attributes flyimportable
2021-10-29 14:51:26 +02:00
toyboot4e
89e46b40c3
Minor: replace old name CrateDefMap
2021-09-05 19:22:34 +09:00
Aleksey Kladov
6f269708e8
internal: get rid of a call to slow O(N) visibility_of function
...
Instead of inferring module's declared visibility by looking at the
scope of its parent, let's just remeber the declared visibility in the
DefMap.
2021-07-12 21:13:43 +03:00
Aleksey Kladov
a9d0d1414a
internal: remove erroneous default impl
2021-07-12 20:18:07 +03:00
Aleksey Kladov
d40cf52e6d
internal: perpare to remove ModuleData::default
2021-07-12 20:02:56 +03:00
Aleksey Kladov
107e07458c
internal: remove erroneous Default impl for ModuleOrigin
...
In rust-analyzer, we avoid defualt impls for types which don't have
sensible, "empty" defaults. In particular, we avoid using invalid
indices for defaults and similar hacks.
2021-07-12 20:00:17 +03:00
Clemens Wasser
47747cd412
Apply some clippy suggestions
2021-06-21 16:40:21 +02:00
Aleksey Kladov
5c9f31d4c2
internal: move diagnostics to hir
...
The idea here is to eventually get rid of `dyn Diagnostic` and
`DiagnosticSink` infrastructure altogether, and just have a `enum
hir::Diagnostic` instead.
The problem with `dyn Diagnostic` is that it is defined in the lowest
level of the stack (hir_expand), but is used by the highest level (ide).
As a first step, we free hir_expand and hir_def from `dyn Diagnostic`
and kick the can up to `hir_ty`, as an intermediate state. The plan is
then to move DiagnosticSink similarly to the hir crate, and, as final
third step, remove its usage from the ide.
One currently unsolved problem is testing. You can notice that the test
which checks precise diagnostic ranges, unresolved_import_in_use_tree,
was moved to the ide layer. Logically, only IDE should have the infra to
render a specific range.
At the same time, the range is determined with the data produced in
hir_def and hir crates, so this layering is rather unfortunate. Working
on hir_def shouldn't require compiling `ide` for testing.
2021-05-25 17:49:59 +03:00
Jonas Schievink
9cf8d325a2
Precompute macro fragment kind
2021-05-09 01:36:06 +02:00
Jonas Schievink
976a3226fe
Don't store call-site text offsets in hygiene info
2021-05-06 19:59:54 +02:00
Jonas Schievink
7b7d051e81
Add failing local items test
2021-04-21 17:57:45 +02:00
Jonas Schievink
ff858376aa
Include path in unresolved-macro-call
diagnostic
2021-04-16 15:48:03 +02:00
Jonas Schievink
c0dd36fd42
Store #[derive]
attribute ID along macro invoc
2021-04-09 13:38:01 +02:00
Jonas Schievink
86b7861612
Use named fields in MacroCallKind
2021-04-08 20:43:07 +02:00
Jonas Schievink
f774a56af2
Use exhaustive matches in shrink_to_fit impls
2021-04-04 02:56:11 +02:00
Jonas Schievink
d1bce6070d
Use shrink_to_fit to reduce DefMap sizes
2021-04-03 23:45:27 +02:00
Jonas Schievink
2633e23f2b
resolver: manually traverse nested block scopes
2021-03-22 18:55:51 +01:00
Jonas Schievink
54c78c96db
Rename derive-specific APIs
2021-03-19 14:23:13 +01:00
Jonas Schievink
268f45a099
Record custom derive helpers in DefMap
...
Also clean up proc macro attribute parsing a bit
2021-03-18 19:56:37 +01:00
Jonas Schievink
5fbb97a0f0
Rename item_tree
query to file_item_tree
2021-03-18 01:53:37 +01:00
Jonas Schievink
0dcec31553
Fix find_path
when inner items are present
2021-03-01 19:39:17 +01:00
Aleksey Kladov
05729fd3c4
For unresolved macros, hightlight only the last segment
2021-02-28 14:29:10 +03:00
Jonas Schievink
338823f73a
is_visible_from_def_map: handle block expressions
2021-02-23 17:56:16 +01:00
Jonas Schievink
b9c213da7a
Make with_ancestor_maps
public
2021-02-09 17:23:25 +01:00
Jonas Schievink
26a2a2433c
Don't keep the parent DefMap alive via Arc
...
This seems like it could easily leak a lot of memory since we don't
currently run GC
2021-02-04 13:44:54 +01:00
Jonas Schievink
1a8ea81a79
Split out ItemScope::dump from DefMap::dump
2021-02-03 19:05:11 +01:00
Jonas Schievink
6458f9107c
Add newline between block and crate maps
2021-02-03 18:23:59 +01:00
Jonas Schievink
d4a22fc801
Update DefMap
and block_def_map
docs
2021-02-03 17:54:03 +01:00
Jonas Schievink
da57f5dc17
Shortcut block_def_map
if there's no inner items
...
This previously didn't work, but apparently only because of the wonky
test setup
2021-02-03 15:33:25 +01:00
Jonas Schievink
5914f86d47
Fix resolution of crate
paths from within blocks
...
They resolve to the crate root, not the DefMap's root module (which
can be a block)
2021-02-02 18:02:12 +01:00
Jonas Schievink
cd9659ffce
Use the right DefMap
when looking up modules
2021-02-02 12:36:38 +01:00
Jonas Schievink
7202ce6c96
Revert "Use block_def_map in body lowering"
2021-02-02 11:46:58 +01:00
Jonas Schievink
b4aa860cac
Shortcut block_def_map
if there's no inner items
...
This previously didn't work, but apparently only because of the wonky
test setup
2021-02-01 13:33:18 +01:00
Jonas Schievink
090b2f0e50
Fix incorrect FileId
and remove broken shortcut
...
Apparently we were using the crate's root file instead of the file
containing the block.
2021-01-28 19:33:00 +01:00
Jonas Schievink
ad254f4c97
Fix legacy macro resolution in block expressions
2021-01-27 19:16:39 +01:00
Jonas Schievink
98a88ebb9e
Intern block locations and handle them in ModuleId
2021-01-25 19:02:05 +01:00
Jonas Schievink
5c241b0766
Create all ModuleId
s through a DefMap
method
...
`ModuleId` needs to be able to represent blocks, and only the
associated `DefMap` will know how to construct that `ModuleId`
2021-01-25 15:21:33 +01:00
Aleksey Kladov
e5c5c0a040
Include countme
crate to count important data structures.
2021-01-21 19:30:52 +03:00
Jonas Schievink
896dfacfc4
Add name resolution query for block expressions
2021-01-21 15:22:17 +01:00
Jonas Schievink
82146737ac
Treat BlockExpr as a potential module origin
2021-01-20 20:05:48 +01:00
Jonas Schievink
5f319ca7ee
DefMap: hide remaining crate-visible fields
2021-01-20 18:17:48 +01:00
Jonas Schievink
0587b99fde
Make public DefMap fields private
2021-01-20 15:41:18 +01:00
Jonas Schievink
57a82fb05b
Rename CrateDefMap
to DefMap
2021-01-18 20:18:05 +01:00
Aleksey Kladov
4c4e54ac8a
prepare to publish el libro de arena
2021-01-14 19:06:02 +03:00
Lukas Wirth
816190c6f6
Remove some unneeded string allocations
2020-12-31 10:13:14 +01:00