abdullathedruid
b8a5fc7c43
Update lib.rs
2024-06-18 00:52:53 +01:00
bors
6891225afa
Auto merge of #17442 - Veykril:pat-eof, r=Veykril
...
fix: Fix pat fragment parsers choking on <eoi>
Fixes https://github.com/rust-lang/rust-analyzer/issues/17441
2024-06-17 17:44:35 +00:00
Lukas Wirth
d2f975a060
fix: Fix pat fragment parsers choking on <eoi>
2024-06-17 19:42:56 +02:00
bors
5d5c29824c
Auto merge of #17435 - Lunaphied:fix/manual-generation, r=Veykril
...
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-17 16:24:32 +00:00
bors
e06b8aad88
Auto merge of #17434 - Lunaphied:fix/document-inlay-parameters, r=Veykril
...
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-17 16:11:17 +00:00
bors
45b1e13ffe
Auto merge of #17439 - Veykril:paralleler-prime-caches, r=Veykril
...
Properly prime all crate def maps in parallel_prime_caches
2024-06-17 15:58:09 +00:00
Lukas Wirth
ebb32f5d1b
Fix and cleanup VSCode task building
2024-06-17 14:06:01 +02:00
Lukas Wirth
ffb00fd50f
Add some more syntax fixup rules
2024-06-17 13:10:56 +02:00
Lukas Wirth
2fe9b7edad
Properly prime all crate def maps in parallel_prime_caches
2024-06-17 13:10:39 +02:00
Lunaphied
0257394d4c
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-16 15:25:42 -06:00
Lunaphied
5385429f7f
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-16 15:15:36 -06:00
bors
e0c1b2bf75
Auto merge of #17417 - Wilfred:intern_macros_salsa, r=Veykril
...
refactor: Prefer plain trait definitions over macros for impl_intern_value_trivial
`impl_intern_value_trivial` can be defined with a trait directly, so prefer that over a macro definition.
2024-06-14 06:20:26 +00:00
Wilfred Hughes
767da82b13
Prefer plain trait definitions over macros for salsa
2024-06-13 17:32:06 -07:00
Wilfred Hughes
501cef922d
internal: Fix rustdoc warnings
...
`cargo doc` generates a bunch of warnings on rust-analyzer. Fix all the
bare URL and empty code block warnings.
2024-06-13 17:29:10 -07:00
bors
85e87fbf29
Auto merge of #17407 - davidbarsky:david/fix-17402, r=Veykril
...
fix: avoid doubling cargo args in runnables
Fixes #17402 .
Sorry about this—I think I missed up the rebase!
2024-06-13 15:34:29 +00:00
David Barsky
c2843be1bb
fix: avoid doubling cargo args in runnables
2024-06-13 11:08:58 -04:00
David Hewitt
a29d99de3b
fix: add a breaker to avoid infinite loops from source root cycles
2024-06-13 06:32:05 +01:00
bors
51ea7e8318
Auto merge of #17406 - Veykril:modpath-clone, r=Veykril
...
internal: Don't unnecessarily clone ModPaths out of interning wrappers
2024-06-12 09:49:41 +00:00
Lukas Wirth
4e21a5a391
internal: Don't unnecessarily clone ModPaths out of interning wrappers
2024-06-12 11:43:36 +02:00
bors
68fa2a9bc4
Auto merge of #17405 - Veykril:modpath-clone, r=Veykril
...
internal: Don't unnecessarily clone ModPaths in early name res
2024-06-12 09:27:49 +00:00
Lukas Wirth
1a26a1f232
internal: Don't unnecessarily clone ModPaths in early name res
2024-06-12 11:25:19 +02:00
bors
031d37ff95
Auto merge of #17398 - Veykril:bogus-file, r=Veykril
...
internal: Remove FileId::BOGUS
2024-06-12 07:19:31 +00:00
Lukas Wirth
c86f3d3234
internal: Remove FileId::BOGUS
2024-06-12 08:16:07 +02:00
bors
a97aef8466
Auto merge of #16840 - Wilfred:shell_runnable, r=Veykril
...
Allow rust-project.json to include arbitrary shell commands for runnables
This is a follow-up on #16135 , resolving the feedback raised :)
Allow rust-project.json to include shell runnables, of the form:
```
{
"build_info": {
"label": "//project/foo:my-crate",
"target_kind": "bin",
"shell_runnables": [
{
"kind": "run",
"program": "buck2",
"args": ["run", "//project/foo:my-crate"]
},
{
"kind": "test_one",
"program": "test_runner",
"args": ["--name=$$TEST_NAME$$"]
}
]
}
}
```
If these runnable configs are present for the current crate in rust-project.json, offer them as runnables in VS Code.
This PR required some boring changes to APIs that previously only handled cargo situations. I've split out these changes as commits labelled 'refactor', so it's easy to see the interesting changes.
2024-06-11 16:13:10 +00:00
Wilfred Hughes
1e9e86c655
feature: add build system info; runnables to rust-project.json
2024-06-11 11:55:17 -04:00
bors
5e1ab70dff
Auto merge of #17394 - Veykril:recurse-fix, r=Veykril
...
fix: Fix `HirDisplay` stackoverflow for parameter Self defaults
Fixes https://github.com/rust-lang/rust-analyzer/issues/10932
2024-06-11 15:05:26 +00:00
Lukas Wirth
36caa43ec1
fix: Fix HirDisplay stackoverflow for parameter Self defaults
2024-06-11 17:04:07 +02:00
bors
21e9022cda
Auto merge of #17364 - roife:fix-issue-12917, r=Veykril
...
feat: show type bounds from containers when hovering on functions
fix #12917 .
### Changes
1. Added Support for displaying the container and type bounds from it when hovering on functions with generic types.
2. Added a user config to determine whether to display container bounds (enabled by default).
3. Added regression tests.
4. Simplified and refactored `hir/display.rs` to improve readability.
2024-06-11 13:28:11 +00:00
bors
a3ec3b9621
Auto merge of #17392 - randomicon00:17242, r=Veykril
...
Change 'Length' to 'Len'
This is a fix for #17242
2024-06-11 13:14:56 +00:00
randomicon00
ca7e04ffe1
edit: Length to Len in benchmark
2024-06-11 09:09:56 -04:00
roife
668327a672
refactor: move the logic that displays container type bounds to function fmt
2024-06-11 21:02:13 +08:00
roife
6c122f6990
fix: skip container header if no generics params
2024-06-11 21:02:13 +08:00
roife
687889c5c3
internal: simplify and rename display_xxx to write_xxx for consistency
2024-06-11 21:02:13 +08:00
roife
445e8866a3
feat: add hover config for showing container bounds
2024-06-11 21:02:13 +08:00
roife
e5f859868e
feat: show type bounds from containers for functions
2024-06-11 21:02:13 +08:00
roife
80a2ac5681
internal: simplify and refactor write_where_clause
2024-06-11 21:02:13 +08:00
randomicon00
25004a1018
edit: change 'Length' to 'Len'
2024-06-11 08:49:30 -04:00
dependabot[bot]
5e3bf0a8a9
Chore(deps-dev): Bump braces from 3.0.2 to 3.0.3 in /editors/code
...
Bumps [braces](https://github.com/micromatch/braces ) from 3.0.2 to 3.0.3.
- [Changelog](https://github.com/micromatch/braces/blob/master/CHANGELOG.md )
- [Commits](https://github.com/micromatch/braces/compare/3.0.2...3.0.3 )
---
updated-dependencies:
- dependency-name: braces
dependency-type: indirect
...
Signed-off-by: dependabot[bot] <support@github.com>
2024-06-11 09:01:41 +00:00
bors
d181bfdb0b
Auto merge of #17374 - Veykril:configs, r=Veykril
...
Allow choosing logical cores for num threads config
2024-06-11 08:49:19 +00:00
Lukas Wirth
34d273b5be
Simplify some config serialization stuff
2024-06-11 10:45:17 +02:00
bors
704b56b5bb
Auto merge of #17377 - Young-Flash:hir_print, r=Veykril
...
internal: better print style for hir
before:

after:

2024-06-11 08:05:40 +00:00
bors
c995190044
Auto merge of #17381 - roife:fix-issue-17378, r=Veykril
...
fix: ensure that the parent of a SourceRoot cannot be itself
fix #17378 .
In `FileSetConfig.map`, different roots might be mapped to the same `root_id` due to deduplication in `ProjectFolders::new`:
```rust
// Example from rustup
/Users/roife/code/rustup/target/debug/build/rustup-863a063426b56c51/out
/Users/roife/code/rustup
```
In `source_root_parent_map`, r-a might encounter paths where their SourceRootId (i.e. `root_id`) is identical, yet one the them is the parent of the another. This situation can cause the `root_id` to be its own parent, potentially leading to an infinite loop.
This PR resolves such cases by adding a check.
2024-06-10 17:43:06 +00:00
roife
5aa6137470
fix: ensure that the parent of a SourceRoot cannot be itself
2024-06-10 23:15:26 +08:00
Lukas Wirth
ac9cdbbfa6
Remove extra parse cache from Semantics again
2024-06-10 12:04:35 +02:00
Lukas Wirth
0a57742600
Thread more HasSource::source calls through Semantics for caching
2024-06-10 10:33:07 +02:00
bors
0ef2213ed8
Auto merge of #17372 - Veykril:parallel-diagnostics, r=Veykril
...
feat: Compute native diagnostics in parallel
2024-06-10 07:34:36 +00:00
Lukas Wirth
a65c912663
Don't intern attribute inputs as their spans make them unique
2024-06-09 21:21:33 +02:00
Young-Flash
b45cf63f06
minor: use push_str instead
2024-06-09 22:31:55 +08:00
Young-Flash
6e08590436
internal: tweak test case
2024-06-09 20:55:40 +08:00
Lukas Wirth
a800a1d86a
Fix divide by zero
2024-06-09 13:03:01 +02:00