Chayim Refael Friedman
d9f0731bd2
Parse destructuring assignment
...
The only patterns we should parse are `..` in structs and `_`: the rest are either not supported or already valid expressions.
2022-03-02 01:51:25 +00: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
1bbef5af85
Fix syntax highlighting not highlighting derives anymore
2022-02-22 10:20:44 +01:00
Lukas Wirth
7b89d5ede2
internal: Expand the derive attribute into a pseudo expansion
2022-02-22 10:20:40 +01:00
Lukas Wirth
1505b6a9b4
internal: Split unresolve proc-macro error out of mbe
2022-02-22 10:08:00 +01:00
bors[bot]
979b5b32bc
Merge #11455
...
11455: Handle proc-macro functions as the proc-macro they resolve to r=Veykril a=Veykril
Fixes https://github.com/rust-analyzer/rust-analyzer/issues/11212
Co-authored-by: Lukas Wirth <lukastw97@gmail.com>
2022-02-21 16:56:37 +00:00
bors[bot]
24255e5b3d
Merge #11481
...
11481: Display parameter names when hovering over a function pointer r=Veykril a=Vannevelj
Implements #11474
The idea is pretty straightforward: previously we constructed the hover based on just the parameter types, now we pass in the parameter names as well. I went for a quick-hit approach here but I expect someone will be able to point me to a better way of resolving the identifier.
I haven't figured out yet how to actually run my rust-analyzer locally so I can see it in action but the unit test indicates it should work.
Co-authored-by: Jeroen Vannevel <jer_vannevel@outlook.com>
2022-02-21 13:08:31 +00:00
Chayim Refael Friedman
a1b7169b48
Update tests
...
Unfortunately, we lost some recovery for expressions.
2022-02-21 08:34:35 +02:00
Chayim Refael Friedman
6bf6f4ff1d
Lower let
expressions
2022-02-21 08:34:34 +02:00
Lukas Wirth
035bedc28b
internal: Remove name fields from MacroCallKind
2022-02-21 00:02:10 +01:00
Lukas Wirth
fbe787ee10
internal: Wrap MacroCallKind::Attr attr_args field in an Arc
2022-02-20 22:53:04 +01:00
Jeroen Vannevel
794105c18b
removed double map
2022-02-15 19:37:24 +00:00
Jeroen Vannevel
c8cd7a68b3
use Name instead of String
2022-02-15 19:12:23 +00:00
Jeroen Vannevel
0a80cc82b1
cleaning
2022-02-15 14:55:21 +00:00
Jeroen Vannevel
3bba811e92
fmt
2022-02-15 14:47:51 +00:00
Jeroen Vannevel
c450d0ce41
cleanup
2022-02-15 14:47:23 +00:00
Jeroen Vannevel
73e49493bd
rough, but appears to work
2022-02-15 14:39:22 +00:00
bors[bot]
7a17fb9c43
Merge #11444
...
11444: feat: Fix up syntax errors in attribute macro inputs to make completion work more often r=flodiebold a=flodiebold
This implements the "fix up syntax nodes" workaround mentioned in #11014 . It isn't much more than a proof of concept; I have only implemented a few cases, but it already helps quite a bit.
Some notes:
- I'm not super happy about how much the fixup procedure needs to interact with the syntax node -> token tree conversion code (e.g. needing to share the token map). This could maybe be simplified with some refactoring of that code.
- It would maybe be nice to have the fixup procedure reuse or share information with the parser, though I'm not really sure how much that would actually help.
Co-authored-by: Florian Diebold <flodiebold@gmail.com>
2022-02-12 12:48:46 +00:00
Lukas Wirth
cef8a17ea5
Handle proc-macro functions as the proc-macro they resolve to
2022-02-11 22:06:03 +01:00
Florian Diebold
ecf3cff4a6
Replace expressions with errors in them
2022-02-09 11:58:52 +01:00
Laurențiu Nicola
c8f056a6db
Revert "Revert "Bump dashmap""
...
This reverts commit 39674cd350
.
2022-02-09 09:19:57 +02:00
Florian Diebold
c3601e9860
Reverse fixups
2022-02-07 19:53:39 +01:00
Florian Diebold
79ebf618ec
Simplify
2022-02-07 18:21:31 +01:00
Florian Diebold
cff209f152
WIP: Actually fix up syntax errors in attribute macro input
2022-02-07 18:12:51 +01:00
Florian Diebold
212e82fd41
Add test for giving attribute proc macros valid syntax
2022-02-07 12:54:08 +01:00
Laurențiu Nicola
39674cd350
Revert "Bump dashmap"
...
This reverts commit 485f318b70
.
2022-02-05 16:15:56 +02:00
Lukas Wirth
6940cca760
Move attribute path completions into attribute completion module
2022-02-03 15:50:14 +01:00
Lukas Wirth
ddf7b70a0f
Fix cfg_attr invalidating derive identifier IDE functionality
2022-01-30 22:47:16 +01:00
Lukas Wirth
cc04cfc982
Reduce allocations in attribute collection
2022-01-30 22:18:32 +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
Maybe Waffle
81211f538c
Use crate_limits
query in macro expansion
2022-01-28 11:31:59 +03:00
Jonas Schievink
6c0fcb5b5d
More correct $crate
handling in eager macros
2022-01-27 16:57:53 +01:00
Jonas Schievink
35e5c3b3f9
Fix resolution of eager macro contents
2022-01-26 18:31:07 +01:00
Jonas Schievink
5088926ec3
Make syntax bridge fully infallible
2022-01-24 17:27:39 +01:00
Lukas Wirth
ebd723995a
fix: don't panic in semantics due to cfg_attr
disrupting offsets
2022-01-23 17:42:38 +01:00
Laurențiu Nicola
485f318b70
Bump dashmap
2022-01-21 19:42:04 +02:00
Jonas Schievink
e52e1aaca1
Clean up assoc item collection a bit
2022-01-14 18:45:23 +01:00
Jonas Schievink
72fd08d8d2
Remove redundant recursion limit
2022-01-14 17:45:57 +01:00
Jonas Schievink
7e8b96f07c
Fix concatenation of super
mod paths
2022-01-11 15:39:13 +01:00
Jonas Schievink
0706de94bb
Report DefDiagnostic
s from inside item bodies
2022-01-11 14:34:25 +01:00
bors[bot]
5a711d4f3a
Merge #11210
...
11210: feat: Deprioritize ops methods in completion r=Veykril a=Veykril
Fixes https://github.com/rust-analyzer/rust-analyzer/issues/10593
Co-authored-by: Lukas Wirth <lukastw97@gmail.com>
2022-01-11 09:39:12 +00:00
Lukas Wirth
4901ea3eef
Lookup lang attribute on assoc item trait directly
2022-01-11 10:28:38 +01:00
Lukas Wirth
ca0633c808
feat: Deprioritize ops methods in completion
2022-01-11 09:26:53 +01:00
Lukas Wirth
b32f611b6e
fix: Fix outline modules spilling inner doc injections into their parent
2022-01-08 14:54:31 +01:00
Lukas Wirth
47591f0fb2
Remove InFile
wrapping from DynMap keys
2022-01-08 12:16:44 +01:00
Lukas Wirth
b6826e9246
Only add generics with the correct file id to DynMap
2022-01-08 11:34:58 +01:00
Lukas Wirth
8d4f40e881
Do less allocs in trait_data
and impl_data
queries
2022-01-08 11:04:16 +01:00
Lukas Wirth
6746ba5839
Record attribute calls on assoc items in TraitData and ImplData
2022-01-08 10:45:12 +01:00