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

Language services should be able to provide debug console IntelliSense #30065

Open
gregg-miskelly opened this issue Jul 3, 2017 · 3 comments
Assignees
Labels
debug Debug viewlet, configurations, breakpoints, adapter issues feature-request Request for new features or functionality
Milestone

Comments

@gregg-miskelly
Copy link
Member

Scenario

Currently, debug adapters can provide IntelliSense in the console. This is great for untyped or weakly typed languages like JavaScript/TypeScript. But for statically typed languages, such as C#, the best way to do this is to let the regular language service provide IntelliSense just like in the editor.

Basic proposal

In the language service registration for an extension, a language service can indicate that it supports debug console IntelliSense. If the language of the document of the current stack frame opts into this, then instead of going down the path where completion is requested from debug adapter, it is instead requested from the language service. VS Code would need to provide the location of the active stack frame in the same way that regular intellisense works. Then it would need to provide the text and position of the line being edited in the debug console.

Assuming that VS Code is eventually interested in supporting this, dotnet/vscode-csharp#1609 tracks the work in the C# extension to support this.

@vscodebot vscodebot bot added the debug Debug viewlet, configurations, breakpoints, adapter issues label Jul 3, 2017
@weinand weinand added the feature-request Request for new features or functionality label Jul 3, 2017
@weinand
Copy link
Contributor

weinand commented Jul 3, 2017

@gregg-miskelly That makes a lot of sense.

However, VS Code passes already the frame/line information to the completion proposal request. That means that the DA could use this info and contact the language service for the static proposals directly. In addition it could add dynamic proposals that are not available from the language service because they require runtime introspection.

This approach is considered for the Java debugger. In fact they are folding the DA into the language server and configure the VS Code debugger so that is does not launch a DA per session, but just connects to the DA.

@gregg-miskelly
Copy link
Member Author

@weinand In our case we don't want to tie our DA and language server that closely together as our backend is IDE-neutral but the front end of the language service is not. So we don't want to make the two thing same thing. We could certainly have the language service launch the debugger using the facilities recently added. Though I am a little worried about adding another process hop to performance critical code paths like launch. What about adding some sort reverse request (like RunInTerminalRequest) that would let us establish a communications channel to the language service after the fact and let them handle it. Something like "SendMessageToLanguageService" which would let us send arbitrary JSON to the language service?

CC @DustinCampbell

@weinand weinand added this to the Backlog milestone Oct 14, 2019
@praveennadarajah
Copy link

@weinand
Currently, Ballerina is planning to provide IntelliSense(auto-completion) support in debug console. Ballerina is a statically typed and structural language.

We believe the suggested approach here would work for us. Is there any plans to complete this feature request in the near future?

ballerina-platform/ballerina-lang#31571 was created to track the progress.

@weinand weinand removed their assignment Oct 27, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
debug Debug viewlet, configurations, breakpoints, adapter issues feature-request Request for new features or functionality
Projects
None yet
Development

No branches or pull requests

5 participants