Skip to content

Add cancellation for textDocument/completion, textDocument/codeAction, textDocument/folding - #1238

Merged
TylerLeonhardt merged 5 commits into
PowerShell:masterfrom
TylerLeonhardt:add-some-cancellation
Mar 26, 2020
Merged

TylerLeonhardt merged 5 commits into
PowerShell:masterfrom
TylerLeonhardt:add-some-cancellation

Conversation

@TylerLeonhardt

@TylerLeonhardt TylerLeonhardt commented Mar 17, 2020 •

Copy link
Copy Markdown
Member

Fixes PowerShell/vscode-powershell#2556
possibly fixes PowerShell/vscode-powershell#2518
possibly fixes PowerShell/vscode-powershell#2522

Probably should wait til a stable release of Omnisharp but they've fixed cancellation and this does feel faster in Adam Driscoll (@adamdriscoll)'s ps1 talked about here: PowerShell/vscode-powershell#2556 (comment)

when testing in that ps1 for a bit I received this number of requests that wanted to be cancelled:

Count Name
----- ----
    3  completionItem/resolve
    7  textDocument/codeAction
    1  textDocument/codeLens
    3  textDocument/completion
    1  textDocument/documentSymbol
   14  textDocument/foldingRange

This PR could cancel 14 + 7 + 3 = 24 out of 29 requests (best case)

@TylerLeonhardt

Copy link
Copy Markdown
Member Author

Codacy Here is an overview of what got changed by this pull request:

Issues
======
+ Solved 5
- Added 4
           

Complexity increasing per file
==============================
- src/PowerShellEditorServices/Services/TextDocument/Handlers/CodeActionHandler.cs  1
- src/PowerShellEditorServices/Services/TextDocument/Handlers/FoldingRangeHandler.cs  1
         

Clones removed
==============
+ src/PowerShellEditorServices/Services/TextDocument/Handlers/DocumentSymbolHandler.cs  -1
+ src/PowerShellEditorServices/Services/TextDocument/Handlers/HoverHandler.cs  -1
+ src/PowerShellEditorServices/Services/TextDocument/Handlers/DefinitionHandler.cs  -1
+ src/PowerShellEditorServices/Services/Workspace/Handlers/WorkspaceSymbolsHandler.cs  -1
+ src/PowerShellEditorServices/Services/TextDocument/Handlers/CompletionHandler.cs  -1
+ src/PowerShellEditorServices/Services/TextDocument/Handlers/FoldingRangeHandler.cs  -1
         

See the complete overview on Codacy

}
public TextDocumentRegistrationOptions GetRegistrationOptions()

public FoldingRangeRegistrationOptions GetRegistrationOptions()

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

}

public TextDocumentRegistrationOptions GetRegistrationOptions()
public DocumentFormattingRegistrationOptions GetRegistrationOptions()

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

};
}

DocumentRangeFormattingRegistrationOptions IRegistration<DocumentRangeFormattingRegistrationOptions>.GetRegistrationOptions()

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

}

public TextDocumentRegistrationOptions GetRegistrationOptions()
public DocumentHighlightRegistrationOptions GetRegistrationOptions()

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@TylerLeonhardt

Copy link
Copy Markdown
Member Author

apparently prereleases are also signed so we can go with this.

@TylerLeonhardt
TylerLeonhardt marked this pull request as ready for review March 26, 2020 18:59
@TylerLeonhardt
TylerLeonhardt merged commit 41bf246 into PowerShell:master Mar 26, 2020
@TylerLeonhardt
TylerLeonhardt deleted the add-some-cancellation branch March 26, 2020 19:04
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Code Collapsing is in the wrong place Auto-completion fails due to performance issues Unfolding not always possible

3 participants