1
- using Newtonsoft . Json ;
1
+ using System . ComponentModel ;
2
+ using Newtonsoft . Json ;
2
3
using Newtonsoft . Json . Serialization ;
3
4
4
5
namespace OmniSharp . Extensions . LanguageServer . Capabilities . Client
@@ -8,74 +9,119 @@ public class TextDocumentClientCapabilities
8
9
{
9
10
public Supports < SynchronizationCapability > Synchronization { get ; set ; }
10
11
12
+ [ EditorBrowsable ( EditorBrowsableState . Never ) ]
13
+ public bool ShouldSerializeSynchronization ( ) => Synchronization . IsSupported ;
14
+
11
15
/// <summary>
12
16
/// Capabilities specific to the `textDocument/completion`
13
17
/// </summary>
14
18
public Supports < CompletionCapability > Completion { get ; set ; }
15
19
20
+ [ EditorBrowsable ( EditorBrowsableState . Never ) ]
21
+ public bool ShouldSerializeCompletion ( ) => Completion . IsSupported ;
22
+
16
23
/// <summary>
17
24
/// Capabilities specific to the `textDocument/hover`
18
25
/// </summary>
19
26
public Supports < HoverCapability > Hover { get ; set ; }
20
27
28
+ [ EditorBrowsable ( EditorBrowsableState . Never ) ]
29
+ public bool ShouldSerializeHover ( ) => Hover . IsSupported ;
30
+
21
31
/// <summary>
22
32
/// Capabilities specific to the `textDocument/signatureHelp`
23
33
/// </summary>
24
34
public Supports < SignatureHelpCapability > SignatureHelp { get ; set ; }
25
35
36
+ [ EditorBrowsable ( EditorBrowsableState . Never ) ]
37
+ public bool ShouldSerializeSignatureHelp ( ) => SignatureHelp . IsSupported ;
38
+
26
39
/// <summary>
27
40
/// Capabilities specific to the `textDocument/references`
28
41
/// </summary>
29
42
public Supports < ReferencesCapability > References { get ; set ; }
30
43
44
+ [ EditorBrowsable ( EditorBrowsableState . Never ) ]
45
+ public bool ShouldSerializeReferences ( ) => References . IsSupported ;
46
+
31
47
/// <summary>
32
48
/// Capabilities specific to the `textDocument/documentHighlight`
33
49
/// </summary>
34
50
public Supports < DocumentHighlightCapability > DocumentHighlight { get ; set ; }
35
51
52
+ [ EditorBrowsable ( EditorBrowsableState . Never ) ]
53
+ public bool ShouldSerializeDocumentHighlight ( ) => DocumentHighlight . IsSupported ;
54
+
36
55
/// <summary>
37
56
/// Capabilities specific to the `textDocument/documentSymbol`
38
57
/// </summary>
39
58
public Supports < DocumentSymbolCapability > DocumentSymbol { get ; set ; }
40
59
60
+ [ EditorBrowsable ( EditorBrowsableState . Never ) ]
61
+ public bool ShouldSerializeDocumentSymbol ( ) => DocumentSymbol . IsSupported ;
62
+
41
63
/// <summary>
42
64
/// Capabilities specific to the `textDocument/formatting`
43
65
/// </summary>
44
66
public Supports < DocumentFormattingCapability > Formatting { get ; set ; }
45
67
68
+ [ EditorBrowsable ( EditorBrowsableState . Never ) ]
69
+ public bool ShouldSerializeFormatting ( ) => Formatting . IsSupported ;
70
+
46
71
/// <summary>
47
72
/// Capabilities specific to the `textDocument/rangeFormatting`
48
73
/// </summary>
49
74
public Supports < DocumentRangeFormattingCapability > RangeFormatting { get ; set ; }
50
75
76
+ [ EditorBrowsable ( EditorBrowsableState . Never ) ]
77
+ public bool ShouldSerializeRangeFormatting ( ) => RangeFormatting . IsSupported ;
78
+
51
79
/// <summary>
52
80
/// Capabilities specific to the `textDocument/onTypeFormatting`
53
81
/// </summary>
54
82
public Supports < DocumentOnTypeFormattingCapability > OnTypeFormatting { get ; set ; }
55
83
84
+ [ EditorBrowsable ( EditorBrowsableState . Never ) ]
85
+ public bool ShouldSerializeOnTypeFormatting ( ) => OnTypeFormatting . IsSupported ;
86
+
56
87
/// <summary>
57
88
/// Capabilities specific to the `textDocument/definition`
58
89
/// </summary>
59
90
public Supports < DefinitionCapability > Definition { get ; set ; }
60
91
92
+ [ EditorBrowsable ( EditorBrowsableState . Never ) ]
93
+ public bool ShouldSerializeDefinition ( ) => Definition . IsSupported ;
94
+
61
95
/// <summary>
62
96
/// Capabilities specific to the `textDocument/codeAction`
63
97
/// </summary>
64
98
public Supports < CodeActionCapability > CodeAction { get ; set ; }
65
99
100
+ [ EditorBrowsable ( EditorBrowsableState . Never ) ]
101
+ public bool ShouldSerializeCodeAction ( ) => CodeAction . IsSupported ;
102
+
66
103
/// <summary>
67
104
/// Capabilities specific to the `textDocument/codeLens`
68
105
/// </summary>
69
106
public Supports < CodeLensCapability > CodeLens { get ; set ; }
70
107
108
+ [ EditorBrowsable ( EditorBrowsableState . Never ) ]
109
+ public bool ShouldSerializeCodeLens ( ) => CodeLens . IsSupported ;
110
+
71
111
/// <summary>
72
112
/// Capabilities specific to the `textDocument/documentLink`
73
113
/// </summary>
74
114
public Supports < DocumentLinkCapability > DocumentLink { get ; set ; }
75
115
116
+ [ EditorBrowsable ( EditorBrowsableState . Never ) ]
117
+ public bool ShouldSerializeDocumentLink ( ) => DocumentLink . IsSupported ;
118
+
76
119
/// <summary>
77
120
/// Capabilities specific to the `textDocument/rename`
78
121
/// </summary>
79
122
public Supports < RenameCapability > Rename { get ; set ; }
123
+
124
+ [ EditorBrowsable ( EditorBrowsableState . Never ) ]
125
+ public bool ShouldSerializeRename ( ) => Rename . IsSupported ;
80
126
}
81
127
}
0 commit comments