-
Notifications
You must be signed in to change notification settings - Fork 2.4k
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
Selecting an autocomplete item should not lose placeholder tabs #10185
Labels
autocompletions
Feedback for code completions in the editor
defect
[core label]
editor
Feedback for code editing, formatting, editor iterations, etc
Comments
It's definitely a Go thing. It works in Rust screenshot-2024-05-13-10.18.18.mp4 |
Okay, more information:
|
mrnugget
added a commit
that referenced
this issue
May 13, 2024
This fixes #10185 by not keeping snippet state around when already at the end of the snippet and the tabstop is empty (i.e. it's not a selection) and we're already on it. The reason for the fix is outlined in the comments of #10185 but to repeat: 1. `gopls` sends completions with type "snippet" even when suggesting single word completions that don't contain tabstops 2. We use a default behavior and add an "end tabstop" by default so that the cursor jumps to the end of the snippet when accepting it. 3. We'd then push the state of the snippet on the stack which is where it would stay, with the cursor already at the end and the user unable to get rid of the tabstop state. This fixes the issue by not pushing snippet state when the tabstop we accepted is the "end tabstop".
mrnugget
added a commit
that referenced
this issue
May 13, 2024
This fixes #10185 by not keeping snippet state around when already at the end of the snippet and the tabstop is empty (i.e. it's not a selection) and we're already on it. The reason for the fix is outlined in the comments of #10185 but to repeat: 1. `gopls` sends completions with type "snippet" even when suggesting single word completions that don't contain tabstops 2. We use a default behavior and add an "end tabstop" by default so that the cursor jumps to the end of the snippet when accepting it. 3. We'd then push the state of the snippet on the stack which is where it would stay, with the cursor already at the end and the user unable to get rid of the tabstop state. This fixes the issue by not pushing snippet state when the tabstop we accepted is the "end tabstop". Release Notes: - Fixed completions inside snippets breaking the jump-to-next-tabstop behaviour when using Go/`gopls` ([#10185](#10185)). Demo: https://github.com/zed-industries/zed/assets/1185253/35384e5e-45c6-46ab-870d-b48e56d8786b
osiewicz
pushed a commit
to RemcoSmitsDev/zed
that referenced
this issue
May 18, 2024
…s#11740) This fixes zed-industries#10185 by not keeping snippet state around when already at the end of the snippet and the tabstop is empty (i.e. it's not a selection) and we're already on it. The reason for the fix is outlined in the comments of zed-industries#10185 but to repeat: 1. `gopls` sends completions with type "snippet" even when suggesting single word completions that don't contain tabstops 2. We use a default behavior and add an "end tabstop" by default so that the cursor jumps to the end of the snippet when accepting it. 3. We'd then push the state of the snippet on the stack which is where it would stay, with the cursor already at the end and the user unable to get rid of the tabstop state. This fixes the issue by not pushing snippet state when the tabstop we accepted is the "end tabstop". Release Notes: - Fixed completions inside snippets breaking the jump-to-next-tabstop behaviour when using Go/`gopls` ([zed-industries#10185](zed-industries#10185)). Demo: https://github.com/zed-industries/zed/assets/1185253/35384e5e-45c6-46ab-870d-b48e56d8786b
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Labels
autocompletions
Feedback for code completions in the editor
defect
[core label]
editor
Feedback for code editing, formatting, editor iterations, etc
Check for existing issues
Describe the bug / provide steps to reproduce it
It's common to call a function and tab through its parameters because each param has its own tab-placeholder.
However, if we end up choosing an autocomplete item from the list within param1, we lose the ability to tab into param2.
See the below screen recording for demonstration.
Environment
Zed: v0.129.2 (Zed)
OS: macOS 14.3.0
Memory: 96 GiB
Architecture: aarch64
If applicable, add mockups / screenshots to help explain present your vision of the feature
Screen.Recording.2024-04-04.at.5.24.52.PM.mov
If applicable, attach your
~/Library/Logs/Zed/Zed.log
file to this issue.No response
The text was updated successfully, but these errors were encountered: