|
| 1 | +// |
| 2 | +// Copyright (c) Microsoft. All rights reserved. |
| 3 | +// Licensed under the MIT license. See LICENSE file in the project root for full license information. |
| 4 | +// |
| 5 | + |
| 6 | +using Microsoft.PowerShell.EditorServices.Protocol.MessageProtocol; |
| 7 | + |
| 8 | +namespace Microsoft.PowerShell.EditorServices.Protocol.LanguageServer |
| 9 | +{ |
| 10 | + public class FoldingRangeRequest |
| 11 | + { |
| 12 | + /// <summary> |
| 13 | + /// A request to provide folding ranges in a document. The request's |
| 14 | + /// parameter is of type [FoldingRangeParams](#FoldingRangeParams), the |
| 15 | + /// response is of type [FoldingRangeList](#FoldingRangeList) or a Thenable |
| 16 | + /// that resolves to such. |
| 17 | + /// Ref: https://github.com/Microsoft/vscode-languageserver-node/blob/5350bc2ffe8afb17357c1a66fbdd3845fa05adfd/protocol/src/protocol.foldingRange.ts#L112-L120 |
| 18 | + /// </summary> |
| 19 | + public static readonly |
| 20 | + RequestType<FoldingRangeParams, FoldingRange[], object, object> Type = |
| 21 | + RequestType<FoldingRangeParams, FoldingRange[], object, object>.Create("textDocument/foldingRange"); |
| 22 | + } |
| 23 | + |
| 24 | + /// <summary> |
| 25 | + /// Parameters for a [FoldingRangeRequest](#FoldingRangeRequest). |
| 26 | + /// Ref: https://github.com/Microsoft/vscode-languageserver-node/blob/5350bc2ffe8afb17357c1a66fbdd3845fa05adfd/protocol/src/protocol.foldingRange.ts#L102-L110 |
| 27 | + /// </summary> |
| 28 | + public class FoldingRangeParams |
| 29 | + { |
| 30 | + /// <summary> |
| 31 | + /// The text document |
| 32 | + /// </summary> |
| 33 | + public TextDocumentIdentifier TextDocument { get; set; } |
| 34 | + } |
| 35 | + |
| 36 | + /// <summary> |
| 37 | + /// Represents a folding range. |
| 38 | + /// Ref: https://github.com/Microsoft/vscode-languageserver-node/blob/5350bc2ffe8afb17357c1a66fbdd3845fa05adfd/protocol/src/protocol.foldingRange.ts#L69-L100 |
| 39 | + /// </summary> |
| 40 | + public class FoldingRange |
| 41 | + { |
| 42 | + /// <summary> |
| 43 | + /// The zero-based line number from where the folded range starts. |
| 44 | + /// </summary> |
| 45 | + public int StartLine { get; set; } |
| 46 | + |
| 47 | + /// <summary> |
| 48 | + /// The zero-based character offset from where the folded range starts. If not defined, defaults to the length of the start line. |
| 49 | + /// </summary> |
| 50 | + public int StartCharacter { get; set; } |
| 51 | + |
| 52 | + /// <summary> |
| 53 | + /// The zero-based line number where the folded range ends. |
| 54 | + /// </summary> |
| 55 | + public int EndLine { get; set; } |
| 56 | + |
| 57 | + /// <summary> |
| 58 | + /// The zero-based character offset before the folded range ends. If not defined, defaults to the length of the end line. |
| 59 | + /// </summary> |
| 60 | + public int EndCharacter { get; set; } |
| 61 | + |
| 62 | + /// <summary> |
| 63 | + /// Describes the kind of the folding range such as `comment' or 'region'. The kind |
| 64 | + /// is used to categorize folding ranges and used by commands like 'Fold all comments'. See |
| 65 | + /// [FoldingRangeKind](#FoldingRangeKind) for an enumeration of standardized kinds. |
| 66 | + /// </summary> |
| 67 | + public string Kind { get; set; } |
| 68 | + } |
| 69 | +} |
0 commit comments