about summary refs log tree commit diff
AgeCommit message (Collapse)AuthorLines
2024-09-06fix: Always explicitly set trait ref self types when loweringLukas Wirth-64/+80
2024-09-06Bump lsp-serverLukas Wirth-7/+7
2024-09-06Auto merge of #18066 - Veykril:lsp-server-no-panic, r=Veykrilbors-13/+11
fix: Don't panic lsp writer thread on dropped receiver Should reduce the noise a bit (https://github.com/rust-lang/rust-analyzer/issues/18055). This removes the panic (and a follow up panic) when the server incorrectly shuts down, turning it into a proper late exit error.
2024-09-06fix: Don't panic lsp writer thread on dropped receiverLukas Wirth-13/+11
2024-09-06Auto merge of #18065 - Veykril:catchy-diagnostics, r=Veykrilbors-12/+23
fix: Catch panics from diagnostics computation
2024-09-06fix: Catch panics from diagnostics computationLukas Wirth-12/+23
2024-09-06Auto merge of #18059 - Wilfred:config_cleanups, r=Veykrilbors-61/+85
fix: Updating settings should not clobber discovered projects `linkedProjects` is owned by the user's configuration, so when users update this setting, `linkedProjects` is reset. This is problematic when `linkedProjects` also contains projects discovered with `discoverCommand`. The buggy behaviour occurred when: (1) The user configures `discoverCommand` and loads a Rust project. (2) The user changes any setting in VS Code, so rust-analyzer receives `workspace/didChangeConfiguration`. (3) `handle_did_change_configuration` ultimately calls `Client::apply_change_with_sink()`, which updates `config.user_config` and discards any items we added in `linkedProjects`. Instead, separate out `discovered_projects_from_filesystem` and `discovered_projects_from_command` from user configuration, so user settings cannot affect any type of discovered project. This fixes the subtle issue mentioned here: https://github.com/rust-lang/rust-analyzer/pull/17246#issuecomment-2185259122
2024-09-05fix: Updating settings should not clobber discovered projectsWilfred Hughes-61/+85
`linkedProjects` is owned by the user's configuration, so when users update this setting, `linkedProjects` is reset. This is problematic when `linkedProjects` also contains projects discovered with `discoverCommand`. The buggy behaviour occurred when: (1) The user configures `discoverCommand` and loads a Rust project. (2) The user changes any setting in VS Code, so rust-analyzer receives `workspace/didChangeConfiguration`. (3) `handle_did_change_configuration` ultimately calls `Client::apply_change_with_sink()`, which updates `config.user_config` and discards any items we added in `linkedProjects`. Instead, separate out `discovered_projects_from_filesystem` and `discovered_projects_from_command` from user configuration, so user settings cannot affect any type of discovered project. This fixes the subtle issue mentioned here: https://github.com/rust-lang/rust-analyzer/pull/17246#issuecomment-2185259122
2024-09-05Auto merge of #18053 - Veykril:asm-parse, r=Veykrilbors-18/+112
fix: Couple asm! parsing and lowering fixes
2024-09-05fix: Fix parser panicking on invalid asm optionsLukas Wirth-0/+6
2024-09-05asm! parsing and lowering fixesLukas Wirth-18/+106
2024-09-05Auto merge of #18022 - Veykril:asm-parse, r=Veykrilbors-164/+2070
feat: IDE support for `asm!` expressions Fixes https://github.com/rust-lang/rust-analyzer/issues/10461, Fixes https://github.com/rust-lang/rust-analyzer/issues/6031 Progresses https://github.com/rust-lang/rust-analyzer/issues/11621 Notably this only works for asm expressions not items yet. Most IDE features work, mainly completions need extra logic still.
2024-09-05Fix name fetching being incorrect for asm operandsLukas Wirth-93/+107
2024-09-05Add missing doc commentsLukas Wirth-0/+1
2024-09-05Support more IDE features for asm operandsLukas Wirth-40/+180
2024-09-05Give InlineAsmOperand a HIR representationLukas Wirth-217/+409
2024-09-05Add Definition kind for asm register operandLukas Wirth-35/+59
2024-09-05Add Definition kind for asm register classesLukas Wirth-28/+214
2024-09-05Lower asm expressionsLukas Wirth-97/+612
2024-09-04Parse builtin#asm expressionsLukas Wirth-31/+865
2024-09-04Auto merge of #18045 - Veykril:fix-loop-lower, r=Veykrilbors-9/+65
fix: Fix lowering of for loops dropping the loop block
2024-09-04fix: Fix lowering of for loops dropping the `loop` blockLukas Wirth-9/+65
2024-09-04Auto merge of #18044 - Veykril:highlight-kw-test, r=Veykrilbors-7/+326
internal: Add edition dependent keyword highlighting tests
2024-09-04Add edition dependent keyword highlighting testsLukas Wirth-7/+326
2024-09-03Auto merge of #18036 - Veykril:smol_str, r=Veykrilbors-4/+20
Bump `smol_str`
2024-09-03Bump smol_strLukas Wirth-4/+20
2024-09-03Auto merge of #17984 - ShoyuVanilla:cast, r=Veykrilbors-93/+1614
feat: Implement cast typecheck and diagnostics Fixes #17897 and fixes #16564 Mainly adopted from https://github.com/rust-lang/rust/blob/100fde5246bf56f22fb5cc85374dd841296fce0e/compiler/rustc_hir_typeck/src/cast.rs
2024-09-03Auto merge of #18031 - roife:suggest-name-in-completion, r=Veykrilbors-15/+142
feat: Suggest name in completion for let_stmt and fn_param fix #17780 1. Refactor: move `ide_assist::utils::suggest_name` to `ide-db::syntax_helpers::suggest_name` for reuse. 2. When completing `IdentPat`, detecte if the current node is a `let_stmt` or `fn_param`, and suggesting a new name based on the context.
2024-09-03tests: suggesting names in completions for let_stmt and fn_paramroife-0/+73
2024-09-03feat: suggest name in let_stmt and fn_paramroife-2/+53
2024-09-03refactor: move ide_assist::utils::suggest_name to ide-dbroife-13/+16
2024-09-03feat: Implement cast typechecksShoyu Vanilla-93/+1614
2024-09-02Auto merge of #18029 - lnicola:minor-stuff, r=lnicolabors-7/+4
minor: fix two nits
2024-09-02Merge some stringsLaurențiu Nicola-6/+3
2024-09-02Avoid Option::is_none_or for a whileLaurențiu Nicola-1/+1
2024-09-02Auto merge of #18028 - Veykril:lifetime-hints-panic, r=Veykrilbors-1/+19
fix: lifetime hint panic in non generic defs
2024-09-02fix: lifetime hint panic in non generic defsLukas Wirth-1/+19
2024-09-02Auto merge of #18016 - IvarWithoutBones:wrap-return-ty-local-result, r=Veykrilbors-16/+294
fix: use Result type aliases in "Wrap return type in Result" assist This commit makes the "Wrap return type in Result" assist prefer type aliases of standard library type when the are in scope, use at least one generic parameter, and have the name `Result`. The last restriction was made in an attempt to avoid false assumptions about which type the user is referring to, but that might be overly strict. We could also do something like this, in order of priority: * Use the alias named "Result". * Use any alias if only a single one is in scope, otherwise: * Use the standard library type. This is easy to add if others feel differently that is appropriate, just let me know. Fixes #17796
2024-09-02Auto merge of #18026 - Veykril:completions, r=Veykrilbors-134/+125
internal: Adjust completions scoring
2024-09-02Adjust completions scoringLukas Wirth-50/+46
2024-09-02Simplify CompletionRelevanceLukas Wirth-90/+85
2024-09-02Auto merge of #18025 - cuishuang:master, r=lnicolabors-4/+4
minor: remove repetitive words
2024-09-02chore: fix some commentscuishuang-4/+4
Signed-off-by: cuishuang <imcusg@gmail.com>
2024-09-02fix: use Result type aliases in "Wrap return type in Result" assistIvar Scholten-16/+294
This commit makes the "Wrap return type in Result" assist prefer type aliases of standard library type when the are in scope, use at least one generic parameter, and have the name "Result". The last restriction was made in an attempt to avoid false assumptions about which type the user is referring to, but that might be overly strict. We could also do something like this, in order of priority: * Use the alias named "Result". * Use any alias if only a single one is in scope, otherwise: * Use the standard library type. This is easy to add if others feel differently that is appropriate, just let me know.
2024-09-01Auto merge of #17967 - Veykril:mbe-tests, r=Veykrilbors-76/+288
internal: Lay basic ground work for standalone mbe tests Most of our mbe hir-def tests don't actually do anything name res relevant, we can (and should) move those down the stack into `mbe/hir-expand`.
2024-09-01internal: Lay basic ground work for standalone mbe testsLukas Wirth-52/+233
2024-09-01Auto merge of #17985 - riverbl:explicit-enum-discriminant, r=Veykrilbors-3/+258
Add explicit enum discriminant assist Add assist for adding explicit discriminants to all variants of an enum. Closes #17798.
2024-09-01minor: Reduce friction for updating minicoreLukas Wirth-27/+58
2024-09-01Auto merge of #17737 - hyf0:hyf_32089420384, r=Veykrilbors-21/+284
feat(ide-completion): extra sugar auto-completion `async fn ...` in `impl trait` for `async fn in trait` that's defined in desugar form Solves #17719. --- Preview <img width="670" alt="image" src="https://github.com/user-attachments/assets/64ccef84-4062-4702-8760-89220585f422"> <img width="540" alt="image" src="https://github.com/user-attachments/assets/d22637f9-d531-43b2-a9f1-cd40a002903a"> <img width="631" alt="image" src="https://github.com/user-attachments/assets/21cd2142-bb8e-4493-9ac7-e6a9e7076904">
2024-09-01Complete desugared and resugared async fn in trait implsLukas Wirth-87/+267