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

InlineCompletions API bracket completion - range is not updated when brackets are added/removed #156312

Closed
juihanamshet1 opened this issue Jul 26, 2022 · 7 comments · Fixed by #156313
Assignees
Labels
bug Issue identified by VS Code Team member as probable bug inline-completions verified Verification succeeded

Comments

@juihanamshet1
Copy link
Member

Does this issue occur when all extensions are disabled?: Yes/No

  • VS Code Version: 1.69
  • OS Version: Windows_NT x64 10.0.22000

Steps to Reproduce:

When the completion contains incomplete bracketPairs, the VS Code API corrects them, but the range is not updated so the tabbing behavior doesn't work as expected. Additionally, the grey text shown is also not shown accurately.

Example 1:
The code context is
React.useEffect(() => {
fetch("/api")
.then((res) => res.json())
})

itgone
In this GIF, the insertText provided is res.json()). When the completion is accepted using Tab, the () don't get accepted.

If the code on the line is .then((res) => res.|), the insertText is res.json()) and the cursor is marked by |, then the completion shows up as
image

Example 2:
A simpler case is when code on the line is React.useE, the completion shown is React.useEffect(() => {}). When the user hits Tab to accept, their cursor is taken between {}. If the insertText is { at this point, it will be closed by the API. But the range is not updated to match the already existing } and so it shows up as grey text.
image

cc @hediet

@vscodenpa
Copy link

Thanks for creating this issue! It looks like you may be using an old version of VS Code, the latest stable release is 1.69.2. Please try upgrading to the latest version and checking whether this issue remains.

Happy Coding!

@hediet hediet self-assigned this Jul 26, 2022
@hediet hediet added bug Issue identified by VS Code Team member as probable bug inline-completions labels Jul 26, 2022
@hediet hediet added this to the August 2022 milestone Jul 26, 2022
@hediet
Copy link
Member

hediet commented Jul 26, 2022

Thanks for the issue and the PR! I'll get it in in the next release, as we already have feature-freeze and focus on fixing bugs in new features.

@vscodenpa vscodenpa added the unreleased Patch has not yet been released in VS Code Insiders label Jul 27, 2022
@isidorn
Copy link
Contributor

isidorn commented Jul 27, 2022

@hediet hmm should this be assigned to the July milestone since i see it is merged to main? And thus it will be part of the upcoming stable release in 10 days? Thanks

@hediet hediet modified the milestones: August 2022, July 2022 Jul 27, 2022
@vscodenpa vscodenpa added insiders-released Patch has been released in VS Code Insiders and removed unreleased Patch has not yet been released in VS Code Insiders labels Jul 28, 2022
@meganrogge meganrogge added verified Verification succeeded verification-found Issue verification failed and removed verified Verification succeeded labels Jul 28, 2022
@meganrogge
Copy link
Contributor

tab.mov

@meganrogge
Copy link
Contributor

The autocomplete text no longer has the parentheses, but the description does. Is it expected that they don't get completed @hediet ?

@rzhao271 rzhao271 reopened this Jul 29, 2022
@vscodenpa vscodenpa removed the insiders-released Patch has been released in VS Code Insiders label Jul 29, 2022
@bpasero bpasero modified the milestones: July 2022, August 2022 Jul 30, 2022
@hediet
Copy link
Member

hediet commented Aug 1, 2022

You have to try this with the intellicode extension. I suggest to get this validated by @juihanamshet1

@hediet hediet modified the milestones: August 2022, September 2022 Aug 23, 2022
@juihanamshet1
Copy link
Member Author

@meganrogge Were you able to repro the bug you found with the Intellicode-Completions extension installed? I cannot repro it on my end.

@meganrogge meganrogge added verified Verification succeeded and removed verification-found Issue verification failed labels Aug 31, 2022
@github-actions github-actions bot locked and limited conversation to collaborators Oct 15, 2022
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
bug Issue identified by VS Code Team member as probable bug inline-completions verified Verification succeeded
Projects
None yet
7 participants