Skip to content

Commit 6e1c55c

Browse files
Added missing symbol kinds and attach to capabilities
1 parent 04d5a5f commit 6e1c55c

File tree

5 files changed

+74
-3
lines changed

5 files changed

+74
-3
lines changed

src/Protocol/Client/Capabilities/CompletionCapability.cs

Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
using Newtonsoft.Json;
2+
using OmniSharp.Extensions.LanguageServer.Protocol.Models;
23

34
namespace OmniSharp.Extensions.LanguageServer.Protocol.Client.Capabilities
45
{
@@ -11,10 +12,33 @@ public class CompletionCapability : DynamicCapability, ConnectedCapability<IComp
1112
[Optional]
1213
public CompletionItemCapability CompletionItem { get; set; }
1314

15+
/// <summary>
16+
/// Specific capabilities for the `CompletionItemKind` in the `textDocument/completion` request.
17+
/// </summary>
18+
[Optional]
19+
public CompletionItemKindCapability SymbolKind { get; set; }
20+
1421
/// <summary>
1522
/// The client supports to send additional context information for a `textDocument/completion` request.
1623
/// </summary>
1724
[Optional]
1825
public bool ContextSupport { get; set; }
1926
}
27+
28+
29+
public class CompletionItemKindCapability
30+
{
31+
/// <summary>
32+
/// The completion item kind values the client supports. When this
33+
/// property exists the client also guarantees that it will
34+
/// handle values outside its set gracefully and falls back
35+
/// to a default value when unknown.
36+
///
37+
/// If this property is not present the client only supports
38+
/// the completion items kinds from `Text` to `Reference` as defined in
39+
/// the initial version of the protocol.
40+
/// </summary>
41+
[Optional]
42+
public Container<CompletionItemKind> ValueSet { get; set; }
43+
}
2044
}
Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,11 @@
11
namespace OmniSharp.Extensions.LanguageServer.Protocol.Client.Capabilities
22
{
3-
public class DocumentSymbolCapability : DynamicCapability, ConnectedCapability<IDocumentSymbolHandler> { }
3+
public class DocumentSymbolCapability : DynamicCapability, ConnectedCapability<IDocumentSymbolHandler> {
4+
5+
/// <summary>
6+
/// Specific capabilities for the `SymbolKind` in the `textDocument/symbol` request.
7+
/// </summary>
8+
[Optional]
9+
public SymbolKindCapability SymbolKind { get; set; }
10+
}
411
}
Lines changed: 26 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,29 @@
1+
using OmniSharp.Extensions.LanguageServer.Protocol.Models;
2+
13
namespace OmniSharp.Extensions.LanguageServer.Protocol.Client.Capabilities
24
{
3-
public class WorkspaceSymbolCapability : DynamicCapability, ConnectedCapability<IWorkspaceSymbolsHandler> { }
5+
public class WorkspaceSymbolCapability : DynamicCapability, ConnectedCapability<IWorkspaceSymbolsHandler>
6+
{
7+
/// <summary>
8+
/// Specific capabilities for the `SymbolKind` in the `workspace/symbol` request.
9+
/// </summary>
10+
[Optional]
11+
public SymbolKindCapability SymbolKind { get; set; }
12+
}
13+
14+
public class SymbolKindCapability
15+
{
16+
/// <summary>
17+
/// The symbol kind values the client supports. When this
18+
/// property exists the client also guarantees that it will
19+
/// handle values outside its set gracefully and falls back
20+
/// to a default value when unknown.
21+
///
22+
/// If this property is not present the client only supports
23+
/// the symbol kinds from `File` to `Array` as defined in
24+
/// the initial version of the protocol.
25+
/// </summary>
26+
[Optional]
27+
public Container<SymbolKind> ValueSet { get; set; }
28+
}
429
}

src/Protocol/Models/CompletionItemKind.cs

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -26,5 +26,12 @@ public enum CompletionItemKind
2626
Color = 16,
2727
File = 17,
2828
Reference = 18,
29+
Folder = 19,
30+
EnumMember = 20,
31+
Constant = 21,
32+
Struct = 22,
33+
Event = 23,
34+
Operator = 24,
35+
TypeParameter = 25,
2936
}
3037
}

src/Protocol/Models/SymbolKind.cs

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,5 +27,13 @@ public enum SymbolKind
2727
Number = 16,
2828
Boolean = 17,
2929
Array = 18,
30+
Object = 19,
31+
Key = 20,
32+
Null = 21,
33+
EnumMember = 22,
34+
Struct = 23,
35+
Event = 24,
36+
Operator = 25,
37+
TypeParameter = 26,
3038
}
31-
}
39+
}

0 commit comments

Comments
 (0)