about summary refs log tree commit diff
path: root/src/tools/rust-analyzer/crates/hir
AgeCommit message (Collapse)AuthorLines
2024-06-30Auto merge of #17516 - kilpkonn:master, r=kilpkonnbors-70/+8
Quality of life improvements to term search Basically two things: - Allow optionally disabling "borrow checking" restrictions on term search code assists. Sometimes it is better to get invalid suggestions and fix borrow checking issues later... - Remove explicit generics in generated expressions. I find it quite rare that one writes `None::<T>` instead of `None`.
2024-06-30Do not explicit generics to generated expressionsTavo Annus-70/+8
2024-06-30SimplifyLukas Wirth-9/+6
2024-06-30Fix expression scope calculation when within macro expansionsLukas Wirth-22/+30
2024-06-24Shrink mbe's OpLukas Wirth-2/+2
2024-06-24Enum variants are not generic def idsLukas Wirth-19/+17
2024-06-24Auto merge of #17478 - kilpkonn:master, r=Veykrilbors-437/+145
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-22Fix suggestions of unstable constantsTavo Annus-4/+8
2024-06-22Increase search depth to account for more granual stepsTavo Annus-1/+3
2024-06-22Simplify `impl_method` tacticTavo Annus-104/+41
2024-06-22Simplify `impl_static_method` tacticTavo Annus-102/+28
2024-06-22Remove remove not-very-helpful optimizationsTavo Annus-47/+0
2024-06-21Run `data_constructor` tactic only backwardsTavo Annus-183/+69
2024-06-21fix: use ItemInNs::Macros to convert ModuleItem to ItemInNsroife-0/+1
2024-06-20Auto merge of #17462 - Veykril:sema-attr-macro-res, r=Veykrilbors-4/+4
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-20fix: Fix IDE features breaking in some attr macrosLukas Wirth-4/+4
2024-06-20Auto merge of #17419 - ishanjain28:filter_builtin_macro_expansion, r=Veykrilbors-2/+48
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-20Invert matching on builtin macros in expand_allowed_builtinsLukas Wirth-25/+21
2024-06-19removed format_args from allowed expansionsIshan Jain-2/+1
2024-06-18Add tactic for associated item constantsTavo Annus-20/+87
2024-06-15Created expand_allowed_builtins, updated expand_macro to call this functionIshan Jain-0/+16
2024-06-14allow format_args! expansionIshan Jain-1/+2
2024-06-14fixed testsIshan Jain-1/+7
2024-06-13internal: Fix rustdoc warningsWilfred Hughes-11/+11
`cargo doc` generates a bunch of warnings on rust-analyzer. Fix all the bare URL and empty code block warnings.
2024-06-13hir/semantics: Only allow expansion of specific built in macrosIshan Jain-2/+30
2024-06-12Auto merge of #17405 - Veykril:modpath-clone, r=Veykrilbors-2/+2
internal: Don't unnecessarily clone ModPaths in early name res
2024-06-12internal: Don't unnecessarily clone ModPaths in early name resLukas Wirth-2/+2
2024-06-11refactor: move the logic that displays container type bounds to function fmtroife-45/+49
2024-06-11fix: skip container header if no generics paramsroife-2/+2
2024-06-11internal: simplify and rename display_xxx to write_xxx for consistencyroife-33/+18
2024-06-11feat: add hover config for showing container boundsroife-14/+22
2024-06-11feat: show type bounds from containers for functionsroife-5/+47
2024-06-11internal: simplify and refactor write_where_clauseroife-89/+97
2024-06-10Remove extra parse cache from Semantics againLukas Wirth-9/+1
2024-06-10Thread more HasSource::source calls through Semantics for cachingLukas Wirth-58/+96
2024-06-09Register virtual workspace Cargo.toml files in the VFSLukas Wirth-0/+1
2024-06-06chore: Prefer tracing span shorthand macrosWilfred Hughes-17/+14
2024-06-05Resolve #17344 by using `.get(…)` instead of `[…]` in ↵Vincent Esche-2/+2
`TypeOrConstParam::source(…)` (… and `LifetimeParam::source(…)`)
2024-06-04Use dyn cache for Semantics macro resolutionLukas Wirth-29/+27
2024-06-04Cache parse trees in `Semantics`Lukas Wirth-2/+19
2024-06-04Cache `file_to_def` in `SourceToDefCtx`Lukas Wirth-28/+40
2024-06-04Try caching macro calls more aggressivelyLukas Wirth-195/+304
2024-06-04Cleanup some inert attribute stuffLukas Wirth-15/+12
2024-06-03SimplifyLukas Wirth-1/+1
2024-06-03Auto merge of #17315 - hamirmahal:style/simplify-string-interpolation, r=Veykrilbors-2/+2
style: simplify string interpolation
2024-06-03Auto merge of #17312 - regexident:function-fn-ptr-type, r=Veykrilbors-0/+8
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-02feat: Enable completions within derive helper attributesLukas Wirth-88/+133
2024-06-01fix: Fix container search failing for tokens originating within derive ↵Lukas Wirth-24/+24
attributes
2024-05-30style: simplify string interpolationHamir Mahal-2/+2
2024-05-29Add `Function::fn_ptr_type(…)` for obtaining name-erased function typeVincent Esche-0/+8