-
Notifications
You must be signed in to change notification settings - Fork 236
Add cancellation for textDocument/completion
, textDocument/codeAction
, textDocument/folding
#1238
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changes from all commits
29bf123
e9acba9
78addec
d711f99
d90ea75
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -30,16 +30,22 @@ public FoldingRangeHandler(ILoggerFactory factory, ConfigurationService configur | |
_configurationService = configurationService; | ||
_workspaceService = workspaceService; | ||
} | ||
public TextDocumentRegistrationOptions GetRegistrationOptions() | ||
|
||
public FoldingRangeRegistrationOptions GetRegistrationOptions() | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
|
||
{ | ||
return new TextDocumentRegistrationOptions() | ||
return new FoldingRangeRegistrationOptions | ||
{ | ||
DocumentSelector = LspUtils.PowerShellDocumentSelector, | ||
DocumentSelector = LspUtils.PowerShellDocumentSelector | ||
}; | ||
} | ||
|
||
public Task<Container<FoldingRange>> Handle(FoldingRangeRequestParam request, CancellationToken cancellationToken) | ||
{ | ||
if (cancellationToken.IsCancellationRequested) | ||
{ | ||
return Task.FromResult(new Container<FoldingRange>()); | ||
} | ||
|
||
// TODO Should be using dynamic registrations | ||
if (!_configurationService.CurrentSettings.CodeFolding.Enable) { return null; } | ||
|
||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -8,6 +8,7 @@ | |
using Microsoft.Extensions.Logging; | ||
using Microsoft.PowerShell.EditorServices.Services; | ||
using Microsoft.PowerShell.EditorServices.Utility; | ||
using OmniSharp.Extensions.LanguageServer.Protocol; | ||
using OmniSharp.Extensions.LanguageServer.Protocol.Client.Capabilities; | ||
using OmniSharp.Extensions.LanguageServer.Protocol.Models; | ||
using OmniSharp.Extensions.LanguageServer.Protocol.Server; | ||
|
@@ -37,9 +38,17 @@ public DocumentFormattingHandlers( | |
_workspaceService = workspaceService; | ||
} | ||
|
||
public TextDocumentRegistrationOptions GetRegistrationOptions() | ||
public DocumentFormattingRegistrationOptions GetRegistrationOptions() | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
|
||
{ | ||
return new TextDocumentRegistrationOptions | ||
return new DocumentFormattingRegistrationOptions | ||
{ | ||
DocumentSelector = LspUtils.PowerShellDocumentSelector | ||
}; | ||
} | ||
|
||
DocumentRangeFormattingRegistrationOptions IRegistration<DocumentRangeFormattingRegistrationOptions>.GetRegistrationOptions() | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
|
||
{ | ||
return new DocumentRangeFormattingRegistrationOptions | ||
{ | ||
DocumentSelector = LspUtils.PowerShellDocumentSelector | ||
}; | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.