Skip to content

Commit 36bbf5e

Browse files
authored
WI #85 Add support for server requests and client responses (#86)
1 parent dd64d22 commit 36bbf5e

24 files changed

Lines changed: 374 additions & 946 deletions
Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
namespace TypeCobol.LanguageServer.Protocol
2+
{
3+
/// <summary>
4+
/// Class representing the options for execute command support.
5+
/// </summary>
6+
public class ExecuteCommandOptions
7+
{
8+
/// <summary>
9+
/// Gets or sets the commands that are to be executed on the server.
10+
/// </summary>
11+
public string[] commands { get; set; }
12+
}
13+
}
Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
namespace TypeCobol.LanguageServer.Protocol
2+
{
3+
/// <summary>
4+
/// Class representing the parameters sent from client to server for the workspace/executeCommand request.
5+
/// </summary>
6+
public class ExecuteCommandParams
7+
{
8+
/// <summary>
9+
/// Gets or sets the command identifier associated with the command handler.
10+
/// </summary>
11+
public string command { get; set; }
12+
13+
/// <summary>
14+
/// Gets or sets the arguments that the command should be invoked with.
15+
/// </summary>
16+
public object[] arguments { get; set; }
17+
}
18+
}
Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
using TypeCobol.LanguageServer.JsonRPC;
2+
3+
namespace TypeCobol.LanguageServer.Protocol
4+
{
5+
internal class WorkspaceExecuteCommandRequest
6+
{
7+
public static readonly RequestType Type = new RequestType("workspace/executeCommand", typeof(ExecuteCommandParams), typeof(object), null);
8+
}
9+
}
Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
/* --------------------------------------------------------------------------------------------
2+
* Copyright (c) Microsoft Corporation. All rights reserved.
3+
* Licensed under the MIT License. See License.txt in the project root for license information.
4+
* ------------------------------------------------------------------------------------------ */
5+
6+
using TypeCobol.LanguageServer.JsonRPC;
7+
8+
namespace TypeCobol.LanguageServer.Protocol
9+
{
10+
/// <summary>
11+
/// The initialized notification is sent from the client to the server
12+
/// after the client received the result of the initialize request
13+
/// but before the client is sending any other request or notification to the server.
14+
/// The server can use the initialized notification for example to dynamically
15+
/// register capabilities. The initialized notification may only be sent once.
16+
/// </summary>
17+
class InitializedNotification
18+
{
19+
public static readonly NotificationType Type = new NotificationType("initialized", typeof(InitializedParams));
20+
}
21+
}
Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
/* --------------------------------------------------------------------------------------------
2+
* Copyright (c) Microsoft Corporation. All rights reserved.
3+
* Licensed under the MIT License. See License.txt in the project root for license information.
4+
* ------------------------------------------------------------------------------------------ */
5+
6+
namespace TypeCobol.LanguageServer.Protocol
7+
{
8+
/// <summary>
9+
/// The initialized parameters
10+
/// </summary>
11+
public class InitializedParams
12+
{
13+
//Defined as empty by LSP
14+
}
15+
}

Solution/TypeCobol.LanguageServer.Protocol/Initialize Method/ServerCapabilities.cs

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -85,5 +85,15 @@ public class ServerCapabilities
8585
/// The server provides rename support.
8686
/// </summary>
8787
public bool renameProvider { get; set; }
88+
89+
/// <summary>
90+
/// Gets or sets the value which indicates if execute command is supported.
91+
/// </summary>
92+
public ExecuteCommandOptions executeCommandProvider { get; set; }
93+
94+
/// <summary>
95+
/// Experimental value.
96+
/// </summary>
97+
public object experimental;
8898
}
8999
}

0 commit comments

Comments
 (0)