Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Rust: jump to definition (Command click) should not enclose the target with a text selection #11347

Closed
1 task done
kud1ing opened this issue May 3, 2024 · 2 comments · Fixed by #11691
Closed
1 task done
Labels
defect [core label] editor Feedback for code editing, formatting, editor iterations, etc language An umbrella label for all programming languages syntax behaviors rust Rust programming language support

Comments

@kud1ing
Copy link

kud1ing commented May 3, 2024

Check for existing issues

  • Completed

Describe the bug / provide steps to reproduce it

If you jump to the definition of a function or module etc. using Command click, the target is not only jumped to but also enclosed in a text selection. For functions this is not that bothering, but if you jump to a module the whole module code is selected.

I think just jumping to functions, modules etc. should be sufficient and the targets should not be selected. At least i do not see at the moment why someone would need the text selection - for copying, or deletion?

IntelliJ's (now discontinued) Rust plugin also handled this by just jumping to the target without selecting it.

Environment

Zed: v0.133.7 (Zed)
OS: macOS 14.4.1
Memory: 32 GiB
Architecture: aarch64

If applicable, add mockups / screenshots to help explain present your vision of the feature

This shows the result of jumping to the glob module. The whole module is selected.

Bildschirmfoto 2024-05-03 um 13 57 19

If applicable, attach your ~/Library/Logs/Zed/Zed.log file to this issue.

No response

@kud1ing kud1ing added admin read Pending admin review defect [core label] triage Maintainer needs to classify the issue labels May 3, 2024
@kud1ing kud1ing changed the title Rust: jump to definition (Command Click) should not add mark the target with a text selection Rust: jump to definition (Command Click) should not mark the target with a text selection May 3, 2024
@kud1ing kud1ing changed the title Rust: jump to definition (Command Click) should not mark the target with a text selection Rust: jump to definition (Command Click) should not enclose the target within a text selection May 3, 2024
@kud1ing kud1ing changed the title Rust: jump to definition (Command Click) should not enclose the target within a text selection Rust: jump to definition (Command click) should not enclose the target within a text selection May 3, 2024
@kud1ing kud1ing changed the title Rust: jump to definition (Command click) should not enclose the target within a text selection Rust: jump to definition (Command click) should not enclose the target with a text selection May 3, 2024
@JosephTLyons JosephTLyons added editor Feedback for code editing, formatting, editor iterations, etc rust Rust programming language support language An umbrella label for all programming languages syntax behaviors and removed triage Maintainer needs to classify the issue admin read Pending admin review labels May 3, 2024
@Congyuwang
Copy link
Contributor

VSCode behavior:

2024-05-11.23.21.34.mov

The definition is not selected, but is actually kind of "highlighted" for a short while.

Also, when the definition is already in view, VSCode won't scroll, which is certainly visually clearer (compared to Zed's current behavior), but that would be another issue.

ConradIrwin pushed a commit that referenced this issue May 15, 2024
Release Notes:

-Fixed #11347 , do not select target range going to definition. Just
place the cursor at the start of target range.
@kud1ing
Copy link
Author

kud1ing commented May 15, 2024

Thank you.

osiewicz pushed a commit to RemcoSmitsDev/zed that referenced this issue May 18, 2024
Release Notes:

-Fixed zed-industries#11347 , do not select target range going to definition. Just
place the cursor at the start of target range.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
defect [core label] editor Feedback for code editing, formatting, editor iterations, etc language An umbrella label for all programming languages syntax behaviors rust Rust programming language support
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants