-
Notifications
You must be signed in to change notification settings - Fork 42
(GH-100) Add debug adapter #150
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
Conversation
aa7a4e4 to
717a79a
Compare
717a79a to
5d06379
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think we can merge this as experimental, with a doc update in server/README.md and with the commits cleaned up
3e021c2 to
35c0062
Compare
In order to add a Debug Server, parts of the Language Server need to be extacted into a common namespace so they can be shared between them; Mainly the logging, TCP Server, and version detection. This commit: - Moves the TCP Server, logging and version detection from PuppetLanguageServer to PuppetVSCode namespace. - All relevant calls in the language server were modified for the new names - Updated the spec tests for the new names
1e1a6ee to
6237ea3
Compare
|
Nearly done. Need to cleanup one commit. |
This commit adds the code necessary to start a Puppet debug session which is compliant with VS Code's debug adapter protocol. Instead this is over TCP instead of STDIN/OUT. This commit also updates the gulpfile so that this code is added during the extension packaging process.
In order to support common code between the Extension and an out-of-process debug adapter, the logging facility was moved to an interface and a series of concrete implementations. The Debug Adapter is not able to import the vscode namespace as it does not exist inside the editor. This commit; - Creates a ILogger interface which is passed between objects instead of the concrete implementation of Logger - Changes the current Logger object to be an OutputChannel Logger - Add a file, null and stdout logging implementation which cna be used by the Debug Adapter or during debugging the extenion itself - Update all of the references to Logger to ILogger in the extension
The Debug Adapter requires similar object and configuration options from the extension. This commit refactors out the simple interfaces (i.e. cannot include complex types, particularly from the vscode namespace) so that it can be consumed by an out-of-process DebugAdapter.
The Debug Adapter needs to share the ruby detection code with the Extensions proper however it imported the vscode namespace which is not available out-of- process. This commit extracts the ruby environment detection method to a separate class which can be consumed by the extension or Debug Adapter.
This commit adds a DebugAdapter typescript file, which starts the a puppet debug server via ruby and then proxies the stdin/stdout commands to the debug server over TCP. This commit also configures the debug facility in the appropriate sections in package.json. Note that this feature is experimental.
This commit adds documentation about the new experimental feature in the extension readme.
Previously the Simple TCP server would not exit when a SIGHUP (Ctrl-C) signal was sent. This commit changes the stop_services handler so that it is aware when it is invoked from a TRAP as some operations are not allowed in the TRAP context. This commit also updates the trap handlers to use the correct method name.
6237ea3 to
ab7c89f
Compare
|
@jpogran Ok, I think this is all done. Still missing tests on the debug server, and there are some rubocop violations in the new code. |
This PR adds support for an experimental feature - debugging puppet compilation. This solves #100
Note - This PR builds on #186