-
-
Notifications
You must be signed in to change notification settings - Fork 24
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Support disconnect message from object explorer
- Loading branch information
Showing
5 changed files
with
106 additions
and
0 deletions.
There are no files selected for viewing
14 changes: 14 additions & 0 deletions
14
MarkMpn.Sql4Cds.LanguageServer/ObjectExplorer/Contracts/CloseSessionParams.cs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
namespace MarkMpn.Sql4Cds.LanguageServer.ObjectExplorer.Contracts | ||
{ | ||
/// <summary> | ||
/// Parameters to the <see cref="CloseSessionRequest"/>. | ||
/// </summary> | ||
public class CloseSessionParams | ||
{ | ||
/// <summary> | ||
/// The Id returned from a <see cref="CreateSessionRequest"/>. This | ||
/// is used to disambiguate between different trees. | ||
/// </summary> | ||
public string SessionId { get; set; } | ||
} | ||
} |
15 changes: 15 additions & 0 deletions
15
MarkMpn.Sql4Cds.LanguageServer/ObjectExplorer/Contracts/CloseSessionRequest.cs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
using MarkMpn.Sql4Cds.LanguageServer.Connection.Contracts; | ||
using Microsoft.VisualStudio.LanguageServer.Protocol; | ||
|
||
namespace MarkMpn.Sql4Cds.LanguageServer.ObjectExplorer.Contracts | ||
{ | ||
/// <summary> | ||
/// Closes an Object Explorer tree session for a specific connection. | ||
/// </summary> | ||
public class CloseSessionRequest | ||
{ | ||
public const string MessageName = "objectexplorer/closesession"; | ||
|
||
public static readonly LspRequest<CloseSessionParams, CloseSessionResponse> Type = new LspRequest<CloseSessionParams, CloseSessionResponse>(MessageName); | ||
} | ||
} |
21 changes: 21 additions & 0 deletions
21
MarkMpn.Sql4Cds.LanguageServer/ObjectExplorer/Contracts/CloseSessionResponse.cs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
namespace MarkMpn.Sql4Cds.LanguageServer.ObjectExplorer.Contracts | ||
{ | ||
/// <summary> | ||
/// Information returned from a <see cref="CloseSessionRequest"/>. | ||
/// Contains success information, a <see cref="SessionId"/> to be used when | ||
/// requesting closing an existing session. | ||
/// </summary> | ||
public class CloseSessionResponse | ||
{ | ||
/// <summary> | ||
/// Boolean indicating if the session was closed successfully | ||
/// </summary> | ||
public bool Success { get; set; } | ||
|
||
/// <summary> | ||
/// Unique ID to use when sending any requests for objects in the | ||
/// tree under the node | ||
/// </summary> | ||
public string SessionId { get; set; } | ||
} | ||
} |
37 changes: 37 additions & 0 deletions
37
MarkMpn.Sql4Cds.LanguageServer/ObjectExplorer/Contracts/SessionDisconnectedNotification.cs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,37 @@ | ||
using Microsoft.VisualStudio.LanguageServer.Protocol; | ||
|
||
namespace MarkMpn.Sql4Cds.LanguageServer.ObjectExplorer.Contracts | ||
{ | ||
/// <summary> | ||
/// Information returned when a session is disconnected. | ||
/// Contains success information and a <see cref="SessionId"/> | ||
/// </summary> | ||
public class SessionDisconnectedParameters | ||
{ | ||
/// <summary> | ||
/// Boolean indicating if the connection was successful | ||
/// </summary> | ||
public bool Success { get; set; } | ||
|
||
/// <summary> | ||
/// Unique ID to use when sending any requests for objects in the | ||
/// tree under the node | ||
/// </summary> | ||
public string SessionId { get; set; } | ||
|
||
/// <summary> | ||
/// Error message returned from the engine for a object explorer session failure reason, if any. | ||
/// </summary> | ||
public string ErrorMessage { get; set; } | ||
} | ||
|
||
/// <summary> | ||
/// Session disconnected notification | ||
/// </summary> | ||
public class SessionDisconnectedNotification | ||
{ | ||
public const string MessageName = "objectexplorer/sessiondisconnected"; | ||
|
||
public static readonly LspNotification<SessionDisconnectedParameters> Type = new LspNotification<SessionDisconnectedParameters>(MessageName); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters