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

Support downloading of additional resources when installing an extension #53855

Closed
sandy081 opened this issue Jul 9, 2018 · 4 comments
Closed
Assignees
Labels
extensions Issues concerning extensions feature-request Request for new features or functionality

Comments

@sandy081
Copy link
Member

sandy081 commented Jul 9, 2018

Support downloading of additional resources when installing an extension

@sandy081 sandy081 added feature-request Request for new features or functionality extensions Issues concerning extensions labels Jul 9, 2018
@sandy081 sandy081 added this to the July 2018 milestone Jul 9, 2018
@sandy081 sandy081 self-assigned this Jul 9, 2018
@sandy081 sandy081 modified the milestones: July 2018, Backlog Jul 26, 2018
@jasongin
Copy link
Member

jasongin commented Aug 2, 2018

We'd need to be able to filter applicability of resources based on:

  • OS
  • CPU architecture of VS Code (x86/x64)
  • Version of VS Code
  • Electron version of VS Code, for selecting prebuilt node native modules (or the VS Code version could be used as a proxy for the electron version)

@kieferrm
Copy link
Member

kieferrm commented Aug 3, 2018

@jasongin It might be better to leave the construction of an URL up to the extension. You get access to this information today:

import * as os from 'os';
import * as vscode from 'vscode';
const e2c = require('electron-to-chromium');

export function activate(context: vscode.ExtensionContext) {

    const { version } = require(context.asAbsolutePath('./package.json')) as { version: string };
    const platformVersion = (os.release() || '').replace(/^(\d+)(\.\d+)?(\.\d+)?(.*)/, '$1$2$3');
    const chromiumVersion = process.versions.v8.replace(/^(\d+)\.(\d+)\.(.*)/, '$1$2');
    const electronVersion = e2c.chromiumToElectron(chromiumVersion);

    let exeContext = {
        extensionVersion: version,
        vscodeVersion: vscode.version,
        platform: process.platform,
        platformVersion,
        platformArch: process.arch,
        electronVersion
    }
...
}

@jasongin
Copy link
Member

jasongin commented Aug 3, 2018

My comment above was assuming a declarative approach, such as an extension declaring additional external dependencies in its package.json.

If there is an API / command to do ad-hoc downloads then obviously that's more flexible so extensions can use any arbitrary logic to determine what to download and when. But for the specific case of downloading dependencies needed at extension startup, it's a little more work for extension developers, and maybe not as good user experience, since the extension has to indicate the download is in progress and the extension is not functional until that finishes.

@sandy081
Copy link
Member Author

Closing in favour of #59112

@sandy081 sandy081 removed this from the Backlog milestone Sep 24, 2018
@vscodebot vscodebot bot locked and limited conversation to collaborators Nov 8, 2018
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
extensions Issues concerning extensions feature-request Request for new features or functionality
Projects
None yet
Development

No branches or pull requests

3 participants