Visual studio code 如何在vscode和Azure Data Studio中扩展窗口重用代码路径?

Visual studio code 如何在vscode和Azure Data Studio中扩展窗口重用代码路径?,visual-studio-code,azure-data-studio,Visual Studio Code,Azure Data Studio,我在microsoft/azuredatastudio github repo中工作,它主要是由vscode派生的。我试图扩展我们的命令行处理来处理窗口重用参数,这样,如果我们将服务器连接与-r一起传递,我们将打开指定的连接。我们当前的命令行处理服务由workbench.initServices中的src\vs\workbench\electron browser\workbench.ts加载 是否有任何平台提供的服务对electron main和workbench\electron浏览器都是可

我在microsoft/azuredatastudio github repo中工作,它主要是由vscode派生的。我试图扩展我们的命令行处理来处理窗口重用参数,这样,如果我们将服务器连接与-r一起传递,我们将打开指定的连接。我们当前的命令行处理服务由workbench.initServices中的src\vs\workbench\electron browser\workbench.ts加载

是否有任何平台提供的服务对electron main和workbench\electron浏览器都是可见的,我可以修改或利用这些服务来通知应用程序正在使用新的命令行参数重新使用

我发现在src\vs\code\electron main\launch.ts中定义的LaunchService似乎负责捕获参数和打开或重用窗口,但不清楚如何将LaunchService的通知封送到workbench加载的服务

2019年2月12日更新: 看起来我需要在src\vs\code\electron main\windows.ts中添加此函数的等效项

    private doOpenFilesInExistingWindow(configuration: IOpenConfiguration, window: ICodeWindow, filesToOpen: IPath[], filesToCreate: IPath[], filesToDiff: IPath[], filesToWait: IPathsToWaitFor): ICodeWindow {
    window.focus(); // make sure window has focus

    window.ready().then(readyWindow => {
        const termProgram = configuration.userEnv ? configuration.userEnv['TERM_PROGRAM'] : void 0;
        readyWindow.send('vscode:openFiles', { filesToOpen, filesToCreate, filesToDiff, filesToWait, termProgram });
    });

    return window;
}

其中有一条新消息,如“ads:openconnection”。现在了解如何处理该消息

我最终使用了ipc渲染器服务,并在main中向启动服务添加了一个ipc调用

    // {{SQL CARBON EDIT}}
    // give the first used window a chance to process the other command line arguments
    if (args['reuse-window'] && usedWindows.length > 0 && usedWindows[0])
    {
        let window = usedWindows[0];
        usedWindows[0].ready().then(() => window.send('ads:processCommandLine', args));
    }
    // {{SQL CARBON EDIT}}

我最终使用了ipcRenderer服务,并在main中向启动服务添加了一个ipc调用

    // {{SQL CARBON EDIT}}
    // give the first used window a chance to process the other command line arguments
    if (args['reuse-window'] && usedWindows.length > 0 && usedWindows[0])
    {
        let window = usedWindows[0];
        usedWindows[0].ready().then(() => window.send('ads:processCommandLine', args));
    }
    // {{SQL CARBON EDIT}}