You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
This is not as easy. For one, str can resolve to eithercore::str or the builtin type str - and while we do have the ability in r-a to make it resolve to either (and in fact we resolve it correctly in analysis), here we will need to resolve it as both, and that (I imagine) will require some deep changes (although perhaps we can have some completion-specific hack).
See also #19088, although it is about resolving it after it's fully typed, which is easier.
Okay I am less concerned by str constructors as it seems they are going to be merged with the primitive type: rust-lang/rust#131114
However, I am more concerned with why the .ref macro doesn't consistently show up, in a field where usually Rust Analyzer knows a reference is suitable?
Desirable Behaviour (.ref not even needed as &stdout field shows)
Undesirable Behaviour 1: Rust Analyzer forgets &stdout is useful
Follow Up Attempt to invoke .ref macro:
The only difference is first one is direct, and the other is in a macro println! call.
The problem with ref is that output.stdout.ref is not a valid expression (due to ref being a keyword), therefore macro expansion fails, therefore we cannot provide completions. It does complete (down the list) when you type re (or refm, as you noticed yourself). This is something we can't fix easily, but we expect to fix once the switch to new Salsa is done and its DB forking feature is implemented.
The problem with & not auto-suggested inside a macro is a different issue - can you open a new issue for it?
rust-analyzer version:
rust-analyzer version: 0.3.2291-standalone (f3998f7f8a 2025-02-02)
rustc version:
rustc 1.84.1 (e71f9a9a9 2025-01-27)
editor or extension:
Vscode Rust Analyzer rust-lang.rust-analyzer
relevant settings: Regular Programming in a Simple Crate with
cargo init
code snippet to reproduce:
Expected output
Actual Output
Issue
Rust Analyzer refuses to look into
core::str
for methods even though this would be acceptable by the Rust compiler to use directly.Related Issue
Macros
ref
andrefm
are not visible when writing.ref
. It is kind of impossible to access.ref
The text was updated successfully, but these errors were encountered: