Skip to content

Commit d74dbc6

Browse files
Kapil Borledaviwil
authored andcommitted
Add InitializeParams type
1 parent c8a8936 commit d74dbc6

File tree

1 file changed

+39
-6
lines changed
  • src/PowerShellEditorServices.Protocol/LanguageServer

1 file changed

+39
-6
lines changed

src/PowerShellEditorServices.Protocol/LanguageServer/Initialize.cs

Lines changed: 39 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -10,20 +10,53 @@ namespace Microsoft.PowerShell.EditorServices.Protocol.LanguageServer
1010
public class InitializeRequest
1111
{
1212
public static readonly
13-
RequestType<InitializeRequest, InitializeResult, object, object> Type =
14-
RequestType<InitializeRequest, InitializeResult, object, object>.Create("initialize");
13+
RequestType<InitializeParams, InitializeResult, object, object> Type =
14+
RequestType<InitializeParams, InitializeResult, object, object>.Create("initialize");
15+
}
1516

17+
public enum TraceType {
18+
Off,
19+
Messages,
20+
Verbose
21+
}
22+
23+
public class InitializeParams {
1624
/// <summary>
17-
/// Gets or sets the root path of the editor's open workspace.
18-
/// If null it is assumed that a file was opened without having
19-
/// a workspace open.
25+
/// The process Id of the parent process that started the server
26+
/// </summary>
27+
public int ProcessId { get; set; }
28+
29+
/// <summary>
30+
/// The root path of the workspace. It is null if no folder is open.
31+
///
32+
/// This property has been deprecated in favor of RootUri.
2033
/// </summary>
2134
public string RootPath { get; set; }
2235

2336
/// <summary>
24-
/// Gets or sets the capabilities provided by the client (editor).
37+
/// The root uri of the workspace. It is null if not folder is open. If both
38+
/// `RootUri` and `RootPath` are non-null, `RootUri` should be used.
39+
/// </summary>
40+
public string RootUri { get; set; }
41+
42+
/// <summary>
43+
/// The capabilities provided by the client.
2544
/// </summary>
2645
public ClientCapabilities Capabilities { get; set; }
46+
47+
/// <summary>
48+
/// User provided initialization options.
49+
///
50+
/// This is defined as `any` type on the client side.
51+
/// </summary>
52+
public object InitializeOptions { get; set; }
53+
54+
// TODO We need to verify if the deserializer will map the type defined in the client
55+
// to an enum.
56+
/// <summary>
57+
/// The initial trace setting. If omitted trace is disabled.
58+
/// </summary>
59+
public TraceType Trace { get; set; } = TraceType.Off;
2760
}
2861

2962
public class InitializeResult

0 commit comments

Comments
 (0)