How to use the vsls/vscode.getApi function in vsls

To help you get started, we’ve selected a few vsls examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github auchenberg / vscode-browser-preview / ext-src / liveShare.ts View on Github external
export async function setupLiveShare(windowManager: BrowserViewWindowManager) {
  const liveShare = await vsls.getApi();
  if (!liveShare) {
    // The user doesn't have the Live Share
    // extension installed, so there's nothing
    // further to initialize.
    return;
  }

  await sessionStarted(liveShare);
  setupServices(liveShare, windowManager);
}
github swdotcom / swdc-vscode / extension.ts View on Github external
async function initializeLiveshare() {
    const liveshare = await vsls.getApi();
    if (liveshare) {
        // {access: number, id: string, peerNumber: number, role: number, user: json}
        logIt(`liveshare version - ${liveshare["apiVersion"]}`);
        liveshare.onDidChangeSession(async event => {
            let nowSec = nowInSecs();
            let offsetSec = getOffsetSecends();
            let localNow = nowSec - offsetSec;
            if (!_ls) {
                _ls = {
                    ...event.session
                };
                _ls["apiVesion"] = liveshare["apiVersion"];
                _ls["start"] = nowSec;
                _ls["local_start"] = localNow;
                _ls["end"] = 0;
github DonJayamanne / pythonVSCode / src / client / common / liveshare / liveshare.ts View on Github external
private onSettingsChanged() {
        const supported = this.configService.getSettings().datascience.allowLiveShare;
        if (supported !== this.supported) {
            this.supported = supported ? true : false;
            const liveShareTimeout = this.configService.getSettings().datascience.liveShareConnectionTimeout;
            this.apiPromise = supported ?
                vsls.getApi().then(a => a ? new LiveShareProxy(this.appShell, liveShareTimeout, a) : a) :
                Promise.resolve(null);

        } else if (!this.apiPromise) {
            this.apiPromise = Promise.resolve(null);
        }
    }
}

vsls

Enables VS Code extensions to access Live Share capabilities.

CC-BY-4.0
Latest version published 3 years ago

Package Health Score

63 / 100
Full package analysis