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

Trigger chat variable completion on word start #224174

Merged

Conversation

bsShoham
Copy link
Contributor

closes #216757

Added optional boolean parameter to computeCompletionRanges called onlyOnWordStart, which dictates to return the range only if the found varWord is at word start.
Set it as true on chat input variable completion (#)

Copy link
Member

@roblourens roblourens left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for the PR! With this, if I have the cursor at the end or in the middle of a partial word, like #sele| or #s|ele where | marks the cursor, then I don't get completions. I think it should be checking for a word before #, not before the point where completions are requested.

@bsShoham
Copy link
Contributor Author

@roblourens Right you are, changed it to use matched word start column

@roblourens
Copy link
Member

With this change, if I just type c# I still get the suggest widget popup

@bsShoham bsShoham force-pushed the dev/allow-completion-only-on-word-start branch from 14f8d5b to afd2186 Compare August 1, 2024 08:14
@bsShoham
Copy link
Contributor Author

bsShoham commented Aug 1, 2024

fell for the classic off by 1 error, fixed and tested

Copy link
Member

@roblourens roblourens left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good to me now, thanks!

@roblourens roblourens added this to the August 2024 milestone Aug 1, 2024
@roblourens roblourens enabled auto-merge (squash) August 1, 2024 18:36
@roblourens roblourens merged commit deecca1 into microsoft:main Aug 1, 2024
6 checks passed
BABA983 pushed a commit to BABA983/vscode that referenced this pull request Aug 2, 2024
* And to `computeCompletionRanges` support for allowing completions only on word start

* use word start column instead of cursor position

* Fix wrong column number
@bsShoham bsShoham deleted the dev/allow-completion-only-on-word-start branch August 4, 2024 07:10
@vs-code-engineering vs-code-engineering bot locked and limited conversation to collaborators Sep 15, 2024
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Typing c# triggers variable suggestions in chat
3 participants