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

Use node debugger as a plugin #3902

Merged
merged 1 commit into from
Jan 6, 2019
Merged

Use node debugger as a plugin #3902

merged 1 commit into from
Jan 6, 2019

Conversation

tolusha
Copy link
Contributor

@tolusha tolusha commented Dec 27, 2018

Signed-off-by: Anatoliy Bazko abazko@redhat.com

Reference issue

#3766

What does this PR do

  1. Removes extension for node debugger
  2. Fixed registration debuggers contribution. It is possible to use vscode node extensions to debug applications

@tolusha tolusha added plug-in system issues related to the plug-in system debug issues that related to debug functionality Team: Che-Languages issues regarding the che-languages team labels Dec 27, 2018
@tolusha tolusha self-assigned this Dec 27, 2018
@akosyakov
Copy link
Member

The depreciation should happen only when the plugin system is complete and tested. This PR should not have any code changes to debug-nodejs extension.

if (providers) {
for (const provider of providers) {
if (provider.resolveDebugConfiguration) {
resolved = await provider.resolveDebugConfiguration(this.toWorkspaceFolder(workspaceFolderUri), debugConfiguration) || resolved;
Copy link
Member

@akosyakov akosyakov Jan 2, 2019

Choose a reason for hiding this comment

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

Should not resolved be passed instead of debugConfiguration that next provider enhance a configuration from the previous provider?

Also, VS Code APIs are not very good at nullability, resolveDebugConfiguration can return null and undefined in practice meaning that resolution failed. In this case iterating does not make sense and we should exit without checking other providers.

From docs for resolveDebugConfiguration: The resolved debug configuration or undefined or null.

contributionId: string,
debugConfiguration: theia.DebugConfiguration,
folder: string | undefined): Promise<theia.DebugConfiguration | undefined> {
async $resolveDebugConfigurations(debugConfiguration: theia.DebugConfiguration, workspaceFolderUri: string | undefined): Promise<theia.DebugConfiguration | undefined> {
Copy link
Member

@akosyakov akosyakov Jan 2, 2019

Choose a reason for hiding this comment

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

@tolusha Do i understand correctly that this code is executed in Theia server worker? I wonder why we don't inject DebugService and call provideDebugConfigurations/resolveDebugConfiguration but reimplementing it here again?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

This code is executed in a dedicated plugin container and DebugService is bind in Theia container.

@akosyakov
Copy link
Member

akosyakov commented Jan 2, 2019

Great work. I've removed nodejs extension from the browser app and deployed node and node2 vscode extensions via the plugin system. It works well and localization now is in place, very cool!

@akosyakov
Copy link
Member

akosyakov commented Jan 2, 2019

Looking closely, removing debug-nodejs from package.json for the browser app does not remove it from the application. The plugin system depends on debug-nodejs. @tolusha Could this dependency be removed?

Update
I've tried to remove it and everything still works. please remove this dependecy

Signed-off-by: Anatoliy Bazko <abazko@redhat.com>
@tolusha
Copy link
Contributor Author

tolusha commented Jan 4, 2019

@akosyakov it is ready to review again

@tsmaeder tsmaeder mentioned this pull request Jan 4, 2019
2 tasks
Copy link
Member

@akosyakov akosyakov left a comment

Choose a reason for hiding this comment

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

@tolusha thanks, looks good

@tolusha tolusha merged commit f69caeb into master Jan 6, 2019
@marcdumais-work marcdumais-work deleted the ab/plugin-nodejs-debug branch January 25, 2019 19:49
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
debug issues that related to debug functionality plug-in system issues related to the plug-in system Team: Che-Languages issues regarding the che-languages team
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants