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

When code completions with a single tab stop are inserted, it should be possible to disable the resulting template #718

Open
SCWells72 opened this issue Dec 23, 2024 · 2 comments

Comments

@SCWells72
Copy link
Contributor

SCWells72 commented Dec 23, 2024

Currently when resolved code completions with tab stops are inserted, the tab stops are added to an editor template. That works well and is likely what most would want when there are multiple tab stops, but when there's only one, the single tab stop actually gets in the way of a smooth typing experience because it has to be finished with Enter, Tab, or Esc, and doing so moves the caret to another location. That also causes those keys to have an ambiguous meaning when typing a value for the tab stop that triggers auto-completion.

For example, typing Tab in the following both inserts the currently selected completion and finishes the editor template, moving the caret out of the parentheses:

Image

That's not what's wanted if the user is accepting that completion as part of a larger expression for the current invocation argument, and then the user has to return the caret to the desired location. That's what I meant by "gets in the way of a smooth typing experience".

Minimally it should be possible to disable this editor template behavior when there's a single tab stop in the inserted completion. Instead any inserted default argument text should be pre-selected so that it's overwritten if/when the user begins typing. That would likely take the form of a completion client configuration option (see #705 for an existing PR with an existing completion client configuration option).

@SCWells72
Copy link
Contributor Author

@angelozerr, I'm happy to take this one.

@angelozerr
Copy link
Contributor

Thanks @SCWells72 and if you can add a test it would be very nice.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants