rust-lang / rust-lang/rust-analyzer
Only get 'extract to variable' not 'extract to function' in vscode
Nobody has claimed this yet.
- Dominant language
- Rust
- Stars
- 16.9k
- Forks
- 2.2k
- Avg merge
- 1d 12h
- Merged PRs (30d)
- 72
Description
Very similar to https://github.com/rust-lang/rust-analyzer/issues/11577, but happening in VSCode, and as far as I know the files are part of the project - certainly they are in git and in a regular cargo crate in a regular cargo workspace.
rust-analyzer version: rust-analyzer version: 0.3.1958-standalone
rustc version: rustc 1.78.0 (9b00956e5 2024-04-29)
editor or extension: VSCode v0.3.1958
relevant settings: nothing special
repository link (if public, optional): private sorry,
code snippet to reproduce: (copied from the troubleshooting guide into my program, then attempted the same extraction).
let n = 1;
let m = n + 2;
// calculate
let k = m + n;
let g = 3;
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start by reproducing the extraction actions in VSCode with the provided Rust snippet and compare the behavior with issue #11577. The report is resolved when the same code offers “extract to function” as well as “extract to variable”; the private repository and missing project files make broader reproduction necessary.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- rust, vscode
- Domain
- developer-experience, devtools
- Issue type
- Bug
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 28/100