about summary refs log tree commit diff
path: root/src/tools/rust-analyzer/crates
AgeCommit message (Collapse)AuthorLines
2024-05-18Allow hir::Param to refer to other entity params aside from functionsLukas Wirth-118/+114
2024-05-18Update builtin tool listLukas Wirth-25/+16
2024-05-18implement assist to switch between doc and normal commentsLuuk Wester-0/+662
2024-05-17fix: resolve extern prelude for local mods in block modulesroife-7/+12
2024-05-17Clear diagnostics only after new ones were receivedDavid Mládek-1/+10
2024-05-16Auto merge of #17243 - Veykril:static-lt-hir, r=Veykrilbors-40/+70
internal: Add StaticLifetime to hir API
2024-05-16internal: Add StaticLifetime to hir APILukas Wirth-40/+70
2024-05-15Fix typosblyxyas-5/+5
2024-05-14Auto merge of #17232 - Veykril:build-scripts-keep-going, r=Veykrilbors-9/+16
fix: Don't emit --keep-going for custom build script commands Might be the cause for https://github.com/rust-lang/rust-analyzer/issues/17231
2024-05-14fix: Don't emit --keep-going for custom build script commandsLukas Wirth-9/+16
2024-05-14Auto merge of #17216 - Young-Flash:mod_with_path, r=Veykrilbors-3/+78
fix: extract mod to file should respect path attribute close https://github.com/rust-lang/rust-analyzer/issues/17181
2024-05-14Auto merge of #17227 - Veykril:build-deps-changed-hashes, r=Veykrilbors-97/+94
fix: Hash file contents to verify whether file actually changed Fixes https://github.com/rust-lang/rust-analyzer/issues/16580
2024-05-14internal: Sort computed runnablesLukas Wirth-20/+34
2024-05-14Hash file contents to verify whether file actually changedLukas Wirth-94/+75
2024-05-14Auto merge of #17225 - Veykril:expand-macro-interlocked, r=Veykrilbors-27/+15
Expand macro recursively expands both fp-like and attribute macros when intertwined
2024-05-14Track hashes for file contentsLukas Wirth-12/+28
2024-05-14Auto merge of #17224 - Veykril:lock-bump, r=Veykrilbors-3/+6
Bump Cargo.lock
2024-05-14Expand macro recursively expands both fp-like and attribute macros intertwinedLukas Wirth-27/+15
2024-05-14Bump Cargo.lockLukas Wirth-3/+6
2024-05-13Auto merge of #17221 - Veykril:lazier-validation, r=Veykrilbors-140/+151
internal: Lazier macro parse tree validation
2024-05-13`parse_macro_expansion_error` almost never contains values so `Option` itLukas Wirth-8/+14
2024-05-13Push macro-parsing error calculation out of fundamental queriesLukas Wirth-140/+145
2024-05-13Auto merge of #17220 - Veykril:hov-lit, r=Veykrilbors-171/+262
fix: Improve confusing literal hovers
2024-05-13Don't render multi-line literal valuesLukas Wirth-1/+29
2024-05-13Render literal escaping errors in hoversLukas Wirth-79/+68
2024-05-13Auto merge of #17203 - kilpkonn:collapse_terms, r=Veykrilbors-37/+119
Fix OOM caused by term search The issue came from multi Cartesian product for exprs with many (25+) arguments, each having multiple options. The solution is two fold: ### Avoid blowing up in Cartesian product **Before the logic was:** 1. Find expressions for each argument/param - there may be many 2. Take the Cartesian product (which blows up in some cases) 4. If there are more than 2 options throw them away by squashing them to `Many` **Now the logic is:** 1. Find expressions for each argument/param and squash them to `Many` if there are more than 2 as otherwise we are guaranteed to also have more than 2 after taking the product which means squashing them anyway. 2. Take the Cartesian product on iterator 3. Start consuming it one by one 4. If there are more than 2 options throw them away by squashing them to `Many` (same as before) This is also why I had to update some tests as the expressions get squashed to many more eagerly. ### Use fuel to avoid long search times and high memory usage Now all the tactics use `should_continue: Fn() -> bool` to chech if they should keep iterating _(Similarly to chalk)_. This reduces the search times by a magnitude, for example from ~139ms/hole to ~14ms/hole for `ripgrep` crate. There are slightly less expressions found, but I think speed gain worth it for usability. Also note that syntactic hits decreases more because of squashing so you simple need to run search multiple times to get full terms. Also the worst case time (For example `nalgebra` crate cus it has tons of generics) has search times mostly under 200ms. Benchmarks on `ripgrep` crate Before: ``` Tail Expr syntactic hits: 291/1692 (17%) Tail Exprs found: 1253/1692 (74%) Term search avg time: 139ms ```` After: ``` Tail Expr syntactic hits: 239/1692 (14%) Tail Exprs found: 1226/1692 (72%) Term search avg time: 14ms ```
2024-05-13Fix literal hovers being confusing and wrong for floatsLukas Wirth-97/+171
2024-05-13Auto merge of #17188 - szabgab:patch-1, r=Veykrilbors-1/+2
use the repository field to link to the repository
2024-05-13Auto merge of #17187 - roife:fix-issue-17185, r=Veykrilbors-46/+48
fix: keep parentheses when the precedence of inner expr is lower than the outer one fix #17185 Additionally, this PR simplifies some code in `apply_demorgan`.
2024-05-13Auto merge of #17195 - Veykril:unsafe-attr, r=Veykrilbors-11/+534
Implement unsafe attribute parsing
2024-05-12test: add test case extract_with_specified_path_attrYoung-Flash-0/+66
2024-05-12fix: extract mod to file should respect path attributeYoung-Flash-3/+12
2024-05-08fix: Report both IO errors and main_loop errorsWilfred Hughes-2/+8
If rust-analyzer receives a malformed LSP request, the IO thread terminates with a meaningful error, but then closes the channel. Once the channel has closed, the main_loop also terminates, but it only has RecvError and can't show a meaningful error. As a result, rust-analyzer would incorrectly claim that the client forgot to shutdown. ``` $ buggy_lsp_client | rust-analyzer Error: client exited without proper shutdown sequence ``` Instead, include both error messages when the server shuts down.
2024-05-08Make term search fuel configurableTavo Annus-9/+34
2024-05-07Use unit of work as fuel instead of timeTavo Annus-42/+48
2024-05-07Auto merge of #17192 - roife:fix-issue-17179, r=lnicolabors-1/+46
Fix source_range for INT_NUMBER in completion fix #17179. Previously r-a use `TextRange::empty(self.position.offset)` as `source_range` for `INT_NUMBER`, so the `text_edit` would always be an insertion, which results in #17179. This PR changed it by using `text_range` of `original_token` (same as `IDENT`).
2024-05-06Add time based fuel to term searchTavo Annus-8/+36
2024-05-06Collapse term search exprs before Cartesian product to avoid OOMTavo Annus-20/+43
2024-05-06Refactor float `Primitive`s to a separate `Float` typebeetrees-6/+6
2024-05-06Implement unsafe attribute parsingLukas Wirth-11/+534
2024-05-06Fix source_range for INT_NUMBER in completionroife-1/+46
2024-05-05fix lifetime bound var index in dyn traitdfireBird-5/+25
2024-05-05tests: update test in assist apply_demorganroife-10/+8
2024-05-05use the repository field to link to the repositoryGábor Szabó-1/+2
2024-05-05fix: keep parentheses when the precedence of inner expr is lower than the ↵roife-36/+40
outer one
2024-05-02Fix Run lens showing when lenses are disabledhermannm-1/+1
The documentation for `lens.run.enable` states that it only applies when `lens.enable` is set. However, the config setting whether to show the Run lens did not check `lens.enable`, so the Run lens would show even though lenses were disabled.
2024-05-02Change `SIGPIPE` ui from `#[unix_sigpipe = "..."]` to `-Zon-broken-pipe=...`Martin Nordholts-1/+0
In the stabilization attempt of `#[unix_sigpipe = "sig_dfl"]`, a concern was raised related to using a language attribute for the feature: Long term, we want `fn lang_start()` to be definable by any crate, not just libstd. Having a special language attribute in that case becomes awkward. So as a first step towards towards the next stabilization attempt, this PR changes the `#[unix_sigpipe = "..."]` attribute to a compiler flag `-Zon-broken-pipe=...` to remove that concern, since now the language is not "contaminated" by this feature. Another point was also raised, namely that the ui should not leak **how** it does things, but rather what the **end effect** is. The new flag uses the proposed naming. This is of course something that can be iterated on further before stabilization.
2024-05-02Auto merge of #17176 - Veykril:fix-implicit-ty-args, r=Veykrilbors-4/+33
Fix impl trait params not being counted properly Fixes the other thing in https://github.com/rust-lang/rust-analyzer/issues/17173, this just rolls back a change from https://github.com/rust-lang/rust-analyzer/pull/17175 and adds a comment as to what it does
2024-05-02Fix impl trait params not being counted properlyLukas Wirth-4/+33
2024-05-02Auto merge of #17175 - Veykril:fix-implicit-ty-args, r=Veykrilbors-120/+116
fix: Fix implicit ty args being lowered where they shouldn't Fixes https://github.com/rust-lang/rust-analyzer/issues/17173