| Age | Commit message (Collapse) | Author | Lines |
|
Add `f16` and `f128` support
Adds `f16` and `f128` support, using the `rustc_apfloat` library (also used by `rustc`) for parsing/arithmetic/displaying since the types aren't stable yet so can't be used by rust-analyzer itself.
Issue: #17451
|
|
feat: add inlay hints for generic parameters
fixes #11091
By default, only hints for const generic parameters are shown, and this can be configured through `rust-analyzer.inlayHints.genericParameterHints.enable`.
Probably needs more testing.
|
|
|
|
|
|
fix: Fix double rounding of `f32` literals
Fixes #17556 by delaying parsing until the type is known. Also adds a test to check the issue is fixed.
|
|
Remove version check before using `--keep-going`
See https://github.com/rust-lang/rust-analyzer/pull/17561#issuecomment-2214227971 by `@lnicola`
|
|
|
|
|
|
fixes #11091
By default, only hints for const generic parameters are shown.
|
|
Add --keep-going to the check command
Fixes https://github.com/rust-lang/rustlings/issues/1628
`@Veykril` I am not sure about what you meant with "unconditionally" in https://github.com/rust-lang/rustlings/issues/1628#issuecomment-2212492230, but I didn't find out how to get the version of the toolchain anyway to do a check like in [this snippet](https://github.com/rust-lang/rust-analyzer/blob/a5b21ea0aa644dffd7cf958b43f11f221d53404e/crates/project-model/src/build_scripts.rs#L125-L127). Is this check even required if rust-analyzer was installed with the toolchain?
`--keep-going` was [stabilized in 1.74](https://github.com/rust-lang/cargo/blob/master/CHANGELOG.md#cargo-174-2023-11-16)
|
|
|
|
internal: Inline generated syntax methods
|
|
|
|
|
|
Add an option to use "::" for the external crate prefix.
Fixes #11823 .
Hi I'm very new to rust-analyzer and not sure how the review process are. Can somebody take a look at this PR? thanks!
|
|
fix: Fix callHierarchy LSP violation
Fixes https://github.com/rust-lang/rust-analyzer/issues/14839
|
|
|
|
Move remaining codegen things to `xtask codegen`
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
fix: Fix parameter completions using macro expanded source ranges
Fixes https://github.com/rust-lang/rust-analyzer/issues/17550
|
|
|
|
internal: Move capability querying out of the config module
|
|
|
|
Also mark InferenceResult::has_errors flag when there are error types
Should work around https://github.com/rust-lang/rust-analyzer/issues/15090#issuecomment-2211647133
|
|
|
|
fix: Fix runnables being incorrectly constructed
I've misunderstood parts of the code here which caused runnables to arbitrarily break :) (I have yet to understand the conditions that made them break though, there is some odd caching involved I feel like ...)
Fixes https://github.com/rust-lang/rust-analyzer/issues/17402
|
|
|
|
fix: Fix passing `message-format` after -- in debugging
Fixes https://github.com/rust-lang/rust-analyzer/pull/17495#issuecomment-2211717224
|
|
|
|
internal: Clean up runnable lsp extension
This feels like a natural addition to me, and also allows us to drop the expect-test hardcoding from the extension. Additionally, `cargoExtraArgs` is pointless, all the client will do is merge it with `cargoArgs` so the server can do that instead of delegating that to the client.
|
|
|
|
|
|
|
|
feat: Add landing/faq walkthrough pages
This is a basic implementation of a landing and FAQ page; I've included the bare-bones information as well as a [recommended section on inlay hints](https://rust-lang.zulipchat.com/#narrow/stream/185405-t-compiler.2Frust-analyzer/topic/Landing.20Page/near/446135321).
I've also added `rust-analyzer: Open Walkthrough` and `rust-analyzer: Open FAQ` commands for ease of access.
I am hoping to create a small list of FAQ to include that might be useful as well as any other information I may have missed in the landing page. Feel free to share any suggestions!

cc #13351
|
|
internal: Diagnose unresolved self value in path expression
|
|
|
|
Disallow nested impl traits
Fixes #17498
The above issue is due to formatting self referencing, recursive bound like `Implemented(^0.0: TraitId(0)<[?0 := ^0.0]>)` on the codes like;
```rust
trait Foo<T> {}
trait Bar {}
fn test(foo: impl Foo<impl Bar>) { ... }
```
When lowering predicate `impl Foo<impl Bar>` in `trait_environment_query`, the outer `impl Foo<...>` is treated as predicates, so the first `TypeRef` that passes the following code is `impl Bar`;
https://github.com/rust-lang/rust-analyzer/blob/cae997e3380363a906588f14c7b4587f39cf09f5/crates/hir-ty/src/lower.rs#L376-L400
and thus the `idx` is `0` in the above context.
But the following code sets `self_ty` as the `BoundVar` with `idx = 0` because the target param id for predicate `impl Foo<...>` is `0` since `impl Foo` is the first generic-like parameter of `fn test`;
https://github.com/rust-lang/rust-analyzer/blob/cae997e3380363a906588f14c7b4587f39cf09f5/crates/hir-ty/src/lower.rs#L998-L1025
For the codes like;
```rust
trait Foo {
type Assoc;
}
trait Bar {}
fn test(foo: impl Foo<Assoc = impl Bar>) { ... }
```
similar recursive bound doesn't happen because the following codes ***"count the number of `impl Trait` things that appear before the target of our `bound`."***
https://github.com/rust-lang/rust-analyzer/blob/cae997e3380363a906588f14c7b4587f39cf09f5/crates/hir-ty/src/lower.rs#L1168-L1199
Instead of doing similar thing like nested `impl Foo<impl Bar>` thing, this PR lowers such nested impl traits into error types in the similar manner as the rustc does in the following lines (and of course, allows lowering and inferencing nested impl traits for the cases that rustc permits);
- https://github.com/rust-lang/rust/blob/e2cf31a6148725bde4ea48acf1e4fe72675257a2/compiler/rustc_ast_passes/src/ast_validation.rs#L802-L813
- https://github.com/rust-lang/rust/blob/7b21c18fe4de32a7d2faa468e6ef69abff013f85/compiler/rustc_ast_passes/src/ast_validation.rs#L1299-L1314
(Though rustc emits [E0666😈](https://doc.rust-lang.org/error_codes/E0666.html), I skipped diagnostics since gathering diagnostics in `hir-def` has no conventions so far 😅)
|
|
|
|
fix: Don't emit semantic diagnostics in files with a lot of syntax errors
These will only add to the noise when something very unexpected breaks or where parser recovery fails to kick in.
|