File tree Expand file tree Collapse file tree 1 file changed +7
-12
lines changed
src/PowerShellEditorServices/Services/TextDocument/Handlers Expand file tree Collapse file tree 1 file changed +7
-12
lines changed Original file line number Diff line number Diff line change 17
17
namespace Microsoft . PowerShell . EditorServices . Handlers
18
18
{
19
19
// TODO: Add IDocumentOnTypeFormatHandler to support on-type formatting.
20
+ // TODO: Use ABCs.
20
21
internal class PsesDocumentFormattingHandlers : IDocumentFormattingHandler , IDocumentRangeFormattingHandler
21
22
{
22
23
private readonly ILogger _logger ;
@@ -39,21 +40,15 @@ public PsesDocumentFormattingHandlers(
39
40
_workspaceService = workspaceService ;
40
41
}
41
42
42
- public DocumentFormattingRegistrationOptions GetRegistrationOptions ( )
43
+ public DocumentFormattingRegistrationOptions GetRegistrationOptions ( DocumentFormattingCapability capability , ClientCapabilities clientCapabilities ) => new DocumentFormattingRegistrationOptions
43
44
{
44
- return new DocumentFormattingRegistrationOptions
45
- {
46
- DocumentSelector = LspUtils . PowerShellDocumentSelector
47
- } ;
48
- }
45
+ DocumentSelector = LspUtils . PowerShellDocumentSelector
46
+ } ;
49
47
50
- DocumentRangeFormattingRegistrationOptions IRegistration < DocumentRangeFormattingRegistrationOptions > . GetRegistrationOptions ( )
48
+ public DocumentRangeFormattingRegistrationOptions GetRegistrationOptions ( DocumentRangeFormattingCapability capability , ClientCapabilities clientCapabilities ) => new DocumentRangeFormattingRegistrationOptions
51
49
{
52
- return new DocumentRangeFormattingRegistrationOptions
53
- {
54
- DocumentSelector = LspUtils . PowerShellDocumentSelector
55
- } ;
56
- }
50
+ DocumentSelector = LspUtils . PowerShellDocumentSelector
51
+ } ;
57
52
58
53
public async Task < TextEditContainer > Handle ( DocumentFormattingParams request , CancellationToken cancellationToken )
59
54
{
You can’t perform that action at this time.
0 commit comments