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

Allow to continue debug when extension host restarts #55025

Closed
chrmarti opened this issue Jul 25, 2018 · 10 comments

Comments

@chrmarti
Copy link
Contributor

commented Jul 25, 2018

Issue Type: Bug

Testing #54865

Using _workbench.enterWorkspace with extensions that are already disabled (or non-existing ones), such that it does not reload the window, shows the Extension host did not start in 10 seconds message.

VS Code version: Code - Insiders 1.26.0-insider (5fae91d, 2018-07-25T01:56:56.548Z)
OS version: Darwin x64 17.7.0

System Info
Item Value
CPUs Intel(R) Core(TM) i7-4770HQ CPU @ 2.20GHz (8 x 2200)
GPU Status 2d_canvas: enabled
checker_imaging: disabled_off
flash_3d: enabled
flash_stage3d: enabled
flash_stage3d_baseline: enabled
gpu_compositing: enabled
multiple_raster_threads: enabled_on
native_gpu_memory_buffers: enabled
rasterization: enabled
video_decode: enabled
video_encode: enabled
webgl: enabled
webgl2: enabled
Load (avg) 3, 3, 4
Memory (System) 16.00GB (0.46GB free)
Process Argv /Applications/Visual Studio Code - Insiders.app/Contents/MacOS/Electron
Screen Reader no
VM 22%
Extensions (20)
Extension Author (truncated) Version
regex chr 0.2.0
ssh chr 0.0.4
vscode-eslint dba 1.4.12
Spot der 0.4.0
ghlink dt 1.0.2
EditorConfig Edi 0.12.4
tslint eg2 1.0.34
rest-client hum 0.19.0
vscode-azureappservice ms- 0.9.0
vscode-azurefunctions ms- 0.10.0
vscode-cosmosdb ms- 0.8.0
azure-account ms- 0.4.2
azurecli ms- 0.4.2
github-issues-prs ms- 0.9.0
PowerShell ms- 1.8.1
debugger-for-chrome msj 4.8.2
vscode-docker Pet 0.0.27
vscode-versionlens pfl 0.21.1
vscode-open-in-github sys 1.7.0
azure-iot-toolkit vsc 1.1.0

@sandy081 sandy081 added this to the July 2018 milestone Jul 25, 2018

@sandy081

This comment has been minimized.

Copy link
Member

commented Jul 25, 2018

@chrmarti Can you please provide me your set up of extensions (installed, disabled) and the code you used to run this command?

@sandy081 sandy081 removed this from the July 2018 milestone Jul 25, 2018

@chrmarti

This comment has been minimized.

Copy link
Contributor Author

commented Jul 25, 2018

It reproduces without any extensions installed and also with just 'jerryhong.autofilename' installed but disabled:

export function activate(context: vscode.ExtensionContext) {

    let disposable = vscode.commands.registerCommand('extension.sayHello123', async () => {
        const sampleWorkspace = '/Users/chrmarti/Development/repos/test.code-workspace';
        vscode.commands.executeCommand('_workbench.enterWorkspace', vscode.Uri.file(`${sampleWorkspace}`), ['jerryhong.autofilename']);
    });

    context.subscriptions.push(disposable);
}

(Even when that workspace is already open, maybe that should be a noop.)

@sandy081 sandy081 added bug and removed needs more info labels Jul 25, 2018

@sandy081 sandy081 added this to the July 2018 milestone Jul 25, 2018

@sandy081

This comment has been minimized.

Copy link
Member

commented Jul 26, 2018

@chrmarti I guess you are doing this by launching extension host. When the extension host is being debugged, restarting the extension host by calling the method looks to me problematic. @alexandrudima @weinand Any insights on this?

@chrmarti Can you please try this by installing the extension that has this command and running the command?

@chrmarti

This comment has been minimized.

Copy link
Contributor Author

commented Jul 26, 2018

@sandy081 You're right, it only reproduces when running the extension in dev mode.

@sandy081 sandy081 removed this from the July 2018 milestone Jul 26, 2018

@alexandrudima

This comment has been minimized.

Copy link
Member

commented Jul 26, 2018

I'm sorry, I don't know about the _workbench.enterWorkspace command. The 10s message might be shown if the extension host is launched with --inspect-brk i.e. if it breaks on the first statement and if the debugger does not connect to it.

@sandy081

This comment has been minimized.

Copy link
Member

commented Jul 26, 2018

I think you can ignore _workbench.enterWorkspace command.

This happens when Extension host is launched by our Debugger (Extension development) and extension host is requested to restart during this session using above command.

@alexandrudima

This comment has been minimized.

Copy link
Member

commented Jul 30, 2018

I don't know, perhaps the command _workbench.enterWorkspace should let the debugger know that it is about to relaunch the extension host.

How else should the debugger know that it needs to connect to a new extension host process...

@bpasero

This comment has been minimized.

Copy link
Member

commented Aug 17, 2018

This should work fine now.

@bpasero bpasero closed this Aug 17, 2018

@weinand weinand reopened this Aug 21, 2018

@weinand

This comment has been minimized.

Copy link
Member

commented Aug 21, 2018

@isidorn this worked fine in stable (1.26.1) but is now broken in the latest Insider (which contains your Session refactoring)

@weinand weinand assigned isidorn and unassigned bpasero and sandy081 Aug 21, 2018

@weinand weinand added bug and removed feature-request labels Aug 21, 2018

@weinand weinand added this to the August 2018 milestone Aug 21, 2018

@weinand

This comment has been minimized.

Copy link
Member

commented Aug 21, 2018

I can easily reproduce this with a the Hello World extension and this activate function:

function activate(context) {
    let disposable = vscode.commands.registerCommand('extension.sayHello', function () {
        vscode.commands.executeCommand('_workbench.enterWorkspace', vscode.Uri.file('/Users/weinand/MS/Projects/Scenarios/test.code-workspace')).then(_ => {
            console.log("ok");
        }, e => {
            console.log("error: " + e);
        });
     });
    context.subscriptions.push(disposable);
}

@isidorn isidorn closed this in ac96d60 Aug 21, 2018

@chrmarti chrmarti added the verified label Aug 30, 2018

@vscodebot vscodebot bot locked and limited conversation to collaborators Oct 5, 2018

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
6 participants
You can’t perform that action at this time.