-
Notifications
You must be signed in to change notification settings - Fork 247
Fix a lot of IntelliSense issues #1799
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 1 commit
5df33bb
a991beb
591c77e
bdb8343
687026f
f31c1c2
8da0b79
220dd1a
1199612
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
That way any completion results from custom argument completers can be cancelled if they take too long and the user keeps typing.
- Loading branch information
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -14,6 +14,7 @@ | |
| using Microsoft.Extensions.Logging; | ||
| using Microsoft.PowerShell.EditorServices.Services.PowerShell; | ||
| using Microsoft.PowerShell.EditorServices.Services.PowerShell.Execution; | ||
| using Microsoft.PowerShell.EditorServices.Services.PowerShell.Host; | ||
|
|
||
| namespace Microsoft.PowerShell.EditorServices.Services.Symbols | ||
| { | ||
|
|
@@ -92,6 +93,34 @@ await executionService.ExecuteDelegateAsync( | |
| (pwsh, _) => | ||
| { | ||
| stopwatch.Start(); | ||
|
|
||
| // If the current runspace is not out of process, then we call TabExpansion2 so | ||
| // that we have the ability to issue pipeline stop requests on cancellation. | ||
| if (executionService is PsesInternalHost psesInternalHost | ||
|
Member
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. Oof, I would happily remove the
Collaborator
Author
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. Yeah either the sync task itself needs to reference Maybe we hold off on tackling that until we get a source generator that handles the interface definitions for us? 🤷 |
||
| && !psesInternalHost.Runspace.RunspaceIsRemote) | ||
| { | ||
| IReadOnlyList<CommandCompletion> completionResults = new SynchronousPowerShellTask<CommandCompletion>( | ||
| logger, | ||
| psesInternalHost, | ||
| new PSCommand() | ||
| .AddCommand("TabExpansion2") | ||
| .AddParameter("ast", scriptAst) | ||
| .AddParameter("tokens", currentTokens) | ||
| .AddParameter("positionOfCursor", cursorPosition), | ||
| executionOptions: null, | ||
| cancellationToken) | ||
| .ExecuteAndGetResult(cancellationToken); | ||
|
|
||
| if (completionResults is { Count: > 0 }) | ||
| { | ||
| commandCompletion = completionResults[0]; | ||
| } | ||
|
|
||
| return; | ||
| } | ||
|
|
||
| // If the current runspace is out of process, we can't call TabExpansion2 | ||
| // because the output will be serialized. | ||
| commandCompletion = CommandCompletion.CompleteInput( | ||
| scriptAst, | ||
| currentTokens, | ||
|
|
||
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.
🥳