Skip to content

Commit 77047cb

Browse files
Charles-Gagnonalanrenmsft
authored andcommitted
Remove duplicated types (#85)
* Remove duplicated types * Remove max line length
1 parent fed4e05 commit 77047cb

File tree

5 files changed

+14
-385
lines changed

5 files changed

+14
-385
lines changed

src/codeConverter.ts

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -37,10 +37,8 @@ function asScriptingParams(
3737
type: metadata.metadataTypeName,
3838
schema: metadata.schema,
3939
name: metadata.name,
40-
// cast to any since azdata needs to be updated to pickup this new field
41-
// TODO: remove cast once updated azdata is published (8/24/2021 - karlb)
42-
parentName: (<any>metadata).parentName,
43-
parentTypeName: (<any>metadata).parentTypeName
40+
parentName: metadata.parentName,
41+
parentTypeName: metadata.parentTypeName
4442
};
4543
let targetDatabaseEngineEdition = paramDetails.targetDatabaseEngineEdition;
4644
let targetDatabaseEngineType = paramDetails.targetDatabaseEngineType;

src/main.ts

Lines changed: 1 addition & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -289,12 +289,7 @@ export class ConnectionFeature extends SqlOpsFeature<undefined> {
289289
};
290290

291291
let registerOnConnectionChanged = (handler: (changedConnInfo: azdata.ChangedConnectionInfo) => any): void => {
292-
client.onNotification(protocol.ConnectionChangedNotification.type, (params: protocol.ConnectionChangedParams) => {
293-
handler({
294-
connectionUri: params.ownerUri,
295-
connection: params.connection
296-
});
297-
});
292+
client.onNotification(protocol.ConnectionChangedNotification.type, handler);
298293
};
299294

300295
azdata.dataprotocol.onDidChangeLanguageFlavor((params) => {

src/protocol.ts

Lines changed: 11 additions & 26 deletions
Original file line numberDiff line numberDiff line change
@@ -123,31 +123,16 @@ export namespace ConnectionRequest {
123123

124124

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

129129
// ------------------------------- < Connection Changed Event > -------------------------------------
130130

131-
/**
132-
* Parameters for the ConnectionChanged notification.
133-
*/
134-
export class ConnectionChangedParams {
135-
/**
136-
* Owner URI of the connection that changed.
137-
*/
138-
public ownerUri: string;
139-
140-
/**
141-
* Summary of details containing any connection changes.
142-
*/
143-
public connection: types.ConnectionSummary;
144-
}
145-
146131
/**
147132
* Connection changed event callback declaration.
148133
*/
149134
export namespace ConnectionChangedNotification {
150-
export const type = new NotificationType<ConnectionChangedParams, void>('connection/connectionchanged');
135+
export const type = new NotificationType<azdata.ChangedConnectionInfo, void>('connection/connectionchanged');
151136
}
152137

153138
// ------------------------------- < Password Change for Connection Event > -------------------------------------
@@ -504,7 +489,7 @@ export namespace ScriptingRequest {
504489
// ------------------------------- < Scripting Complete Event > ------------------------------------
505490

506491
export namespace ScriptingCompleteNotification {
507-
export const type = new NotificationType<types.ScriptingCompleteParams, void>('scripting/scriptComplete');
492+
export const type = new NotificationType<azdata.ScriptingCompleteResult, void>('scripting/scriptComplete');
508493
}
509494

510495

@@ -586,38 +571,38 @@ export namespace EditSubsetRequest {
586571
// ------------------------------- < Object Explorer Events > ------------------------------------
587572

588573
export namespace ObjectExplorerCreateSessionRequest {
589-
export const type = new RequestType<azdata.ConnectionInfo, types.CreateSessionResponse, void, void>('objectexplorer/createsession');
574+
export const type = new RequestType<azdata.ConnectionInfo, azdata.ObjectExplorerSessionResponse, void, void>('objectexplorer/createsession');
590575
}
591576

592577
export namespace ObjectExplorerExpandRequest {
593-
export const type = new RequestType<types.ExpandParams, boolean, void, void>('objectexplorer/expand');
578+
export const type = new RequestType<azdata.ExpandNodeInfo, boolean, void, void>('objectexplorer/expand');
594579
}
595580

596581
export namespace ObjectExplorerRefreshRequest {
597-
export const type = new RequestType<types.ExpandParams, boolean, void, void>('objectexplorer/refresh');
582+
export const type = new RequestType<azdata.ExpandNodeInfo, boolean, void, void>('objectexplorer/refresh');
598583
}
599584

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

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

608593
// ------------------------------- < Object Explorer Events > ------------------------------------
609594

610595

611596
export namespace ObjectExplorerCreateSessionCompleteNotification {
612-
export const type = new NotificationType<types.SessionCreatedParameters, void>('objectexplorer/sessioncreated');
597+
export const type = new NotificationType<azdata.ObjectExplorerSession, void>('objectexplorer/sessioncreated');
613598
}
614599

615600
export namespace ObjectExplorerSessionDisconnectedNotification {
616-
export const type = new NotificationType<types.SessionDisconnectedParameters, void>('objectexplorer/sessiondisconnected');
601+
export const type = new NotificationType<azdata.ObjectExplorerSession, void>('objectexplorer/sessiondisconnected');
617602
}
618603

619604
export namespace ObjectExplorerExpandCompleteNotification {
620-
export const type = new NotificationType<types.ExpandResponse, void>('objectexplorer/expandCompleted');
605+
export const type = new NotificationType<azdata.ObjectExplorerExpandInfo, void>('objectexplorer/expandCompleted');
621606
}
622607

623608
// ------------------------------- < Task Service Events > ------------------------------------

0 commit comments

Comments
 (0)