How to use the vsls.Role.Host 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 eamodio / vscode-gitlens / src / vsls / vsls.ts View on Github external
private async onLiveShareSessionChanged(api: LiveShare, e: SessionChangeEvent) {
		if (this._host !== undefined) {
			this._host.dispose();
		}

		if (this._guest !== undefined) {
			this._guest.dispose();
		}

		switch (e.session.role) {
			case Role.Host:
				this.setReadonly(false);
				setCommandContext(CommandContext.Vsls, 'host');
				if (Container.config.liveshare.allowGuestAccess) {
					this._host = await VslsHostService.share(api);
				}
				break;
			case Role.Guest:
				this.setReadonly(true);
				setCommandContext(CommandContext.Vsls, 'guest');
				this._guest = await VslsGuestService.connect(api);
				break;

			default:
				this.setReadonly(false);
				setCommandContext(CommandContext.Vsls, true);
				break;

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