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

support new "selection" feature of debug completion items #90974

Closed
weinand opened this issue Feb 19, 2020 · 8 comments
Closed

support new "selection" feature of debug completion items #90974

weinand opened this issue Feb 19, 2020 · 8 comments
Assignees
Labels
debug Debug viewlet, configurations, breakpoints, adapter issues feature-request Request for new features or functionality on-release-notes Issue/pull request mentioned in release notes verification-needed Verification of issue is requested verified Verification succeeded
Milestone

Comments

@weinand
Copy link
Contributor

weinand commented Feb 19, 2020

We've added support in the DAP for controlling the selection after a completion item has been inserted. See microsoft/debug-adapter-protocol#87.

Now VS Code needs to implement the client side of this feature.

Implementation hint: controlling the selection in VS Code seems to be only possible by using the snippet support. So it might be necessary to convert the result from the DAP completion request into a snippet that uses variables to specify the selection.

@weinand weinand added feature-request Request for new features or functionality debug Debug viewlet, configurations, breakpoints, adapter issues labels Feb 19, 2020
@weinand weinand added this to the February 2020 milestone Feb 19, 2020
@isidorn
Copy link
Contributor

isidorn commented Feb 19, 2020

I do not think there will be time for this this milestone.
So highly likely we push this out of February.

PR to fix this is welcome
Code pointer https://github.com/microsoft/vscode/blob/66b5e9837d4c6091531f3e32c6e25c0709542aa4/src/vs/workbench/contrib/debug/browser/repl.ts#L134

@isidorn
Copy link
Contributor

isidorn commented Mar 25, 2020

I have pushed a change that when the selection is specified by the debug adapter that we convert the completion item to a snippet and that the selection is respected on snippet accept.
@weinand it would be great if Mock Debug was implementing this so we could try it out in practice. For now adding verification needed label.

Also fyi @connor4312

@isidorn isidorn added the verification-needed Verification of issue is requested label Mar 25, 2020
@weinand
Copy link
Contributor Author

weinand commented Mar 25, 2020

@isidorn I'll add code to Mock debug to exercise the completion request.

@weinand
Copy link
Contributor Author

weinand commented Mar 25, 2020

@isidorn I've added two new completions items to Mock Debug:
in "array[]" the cursor is moved between the brackets and in "func(arg)" the "arg" is selected.

It seems that you are ignoring the selection if the attribute "selectionStart" is set but "selectionLength" is missing (as done in the "array[]" case).
The spec says that "selectionLength" should be assumed to be "0" in that case.

@isidorn
Copy link
Contributor

isidorn commented Mar 25, 2020

Oh, so that means just place the cursor. Got it. Yeah I can do the change.

@connor4312
Copy link
Member

I have a change ready to go for this in js-debug as well once the next insiders is released

isidorn added a commit that referenced this issue Mar 25, 2020
@isidorn
Copy link
Contributor

isidorn commented Mar 25, 2020

@weinand pushed a change to cover that case and infer that selectionLength is 0 in that case.
@connor4312 great!

@weinand
Copy link
Contributor Author

weinand commented Mar 25, 2020

@isidorn this works fine now, thanks!

@connor4312 connor4312 added verified Verification succeeded and removed verification-needed Verification of issue is requested labels Mar 27, 2020
@isidorn isidorn added verification-needed Verification of issue is requested on-release-notes Issue/pull request mentioned in release notes labels Mar 31, 2020
@github-actions github-actions bot locked and limited conversation to collaborators May 9, 2020
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
debug Debug viewlet, configurations, breakpoints, adapter issues feature-request Request for new features or functionality on-release-notes Issue/pull request mentioned in release notes verification-needed Verification of issue is requested verified Verification succeeded
Projects
None yet
Development

No branches or pull requests

3 participants