|
1 | 1 | namespace OmniSharp.Extensions.LanguageServer.Protocol.Models
|
2 | 2 | {
|
3 |
| - public struct DocumentSymbolInformationOrDocumentSymbol |
| 3 | + public struct SymbolInformationOrDocumentSymbol |
4 | 4 | {
|
5 | 5 | private DocumentSymbol _documentSymbol;
|
6 |
| - private DocumentSymbolInformation _command; |
7 |
| - public DocumentSymbolInformationOrDocumentSymbol(DocumentSymbol value) |
| 6 | + private SymbolInformation _symbolInformation; |
| 7 | + public SymbolInformationOrDocumentSymbol(DocumentSymbol documentSymbol) |
8 | 8 | {
|
9 |
| - _documentSymbol = value; |
10 |
| - _command = default; |
| 9 | + _documentSymbol = documentSymbol; |
| 10 | + _symbolInformation = default; |
11 | 11 | }
|
12 |
| - public DocumentSymbolInformationOrDocumentSymbol(DocumentSymbolInformation value) |
| 12 | + public SymbolInformationOrDocumentSymbol(SymbolInformation symbolInformation) |
13 | 13 | {
|
14 | 14 | _documentSymbol = default;
|
15 |
| - _command = value; |
| 15 | + _symbolInformation = symbolInformation; |
16 | 16 | }
|
17 | 17 |
|
18 |
| - public bool IsDocumentSymbolInformation => this._command != null; |
19 |
| - public DocumentSymbolInformation DocumentSymbolInformation |
20 |
| - { |
21 |
| - get { return this._command; } |
22 |
| - set |
23 |
| - { |
24 |
| - this._command = value; |
25 |
| - this._documentSymbol = null; |
26 |
| - } |
27 |
| - } |
| 18 | + public bool IsDocumentSymbolInformation => _symbolInformation != null; |
| 19 | + public SymbolInformation SymbolInformation => _symbolInformation; |
28 | 20 |
|
29 |
| - public bool IsDocumentSymbol => this._documentSymbol != null; |
30 |
| - public DocumentSymbol DocumentSymbol |
31 |
| - { |
32 |
| - get { return this._documentSymbol; } |
33 |
| - set |
34 |
| - { |
35 |
| - this._command = default; |
36 |
| - this._documentSymbol = value; |
37 |
| - } |
38 |
| - } |
39 |
| - public object RawValue |
40 |
| - { |
41 |
| - get |
42 |
| - { |
43 |
| - if (IsDocumentSymbolInformation) return DocumentSymbolInformation; |
44 |
| - if (IsDocumentSymbol) return DocumentSymbol; |
45 |
| - return default; |
46 |
| - } |
47 |
| - } |
| 21 | + public bool IsDocumentSymbol => _documentSymbol != null; |
| 22 | + public DocumentSymbol DocumentSymbol => _documentSymbol; |
48 | 23 |
|
49 |
| - public static implicit operator DocumentSymbolInformationOrDocumentSymbol(DocumentSymbolInformation value) |
| 24 | + public static implicit operator SymbolInformationOrDocumentSymbol(SymbolInformation value) |
50 | 25 | {
|
51 |
| - return new DocumentSymbolInformationOrDocumentSymbol(value); |
| 26 | + return new SymbolInformationOrDocumentSymbol(value); |
52 | 27 | }
|
53 | 28 |
|
54 |
| - public static implicit operator DocumentSymbolInformationOrDocumentSymbol(DocumentSymbol value) |
| 29 | + public static implicit operator SymbolInformationOrDocumentSymbol(DocumentSymbol value) |
55 | 30 | {
|
56 |
| - return new DocumentSymbolInformationOrDocumentSymbol(value); |
| 31 | + return new SymbolInformationOrDocumentSymbol(value); |
57 | 32 | }
|
58 | 33 | }
|
59 | 34 | }
|
0 commit comments