mirror of
https://github.com/ckaczor/azuredatastudio.git
synced 2026-02-16 10:58:30 -05:00
Initial LiveShare extension scaffolding (#7170)
* LiveShare initial shared connection * Various cleanups * Fix type * Fix hygiene
This commit is contained in:
@@ -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);
|
||||
}
|
||||
|
||||
@@ -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:');
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user