Lukas Wirth
5374ebbf36
Simplify
2024-06-30 14:00:55 +02:00
Lukas Wirth
bfb187aacd
Fix expression scope calculation when within macro expansions
2024-06-30 13:26:17 +02:00
Lukas Wirth
8df034d453
Shrink mbe's Op
2024-06-24 10:07:32 +02:00
Lukas Wirth
3168ab5b99
Enum variants are not generic def ids
2024-06-24 10:07:31 +02:00
bors
db69df3216
Auto merge of #17478 - kilpkonn:master, r=Veykril
...
Simplify some term search tactics
Working on the paper `@phijor` found that "Data constructor" tactic could be simplified quite a bit by running it only in the backwards direction. With n+1 rounds it has same coverage as previous implementation in n rounds, however the tactic it self is more simple and also potentially faster as there is less to do.
In a nutshell the idea is to only work with types in the wish-list rather than with any types.
Turns out it is quite a bit faster:
Before:
```
ripgrep:
Tail Expr syntactic hits: 238/1692 (14%)
Tail Exprs found: 1223/1692 (72%)
Term search avg time: 15ms
nalgebra:
Tail Expr syntactic hits: 125/3001 (4%)
Tail Exprs found: 2143/3001 (71%)
Term search avg time: 849ms
```
After
````
ripgrep:
Tail Expr syntactic hits: 246/1692 (14%)
Tail Exprs found: 1209/1692 (71%)
Term search avg time: 8ms
nalgebra:
Tail Expr syntactic hits: 125/3001 (4%)
Tail Exprs found: 2028/3001 (67%)
Term search avg time: 305ms
````
_Also removed niche optimization of removing scope defs from the search space as this wasn't helping much anyway and made code a bit more complex._
2024-06-24 07:20:50 +00:00
Tavo Annus
51c3bd215a
Fix suggestions of unstable constants
2024-06-22 21:33:58 +03:00
Tavo Annus
3825d8bd0f
Increase search depth to account for more granual steps
2024-06-22 15:06:07 +03:00
Tavo Annus
b4f3eb48db
Simplify impl_method
tactic
2024-06-22 14:22:56 +03:00
Tavo Annus
23d3ac70e9
Simplify impl_static_method
tactic
2024-06-22 14:14:42 +03:00
Tavo Annus
a3315fe028
Remove remove not-very-helpful optimizations
2024-06-22 10:17:33 +03:00
Tavo Annus
957325a5fe
Run data_constructor
tactic only backwards
2024-06-21 22:01:06 +03:00
roife
d5bb2f0cba
fix: use ItemInNs::Macros to convert ModuleItem to ItemInNs
2024-06-21 21:05:14 +08:00
bors
e08f7953f4
Auto merge of #17462 - Veykril:sema-attr-macro-res, r=Veykril
...
fix: Fix IDE features breaking in some attr macros
Fixes https://github.com/rust-lang/rust-analyzer/issues/17453 , Fixes https://github.com/rust-lang/rust-analyzer/issues/17458
2024-06-20 09:11:44 +00:00
Lukas Wirth
ee8a3458ee
fix: Fix IDE features breaking in some attr macros
2024-06-20 11:00:19 +02:00
bors
6738f81b12
Auto merge of #17419 - ishanjain28:filter_builtin_macro_expansion, r=Veykril
...
Filter builtin macro expansion
This PR adds a filter on the types of built in macros that are allowed to be expanded.
Currently, This list of allowed macros contains, `stringify, cfg, core_panic, std_panic, concat, concat_bytes, include, include_str, include_bytes, env` and `option_env`.
Fixes #14177
2024-06-20 08:39:17 +00:00
Lukas Wirth
bf9a7264d1
Invert matching on builtin macros in expand_allowed_builtins
2024-06-20 10:31:20 +02:00
Ishan Jain
19d9bb808d
removed format_args from allowed expansions
2024-06-19 16:58:48 +05:30
Tavo Annus
c87609fef1
Add tactic for associated item constants
2024-06-18 22:08:44 +03:00
Ishan Jain
020537cd06
Created expand_allowed_builtins, updated expand_macro to call this function
2024-06-15 15:20:46 +05:30
Ishan Jain
2df806a3a5
allow format_args! expansion
2024-06-14 10:13:41 +05:30
Ishan Jain
0adb0e114f
fixed tests
2024-06-14 09:52:46 +05:30
Wilfred Hughes
d68e549205
internal: Fix rustdoc warnings
...
`cargo doc` generates a bunch of warnings on rust-analyzer. Fix all the
bare URL and empty code block warnings.
2024-06-13 17:29:10 -07:00
Ishan Jain
5d5f68af3f
hir/semantics: Only allow expansion of specific built in macros
2024-06-13 10:45:11 +05:30
bors
22648b2655
Auto merge of #17405 - Veykril:modpath-clone, r=Veykril
...
internal: Don't unnecessarily clone ModPaths in early name res
2024-06-12 09:27:49 +00:00
Lukas Wirth
855282fa53
internal: Don't unnecessarily clone ModPaths in early name res
2024-06-12 11:25:19 +02:00
roife
224d0dd36e
refactor: move the logic that displays container type bounds to function fmt
2024-06-11 21:02:13 +08:00
roife
ab7c7d4501
fix: skip container header if no generics params
2024-06-11 21:02:13 +08:00
roife
9f70f87d35
internal: simplify and rename display_xxx to write_xxx for consistency
2024-06-11 21:02:13 +08:00
roife
78118f98f6
feat: add hover config for showing container bounds
2024-06-11 21:02:13 +08:00
roife
184ddc6f5b
feat: show type bounds from containers for functions
2024-06-11 21:02:13 +08:00
roife
af1291bbf3
internal: simplify and refactor write_where_clause
2024-06-11 21:02:13 +08:00
Lukas Wirth
30c04d5aa9
Remove extra parse cache from Semantics again
2024-06-10 12:04:35 +02:00
Lukas Wirth
8520a0c585
Thread more HasSource::source calls through Semantics for caching
2024-06-10 10:33:07 +02:00
Lukas Wirth
d4dc3ca83b
Register virtual workspace Cargo.toml files in the VFS
2024-06-09 12:54:50 +02:00
Wilfred Hughes
27182bb96b
chore: Prefer tracing span shorthand macros
2024-06-06 16:52:25 -07:00
Vincent Esche
78f31696da
Resolve #17344 by using .get(…)
instead of […]
in TypeOrConstParam::source(…)
...
(… and `LifetimeParam::source(…)`)
2024-06-05 11:03:56 +02:00
Lukas Wirth
9349045e09
Use dyn cache for Semantics macro resolution
2024-06-04 16:25:38 +02:00
Lukas Wirth
7d40763c88
Cache parse trees in Semantics
2024-06-04 15:29:24 +02:00
Lukas Wirth
c12f093716
Cache file_to_def
in SourceToDefCtx
2024-06-04 15:23:02 +02:00
Lukas Wirth
97b58f2846
Try caching macro calls more aggressively
2024-06-04 15:23:00 +02:00
Lukas Wirth
6f0207d594
Cleanup some inert attribute stuff
2024-06-04 12:38:20 +02:00
Lukas Wirth
60fa981df1
Simplify
2024-06-03 19:06:58 +02:00
bors
cb6b808185
Auto merge of #17315 - hamirmahal:style/simplify-string-interpolation, r=Veykril
...
style: simplify string interpolation
2024-06-03 12:29:27 +00:00
bors
9edc30a42b
Auto merge of #17312 - regexident:function-fn-ptr-type, r=Veykril
...
Add `Function::fn_ptr_type(…)` for obtaining name-erased function type
The use case of this function if being able to group functions by their function ptr type.
cc `@flodiebold`
2024-06-03 12:16:29 +00:00
Lukas Wirth
3116f76fba
feat: Enable completions within derive helper attributes
2024-06-02 09:45:57 +02:00
Lukas Wirth
c0171bdd32
fix: Fix container search failing for tokens originating within derive attributes
2024-06-01 20:57:29 +02:00
Hamir Mahal
7c34eb3880
style: simplify string interpolation
2024-05-30 16:18:49 -07:00
Vincent Esche
7b75f1113c
Add Function::fn_ptr_type(…)
for obtaining name-erased function type
2024-05-29 19:41:55 +02:00
Tavo Annus
0f6842700f
Fix data_constructor
ignoring generics for struct
2024-05-25 13:09:26 +03:00
David Barsky
a0d3a81a19
fix: ensure implied bounds from associated types are considered in autocomplete
2024-05-22 16:16:20 -04:00