about summary refs log tree commit diff
path: root/src/tools/rust-analyzer
AgeCommit message (Collapse)AuthorLines
2024-06-21Auto merge of #17469 - roife:fix-issue-17425, r=Veykrilbors-0/+1
fix: use ItemInNs::Macros to convert ModuleItem to ItemInNs fix #17425. When converting `PathResolution` to `ItemInNs`, we should convert `ModuleDef::Macro` to `ItemInNs::Macros` to ensure that it can be found in `DefMap`.
2024-06-21Prevent re-allocation in `CallableSig::from_params_and_return`Lukas Wirth-8/+9
2024-06-21Save allocations for empty generic_defaults query resultsLukas Wirth-60/+67
2024-06-21Don't attempt to compute implict sized clauses for empty genericsLukas Wirth-37/+46
2024-06-21Save allocations for empty generic_predicates query resultsLukas Wirth-14/+27
2024-06-21Lazy genericsLukas Wirth-11/+26
2024-06-21SimplifyLukas Wirth-27/+27
2024-06-21There can only be one self paramLukas Wirth-66/+61
2024-06-21Light docs and privacyLukas Wirth-106/+84
2024-06-21fix: don't remove parentheses for calls of function-like pointers that are ↵davidsemakula-0/+37
members of a struct or union
2024-06-21fix: use ItemInNs::Macros to convert ModuleItem to ItemInNsroife-0/+1
2024-06-21Extract generics moduleLukas Wirth-323/+333
2024-06-20fix: Improve hover text in unlinked file diagnosticsWilfred Hughes-3/+6
Use full sentences, and mention how to disable the diagnostic if users are intentionally working on unowned files.
2024-06-21Fix diagnostic name in macro_error.rsYukang-1/+1
2024-06-20Check that Expr is none before adding fixupWyatt Herkamp-1/+15
2024-06-20Auto merge of #17462 - Veykril:sema-attr-macro-res, r=Veykrilbors-6/+6
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-6/+6
2024-06-20Auto merge of #17461 - Veykril:drop-flycheck-recv, r=Veykrilbors-0/+1
fix: Fix flycheck panicking when cancelled Fixes https://github.com/rust-lang/rust-analyzer/issues/17445
2024-06-20Auto merge of #17419 - ishanjain28:filter_builtin_macro_expansion, r=Veykrilbors-5/+75
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-29/+25
2024-06-20Auto merge of #17456 - panicbit:remove-cargo-extension-warning, r=Veykrilbors-10/+0
Remove panicbit.cargo extension warning A warning was introduced regarding the incompatabilities between `rust-analyzer` and `panicbit.cargo`'s diagnostics / `cargo check` functionality. This functionality has been removed in the latest version of the cargo extension (`0.3.0`), which is why the warning can be removed now.
2024-06-20fix: Fix flycheck panicking when cancelledLukas Wirth-0/+1
2024-06-20Auto merge of #17457 - roife:remove-circle, r=Veykrilbors-30/+63
fix: ensure there are no cycles in the source_root_parent_map See #17409 We can view the connections between roots as a graph. The problem is that this graph may contain cycles, so when adding edges, it is necessary to check whether it will lead to a cycle. Since we ensure that each node has at most one outgoing edge (because each SourceRoot can have only one parent), we can use a disjoint-set to maintain the connectivity between nodes. If an edge’s two nodes belong to the same set, they are already connected. Additionally, this PR includes the following three changes: 1. Removed the workaround from #17409. 2. Added an optimization: If `map.contains_key(&SourceRootId(*root_id as u32))`, we can skip the current loop iteration since we have already found its parent. 3. Modified the inner loop to iterate in reverse order with `roots[..idx].iter().rev()` at line 319. This ensures that if we are looking for the parent of `a/b/c`, and both `a` and `a/b` meet the criteria, we will choose the longer match (`a/b`).
2024-06-20fix: ensure there are no cycles in the source_root_parent_maproife-30/+63
2024-06-20Merge from rust-lang/rustLaurențiu Nicola-0/+1
2024-06-20Preparing for merge from rust-lang/rustLaurențiu Nicola-1/+1
2024-06-19fix(completion): complete async keywordMaria José Solano-0/+21
2024-06-19remove panicbit.cargo extension warningpanicbit-10/+0
2024-06-19removed format_args from allowed expansionsIshan Jain-2/+1
2024-06-19updated testsIshan Jain-17/+14
2024-06-19Auto merge of #17449 - kilpkonn:assoc_const, r=Veykrilbors-20/+118
Term search: new tactic for associated item constants New tactic to cover some more exotic cases that started bothering me. Associated constants seem to be common in [axum](https://github.com/tokio-rs/axum/blob/806bc26e62afc2e0c83240a9e85c14c96bc2ceb3/examples/readme/src/main.rs#L53).
2024-06-19Auto merge of #17438 - jjoeldaniel:toggle_lsp_logs, r=Veykrilbors-2/+25
feat: add `toggleLSPLogs` command Implement client-side command to toggle LSP logs in VSCode. The command replaces the need to add/remove the `"rust-analyzer.trace.server": "verbose"` setting each time one wants to display logs. I've also updated the docs/ instances that reference the now outdated manual method. The command labeled `rust-analyzer: Toggle LSP Logs` enables the setting project-wide and opens the relevant trace output channel. Closes #8233
2024-06-19Auto merge of #17431 - roife:fix-issue-17428, r=Veykrilbors-24/+193
feat: add space after specific keywords in completion fix #17428. When completing some specific keywords, it would be convenient if r-a could automatically add a space afterwards. This PR implements this feature for the following keywords: - Visibility: `pub`, `pub(crate)`, `pub(super)`, `pub(in xxx)` - Pattern: `ref` / `mut` - Others: `unsafe` / `for` / `where`
2024-06-19Auto merge of #17426 - roife:fix-issue-17420, r=Veykrilbors-1/+21
fix: handle character boundaries for wide chars in extend_selection fix #17420. When calling 'extend_selection' within a string, r-a attempts to locate the current word at the cursor. This is done by finding the first char before the cursor which is not a letter, digit, or underscore. The position of this character is referred to as `start_idx`, and the word is considered to start from `start_idx + 1`. However, for wide characters, `start_idx + 1` is not character boundaries, which leading to panic. We should use `ceil_char_boundary` to ensure that the idx is always on character boundaries.
2024-06-19Auto merge of #17415 - Wilfred:unlinked_diagnostic_span, r=Veykrilbors-3/+23
fix: Only show unlinked-file diagnostic on first line during startup This partially reverts #17350, based on the feedback in #17397. If we don't have an autofix, it's more annoying to highlight the whole file. This autofix heuristic fixes the diagnostic being overwhelming during startup.
2024-06-19Auto merge of #17455 - Veykril:vscode-ext, r=Veykrilbors-171/+143
Tidy up vscode extension a bit
2024-06-19Tidy up vscode extension a bitLukas Wirth-171/+143
2024-06-18Add tactic for associated item constantsTavo Annus-20/+118
2024-06-18Update lib.rsabdullathedruid-1/+1
2024-06-17Auto merge of #17442 - Veykril:pat-eof, r=Veykrilbors-1/+39
fix: Fix pat fragment parsers choking on <eoi> Fixes https://github.com/rust-lang/rust-analyzer/issues/17441
2024-06-17fix: Fix pat fragment parsers choking on <eoi>Lukas Wirth-1/+39
2024-06-17Auto merge of #17435 - Lunaphied:fix/manual-generation, r=Veykrilbors-1/+1
docs: fix manual generation instructions To generate all the requisite files, you need to run `cargo xtask codegen` not `cargo test -p xtask`.
2024-06-17Auto merge of #17434 - Lunaphied:fix/document-inlay-parameters, r=Veykrilbors-0/+17
docs: document omission heuristics for parameter inlay hints These are not currently documented and could cause users to think that their rust-analyzer configuration is broken. Partially addresses #17433.
2024-06-17Auto merge of #17439 - Veykril:paralleler-prime-caches, r=Veykrilbors-35/+138
Properly prime all crate def maps in parallel_prime_caches
2024-06-17Fix and cleanup VSCode task buildingLukas Wirth-72/+85
2024-06-17Add some more syntax fixup rulesLukas Wirth-1/+122
2024-06-17Properly prime all crate def maps in `parallel_prime_caches`Lukas Wirth-34/+16
2024-06-17feat: add `toggleLSPLogs` commandJoel Daniel Rico-2/+25
add `toggleLSPLogs` command update docs to reflect new command
2024-06-16docs: fix manual generation instructionsLunaphied-1/+1
To generate all the requisite files, you need to run `cargo xtask codegen` not `cargo test -p xtask`.
2024-06-16docs: document omission heuristics for parameter inlay hintsLunaphied-0/+17
These are not currently documented and could cause users to think that their rust-analyzer configuration is broken. Partially addresses #17433.