@@ -9,19 +9,86 @@ namespace Microsoft.PowerShell.EditorServices.Protocol.LanguageServer
9
9
{
10
10
public class DocumentFormattingRequest
11
11
{
12
- public static readonly
13
- RequestType < DocumentFormattingParams , TextEdit [ ] , object , TextDocumentRegistrationOptions > Type = RequestType < DocumentFormattingParams , TextEdit [ ] , object , TextDocumentRegistrationOptions > . Create ( "textDocument/formatting" ) ;
12
+ public static readonly RequestType < DocumentFormattingParams , TextEdit [ ] , object , TextDocumentRegistrationOptions > Type = RequestType < DocumentFormattingParams , TextEdit [ ] , object , TextDocumentRegistrationOptions > . Create ( "textDocument/formatting" ) ;
13
+ }
14
+
15
+ public class DocumentRangeFormattingRequest
16
+ {
17
+ public static readonly RequestType < DocumentRangeFormattingParams , TextEdit [ ] , object , TextDocumentRegistrationOptions > Type = RequestType < DocumentRangeFormattingParams , TextEdit [ ] , object , TextDocumentRegistrationOptions > . Create ( "textDocument/rangeFormatting" ) ;
18
+
19
+ }
20
+
21
+ public class DocumentOnTypeFormattingRequest
22
+ {
23
+ public static readonly RequestType < DocumentOnTypeFormattingRequest , TextEdit [ ] , object , TextDocumentRegistrationOptions > Type = RequestType < DocumentOnTypeFormattingRequest , TextEdit [ ] , object , TextDocumentRegistrationOptions > . Create ( "textDocument/onTypeFormatting" ) ;
24
+
25
+ }
26
+
27
+ public class DocumentRangeFormattingParams
28
+ {
29
+ /// <summary>
30
+ /// The document to format.
31
+ /// </summary>
32
+ public TextDocumentIdentifier TextDocument { get ; set ; }
33
+
34
+ /// <summary>
35
+ /// The range to format.
36
+ /// </summary>
37
+ /// <returns></returns>
38
+ public Range Range { get ; set ; }
39
+
40
+ /// <summary>
41
+ /// The format options.
42
+ /// </summary>
43
+ public FormattingOptions options { get ; set ; }
44
+ }
45
+
46
+ public class DocumentOnTypeFormattingParams
47
+ {
48
+ /// <summary>
49
+ /// The document to format.
50
+ /// </summary>
51
+ public TextDocumentIdentifier TextDocument { get ; set ; }
52
+
53
+ /// <summary>
54
+ /// The position at which this request was sent.
55
+ /// </summary>
56
+ public Position Position { get ; set ; }
57
+
58
+ /// <summary>
59
+ /// The character that has been typed.
60
+ /// </summary>
61
+ public string ch { get ; set ; }
62
+
63
+ /// <summary>
64
+ /// The format options.
65
+ /// </summary>
66
+ public FormattingOptions options { get ; set ; }
14
67
}
15
68
16
69
public class DocumentFormattingParams
17
70
{
71
+ /// <summary>
72
+ /// The document to format.
73
+ /// </summary>
18
74
public TextDocumentIdentifier TextDocument { get ; set ; }
75
+
76
+ /// <summary>
77
+ /// The format options.
78
+ /// </summary>
19
79
public FormattingOptions options { get ; set ; }
20
80
}
21
81
22
82
public class FormattingOptions
23
83
{
84
+ /// <summary>
85
+ /// Size of a tab in spaces.
86
+ /// </summary>
24
87
int TabSize { get ; set ; }
88
+
89
+ /// <summary>
90
+ /// Prefer spaces over tabs.
91
+ /// </summary>
25
92
bool InsertSpaces { get ; set ; }
26
93
}
27
94
}
0 commit comments