about summary refs log tree commit diff
path: root/src/tools/rust-analyzer
AgeCommit message (Collapse)AuthorLines
2024-09-28Update handlers.rs to handlers/requests.rsNoah Bright-3/+5
2024-09-27Auto merge of #18192 - darichey:read-buildfile-into-vfs, r=Veykrilbors-0/+16
Include buildfiles in VFS We subscribe to `textDocument/didSave` for `filesToWatch`, but the VFS doesn't contain those files. Before https://github.com/rust-lang/rust-analyzer/pull/18105, this would bring down the server. Now, it's only a benign error logged: ``` ERROR notification handler failed handler=textDocument/didSave error=file not found: /foo/bar/TARGETS ``` It's benign, because we will also receive a `workspace/didChangeWatchedFiles` for the file which will invalidate and load it. Explicitly include the buildfiles in the VFS to prevent the handler from erroring.
2024-09-27Update cc to 1.1.22Chris Denton-2/+11
2024-09-27Auto merge of #17923 - basvandriel:feature/build-before-restart-debug, r=Veykrilbors-1/+63
Building before a debugging session was restarted # Background Resolves #17901. It adds support for rebuilding after debugging a test was restarted. This means the test doesn't have to be aborted and manually re-ran again. # How this is tested First, all the Visual Studio Code extensions are loaded into an Extension Host window. Then, a sample test like below was ran and restarted to see if it was correctly rebuild. ```rust #[test] fn test_x() { assert_eq!("1.1.1", "1.1.0"); } ```
2024-09-27Auto merge of #18196 - DropDemBits:sed-syntax-factory, r=Veykrilbors-167/+221
internal: Add `SyntaxFactory` to ease generating nodes with syntax mappings Part of [#​15710](https://github.com/rust-lang/rust-analyzer/issues/15710) Instead of requiring passing a `&mut SyntaxEditor` to every make constructor to generate mappings, we instead wrap that logic in `SyntaxFactory`, and afterwards add all the mappings to the `SyntaxEditor`. Includes an example of using `SyntaxEditor` & `SyntaxFactory` in the `extract_variable` assist.
2024-09-27Auto merge of #18197 - alibektas:buggy_flycheck_message, r=Veykrilbors-1/+1
minor: Stricter requirements for package wide flycheck Require the existence of a target and `check_workspace` to be false to restart package-wide flycheck. Fixes #18194 , #18104
2024-09-27minor: Require both the existence of a target and check_workspace to be ↵Ali Bektas-1/+1
false to restart package-wide flycheck
2024-09-26minor: Use `SyntaxEditor` in `extract_variable`DropDemBits-66/+35
2024-09-26internal: Add `SyntaxFactory` to ease generating nodes with syntax mappingsDropDemBits-101/+186
2024-09-26fix: Don't report a startup error when a discover command is configuredWilfred Hughes-12/+6
Previously, r-a would show an error if both fetch_workspaces_queue and discover_workspace_queue were empty. We're in this state at startup, so users would see an error if they'd configured discover_workspace_config. Instead, allow the fetch_workspaces_queue to have zero items if discover_workspace_config is set. Whilst we're here, prefer "failed to fetch" over "failed to discover", so the error message better reflects what this function is doing.
2024-09-26Include buildfiles in vfsDavid Richey-0/+16
2024-09-25Require rust 1.81David Richey-1/+1
2024-09-25Auto merge of #18180 - kpreid:search, r=davidbarskybors-0/+16
feat: Index workspace symbols at startup rather than on the first symbol search. This will eliminate potential many-second delays when performing the first search, at the price of making cache priming (“Indexing N/M” in the VS Code status bar) take a little longer in total. Hopefully this additional time is insignificant because a typical session will involve at least one symbol search. Further improvement would be to do this as a separate parallel task (which will be beneficial if the workspace contains a small number of large crates), but that would require significant additional refactoring of the progress-reporting mechanism to understand multiple tasks per crate. Happy to tackle that in this PR if desired, but I thought I'd propose the minimal change first.
2024-09-25Auto merge of #18181 - davidbarsky:davidbarsky/push-nzstpumovmmx, r=davidbarskybors-4/+24
internal: add tracing to project discovery and VFS loading With `"env RA_PROFILE=vfs_load|parallel_prime_caches|discover_command>500`, this results in the following output: ``` 21888ms discover_command 11627ms vfs_load @ total = 701 1503ms vfs_load @ total = 701 30211ms parallel_prime_caches ``` As a followup, I'd like to make hprof emit the information above as JSON.
2024-09-25Prime caches for symbol search too.Kevin Reid-0/+16
2024-09-25internal: add tracing to project discovery and VFS loadingDavid Barsky-4/+24
2024-09-25Changes for debug restartingBas van Driel-1/+63
2024-09-25Add missing rustc_privateLaurențiu Nicola-0/+7
2024-09-25Auto merge of #18183 - lnicola:sync-from-rust, r=lnicolabors-56/+76
internal: Sync from downstream
2024-09-25Run rustfmtLaurențiu Nicola-3/+1
2024-09-25Pass all-targets for build scripts in more cli commandsLukas Wirth-12/+30
Without this, build scripts don't run for tests and as such any proc-macros in dev-deps fail to resolve
2024-09-25Add more LayoutError variantsLaurențiu Nicola-3/+8
2024-09-25Bump rustc cratesLaurențiu Nicola-17/+17
2024-09-25Merge from rust-lang/rustLaurențiu Nicola-38/+55
2024-09-25Preparing for merge from rust-lang/rustLaurențiu Nicola-1/+1
2024-09-24Auto merge of #18164 - ShoyuVanilla:use-as-alias, r=Veykrilbors-13/+97
fix: Temporary fix for `remove_unused_imports` not handling import aliases correctly Fixes #18129
2024-09-24fix: Temporary fix for `remove_unused_imports` not handling import aliases ↵Shoyu Vanilla-13/+97
correctly
2024-09-24Auto merge of #18166 - ChayimFriedman2:dollar-crate-root, r=Veykrilbors-5/+33
fix: Fix a bug in span map merge, and add explanations of how span maps are stored Because it took me hours to figure out that contrary to common sense, the offset stored is the *end* of the node, and we search by the *start*. Which is why we need a convoluted `partition_point()` instead of a simple `binary_search()`. And this was not documented at all. Which made me make mistakes with my implementation of `SpanMap::merge()`. The other bug fixed about span map merging is correctly keeping track of the current offset in presence of multiple sibling macro invocations. Unrelated, but because of the previous issue it took me hours to debug, so I figured out I'll put them together for posterity. Fixes #18163.
2024-09-24Auto merge of #18161 - ChayimFriedman2:postfix-mut, r=Veykrilbors-1/+52
fix: Better support references in consuming postfix completions Fixes #18155.
2024-09-24Auto merge of #18160 - ChayimFriedman2:fix-18138, r=Veykrilbors-13/+82
fix: Fix name resolution when an import is resolved to some namespace and then later in the algorithm another namespace is added The import is flagged as "indeterminate", and previously it was re-resolved, but only at the end of name resolution, when it's already too late for anything that depends on it. This issue was tried to fix in https://github.com/rust-lang/rust-analyzer/pull/2466, but it was not fixed fully. That PR is also why IDE features did work: the import at the end was resolved correctly, so IDE features that re-resolved the macro path resolved it correctly. I was concerned about the performance of this, but this doesn't seem to regress `analysis-stats .`, so I guess it's fine to land this. I have no idea about the incremental perf however and I don't know how to measure that, although when typing in `zbus` (including creating a new function, which should recompute the def map) completion was fast enough. I didn't check what rustc does, so maybe it does something more performant, like keeping track of only possibly problematic imports. Fixes #18138. Probably fixes #17630.
2024-09-24Auto merge of #18157 - ↵bors-1/+5
davidbarsky:davidbarsky/respect-disabling-proc-macros-in-analysis-stats, r=Veykril analysis-stats: respect `--disable-proc-macros` flag I noticed that this flag wasn't being respected by `analysis-stats` when profiling proc macro expansion, so here's a small fix.
2024-09-24Auto merge of #18123 - jhgg:fix-ambigius-package-cargo-check, r=Veykrilbors-1/+1
fix: fix ambigious package name in flycheck fixes #18121
2024-09-24Auto merge of #18175 - Wilfred:completion_marker, r=Veykrilbors-1/+1
internal: Make COMPLETION_MARKER more explicitly r-a If a user ever sees the completion marker, it's confusing to see text about IntelliJ. Use a string that's more explicitly about completion for rust-analyzer.
2024-09-24Auto merge of #18162 - ChayimFriedman2:gat-object-safe, r=Veykrilbors-1/+14
fix: Consider lifetime GATs object unsafe Fixes #18156.
2024-09-23internal: Make COMPLETION_MARKER more explicitly r-aWilfred Hughes-1/+1
If a user ever sees the completion marker, it's confusing to see text about IntelliJ. Use a string that's more explicitly about completion for rust-analyzer.
2024-09-23Small fixesKirill Bulatov-6/+6
2024-09-23Support expect in attribute completion and hoverLaurențiu Nicola-5/+52
2024-09-23Revert "internal: Disable GitHub releases for now"Laurențiu Nicola-6/+6
2024-09-23Disable GitHub releases for nowLaurențiu Nicola-6/+6
2024-09-23Fix the testKirill Bulatov-1/+1
2024-09-23Less clonesKirill Bulatov-5/+5
2024-09-23Resolve completion itemsKirill Bulatov-11/+42
2024-09-23Omit completion fields to be resolved laterKirill Bulatov-62/+99
2024-09-23Prepare for omittiong parts of completion data that need to be resolvedKirill Bulatov-16/+99
2024-09-23Fix a bug in span map merge, and add explanations of how span maps are storedChayim Refael Friedman-5/+33
Because it took me hours to figure out that contrary to common sense, the offset stored is the *end* of the node, and we search by the *start*. Which is why we need a convoluted `partition_point()` instead of a simple `binary_search()`. And this was not documented at all. Which made me make mistakes with my implementation of `SpanMap::merge()`. The other bug fixed about span map merging is correctly keeping track of the current offset in presence of multiple sibling macro invocations. Unrelated, but because of the previous issue it took me hours to debug, so I figured out I'll put them together for posterity.
2024-09-22Consider lifetime GATs object unsafeChayim Refael Friedman-1/+14
2024-09-22Include dereferences in consuming postfix completions (e.g. `call`)Chayim Refael Friedman-0/+31
2024-09-22Properly account for mutable references when postfix-completing consuming ↵Chayim Refael Friedman-1/+21
completions (e.g. `call`)
2024-09-22Fix name resolution when an import is resolved to some namespace and then ↵Chayim Refael Friedman-13/+82
later in the algorithm another namespace is added The import is flagged as "indeterminate", and previously it was re-resolved, but only at the end of name resolution, when it's already too late for anything that depends on it. This issue was tried to fix in https://github.com/rust-lang/rust-analyzer/pull/2466, but it was not fixed fully.
2024-09-21add `C-cmse-nonsecure-entry` ABIFolkert de Vries-0/+5