Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 2 additions & 4 deletions src/codeConverter.ts
Original file line number Diff line number Diff line change
Expand Up @@ -37,10 +37,8 @@ function asScriptingParams(
type: metadata.metadataTypeName,
schema: metadata.schema,
name: metadata.name,
// cast to any since azdata needs to be updated to pickup this new field
// TODO: remove cast once updated azdata is published (8/24/2021 - karlb)
parentName: (<any>metadata).parentName,
parentTypeName: (<any>metadata).parentTypeName
parentName: metadata.parentName,
parentTypeName: metadata.parentTypeName
};
let targetDatabaseEngineEdition = paramDetails.targetDatabaseEngineEdition;
let targetDatabaseEngineType = paramDetails.targetDatabaseEngineType;
Expand Down
7 changes: 1 addition & 6 deletions src/main.ts
Original file line number Diff line number Diff line change
Expand Up @@ -289,12 +289,7 @@ export class ConnectionFeature extends SqlOpsFeature<undefined> {
};

let registerOnConnectionChanged = (handler: (changedConnInfo: azdata.ChangedConnectionInfo) => any): void => {
client.onNotification(protocol.ConnectionChangedNotification.type, (params: protocol.ConnectionChangedParams) => {
handler({
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is the only actual "change" in this PR - if for some reason the object we got passed had additional properties on it then we would now be passing those along to the provider. But this isn't how the rest of the handlers are set up anyways - and since this is coming from the server side we have control over that for MSSQL (and other providers shouldn't be sending additional data anyways).

connectionUri: params.ownerUri,
connection: params.connection
});
});
client.onNotification(protocol.ConnectionChangedNotification.type, handler);
};

azdata.dataprotocol.onDidChangeLanguageFlavor((params) => {
Expand Down
37 changes: 11 additions & 26 deletions src/protocol.ts
Original file line number Diff line number Diff line change
Expand Up @@ -123,31 +123,16 @@ export namespace ConnectionRequest {


export namespace ConnectionCompleteNotification {
export const type = new NotificationType<types.ConnectionCompleteParams, void>('connection/complete');
export const type = new NotificationType<azdata.ConnectionInfoSummary, void>('connection/complete');
}

// ------------------------------- < Connection Changed Event > -------------------------------------

/**
* Parameters for the ConnectionChanged notification.
*/
export class ConnectionChangedParams {
/**
* Owner URI of the connection that changed.
*/
public ownerUri: string;

/**
* Summary of details containing any connection changes.
*/
public connection: types.ConnectionSummary;
}

/**
* Connection changed event callback declaration.
*/
export namespace ConnectionChangedNotification {
export const type = new NotificationType<ConnectionChangedParams, void>('connection/connectionchanged');
export const type = new NotificationType<azdata.ChangedConnectionInfo, void>('connection/connectionchanged');
}

// ------------------------------- < Password Change for Connection Event > -------------------------------------
Expand Down Expand Up @@ -504,7 +489,7 @@ export namespace ScriptingRequest {
// ------------------------------- < Scripting Complete Event > ------------------------------------

export namespace ScriptingCompleteNotification {
export const type = new NotificationType<types.ScriptingCompleteParams, void>('scripting/scriptComplete');
export const type = new NotificationType<azdata.ScriptingCompleteResult, void>('scripting/scriptComplete');
}


Expand Down Expand Up @@ -586,38 +571,38 @@ export namespace EditSubsetRequest {
// ------------------------------- < Object Explorer Events > ------------------------------------

export namespace ObjectExplorerCreateSessionRequest {
export const type = new RequestType<azdata.ConnectionInfo, types.CreateSessionResponse, void, void>('objectexplorer/createsession');
export const type = new RequestType<azdata.ConnectionInfo, azdata.ObjectExplorerSessionResponse, void, void>('objectexplorer/createsession');
}

export namespace ObjectExplorerExpandRequest {
export const type = new RequestType<types.ExpandParams, boolean, void, void>('objectexplorer/expand');
export const type = new RequestType<azdata.ExpandNodeInfo, boolean, void, void>('objectexplorer/expand');
}

export namespace ObjectExplorerRefreshRequest {
export const type = new RequestType<types.ExpandParams, boolean, void, void>('objectexplorer/refresh');
export const type = new RequestType<azdata.ExpandNodeInfo, boolean, void, void>('objectexplorer/refresh');
}

export namespace ObjectExplorerCloseSessionRequest {
export const type = new RequestType<types.CloseSessionParams, types.CloseSessionResponse, void, void>('objectexplorer/closesession');
export const type = new RequestType<azdata.ObjectExplorerCloseSessionInfo, azdata.ObjectExplorerCloseSessionResponse, void, void>('objectexplorer/closesession');
}

export namespace ObjectExplorerFindNodesRequest {
export const type = new RequestType<types.FindNodesParams, types.FindNodesResponse, void, void>('objectexplorer/findnodes');
export const type = new RequestType<azdata.FindNodesInfo, azdata.ObjectExplorerFindNodesResponse, void, void>('objectexplorer/findnodes');
}

// ------------------------------- < Object Explorer Events > ------------------------------------


export namespace ObjectExplorerCreateSessionCompleteNotification {
export const type = new NotificationType<types.SessionCreatedParameters, void>('objectexplorer/sessioncreated');
export const type = new NotificationType<azdata.ObjectExplorerSession, void>('objectexplorer/sessioncreated');
}

export namespace ObjectExplorerSessionDisconnectedNotification {
export const type = new NotificationType<types.SessionDisconnectedParameters, void>('objectexplorer/sessiondisconnected');
export const type = new NotificationType<azdata.ObjectExplorerSession, void>('objectexplorer/sessiondisconnected');
}

export namespace ObjectExplorerExpandCompleteNotification {
export const type = new NotificationType<types.ExpandResponse, void>('objectexplorer/expandCompleted');
export const type = new NotificationType<azdata.ObjectExplorerExpandInfo, void>('objectexplorer/expandCompleted');
}

// ------------------------------- < Task Service Events > ------------------------------------
Expand Down
Loading