|
| 1 | +""" |
| 2 | +A set of predefined range kinds. |
| 3 | +""" |
| 4 | +@namespace FoldingRangeKind::String begin |
| 5 | + """ |
| 6 | + Folding range for a comment |
| 7 | + """ |
| 8 | + Comment = "comment" |
| 9 | + """ |
| 10 | + Folding range for imports or includes |
| 11 | + """ |
| 12 | + Imports = "imports" |
| 13 | + """ |
| 14 | + Folding range for a region (e.g. `#region`) |
| 15 | + """ |
| 16 | + Region = "region" |
| 17 | +end |
| 18 | + |
| 19 | +@interface FoldingRangeClientCapabilities begin |
| 20 | + """ |
| 21 | + Whether implementation supports dynamic registration for folding range |
| 22 | + providers. If this is set to `true` the client supports the new |
| 23 | + `FoldingRangeRegistrationOptions` return value for the corresponding |
| 24 | + server capability as well. |
| 25 | + """ |
| 26 | + dynamicRegistration::Union{Nothing, Bool} = nothing |
| 27 | + |
| 28 | + """ |
| 29 | + The maximum number of folding ranges that the client prefers to receive |
| 30 | + per document. The value serves as a hint, servers are free to follow the |
| 31 | + limit. |
| 32 | + """ |
| 33 | + rangeLimit::Union{Nothing, UInt} = nothing |
| 34 | + |
| 35 | + """ |
| 36 | + If set, the client signals that it only supports folding complete lines. |
| 37 | + If set, client will ignore specified `startCharacter` and `endCharacter` |
| 38 | + properties in a FoldingRange. |
| 39 | + """ |
| 40 | + lineFoldingOnly::Union{Nothing, Bool} = nothing |
| 41 | + |
| 42 | + """ |
| 43 | + Specific options for the folding range kind. |
| 44 | +
|
| 45 | + # Tags |
| 46 | + - since - 3.17.0 |
| 47 | + """ |
| 48 | + foldingRangeKind::Union{Nothing, @interface begin |
| 49 | + """ |
| 50 | + The folding range kind values the client supports. When this |
| 51 | + property exists the client also guarantees that it will |
| 52 | + handle values outside its set gracefully and falls back |
| 53 | + to a default value when unknown. |
| 54 | + """ |
| 55 | + valueSet::Union{Nothing, Vector{FoldingRangeKind.Ty}} = nothing |
| 56 | + end} = nothing |
| 57 | + |
| 58 | + """ |
| 59 | + Specific options for the folding range. |
| 60 | +
|
| 61 | + # Tags |
| 62 | + - since - 3.17.0 |
| 63 | + """ |
| 64 | + foldingRange::Union{Nothing, @interface begin |
| 65 | + """ |
| 66 | + If set, the client signals that it supports setting collapsedText on |
| 67 | + folding ranges to display custom labels instead of the default text. |
| 68 | +
|
| 69 | + # Tags |
| 70 | + - since - 3.17.0 |
| 71 | + """ |
| 72 | + collapsedText::Union{Nothing, Bool} = nothing |
| 73 | + end} = nothing |
| 74 | +end |
| 75 | + |
| 76 | +@interface FoldingRangeOptions @extends WorkDoneProgressOptions begin |
| 77 | +end |
| 78 | + |
| 79 | +@interface FoldingRangeRegistrationOptions @extends TextDocumentRegistrationOptions, FoldingRangeOptions begin |
| 80 | +end |
| 81 | + |
| 82 | +""" |
| 83 | +Represents a folding range. To be valid, start and end line must be bigger |
| 84 | +than zero and smaller than the number of lines in the document. Clients |
| 85 | +are free to ignore invalid ranges. |
| 86 | +""" |
| 87 | +@interface FoldingRange begin |
| 88 | + |
| 89 | + """ |
| 90 | + The zero-based start line of the range to fold. The folded area starts |
| 91 | + after the line's last character. To be valid, the end must be zero or |
| 92 | + larger and smaller than the number of lines in the document. |
| 93 | + """ |
| 94 | + startLine::UInt |
| 95 | + |
| 96 | + """ |
| 97 | + The zero-based character offset from where the folded range starts. If |
| 98 | + not defined, defaults to the length of the start line. |
| 99 | + """ |
| 100 | + startCharacter::Union{Nothing, UInt} = nothing |
| 101 | + |
| 102 | + """ |
| 103 | + The zero-based end line of the range to fold. The folded area ends with |
| 104 | + the line's last character. To be valid, the end must be zero or larger |
| 105 | + and smaller than the number of lines in the document. |
| 106 | + """ |
| 107 | + endLine::UInt |
| 108 | + |
| 109 | + """ |
| 110 | + The zero-based character offset before the folded range ends. If not |
| 111 | + defined, defaults to the length of the end line. |
| 112 | + """ |
| 113 | + endCharacter::Union{Nothing, UInt} = nothing |
| 114 | + |
| 115 | + """ |
| 116 | + Describes the kind of the folding range such as `comment` or `region`. |
| 117 | + The kind is used to categorize folding ranges and used by commands like |
| 118 | + 'Fold all comments'. See [FoldingRangeKind](#FoldingRangeKind) for an |
| 119 | + enumeration of standardized kinds. |
| 120 | + """ |
| 121 | + kind::Union{Nothing, FoldingRangeKind.Ty} = nothing |
| 122 | + |
| 123 | + """ |
| 124 | + The text that the client should show when the specified range is |
| 125 | + collapsed. If not defined or not supported by the client, a default |
| 126 | + will be chosen by the client. |
| 127 | +
|
| 128 | + # Tags |
| 129 | + - since - 3.17.0 - proposed |
| 130 | + """ |
| 131 | + collapsedText::Union{Nothing, String} = nothing |
| 132 | +end |
| 133 | + |
| 134 | +@interface FoldingRangeParams @extends WorkDoneProgressParams, PartialResultParams begin |
| 135 | + """ |
| 136 | + The text document. |
| 137 | + """ |
| 138 | + textDocument::TextDocumentIdentifier |
| 139 | +end |
| 140 | + |
| 141 | +""" |
| 142 | +The folding range request is sent from the client to the server to return all |
| 143 | +folding ranges found in a given text document. |
| 144 | +
|
| 145 | +# Tags |
| 146 | +- since - 3.10.0 |
| 147 | +""" |
| 148 | +@interface FoldingRangeRequest @extends RequestMessage begin |
| 149 | + method::String = "textDocument/foldingRange" |
| 150 | + params::FoldingRangeParams |
| 151 | +end |
| 152 | + |
| 153 | +@interface FoldingRangeResponse @extends ResponseMessage begin |
| 154 | + result::Union{Vector{FoldingRange}, Null, Nothing} |
| 155 | +end |
0 commit comments