Initial LiveShare extension scaffolding (#7170)

* LiveShare initial shared connection

* Various cleanups

* Fix type

* Fix hygiene
This commit is contained in:
Karl Burtram
2019-09-11 15:24:08 -07:00
committed by GitHub
parent 9765b0ed8e
commit 9df66deb81
33 changed files with 3126 additions and 36 deletions

View File

@@ -472,12 +472,14 @@ export class ToggleConnectDatabaseAction extends QueryTaskbarAction {
}
public run(): Promise<void> {
if (this.connected) {
// Call disconnectEditor regardless of the connection state and let the ConnectionManagementService
// determine if we need to disconnect, cancel an in-progress connection, or do nothing
this.connectionManagementService.disconnectEditor(this.editor.input);
} else {
this.connectEditor(this.editor);
if (!this.editor.input.isSharedSession) {
if (this.connected) {
// Call disconnectEditor regardless of the connection state and let the ConnectionManagementService
// determine if we need to disconnect, cancel an in-progress connection, or do nothing
this.connectionManagementService.disconnectEditor(this.editor.input);
} else {
this.connectEditor(this.editor);
}
}
return Promise.resolve(null);
}

View File

@@ -355,4 +355,8 @@ export class QueryInput extends EditorInput implements IEncodingSupport, IConnec
public get tabColor(): string {
return this._connectionManagementService.getTabColorForUri(this.uri);
}
public get isSharedSession(): boolean {
return this.uri && this.uri.startsWith('vsls:');
}
}