-
Notifications
You must be signed in to change notification settings - Fork 473
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
Completions don't work in a completely empty script file #4909
Comments
@MartinGC94 is the new empty file set to PowerShell language? |
@andyleejordan Yes. I get completions as soon as I press space, but if I backspace and press Ctrl+Space the results are empty. |
Interesting. Have you tried other languages, like can you get C# completions in an empty file? I'm wondering if it's a VS Code thing in general or something we're doing. |
I just tried opening an empty .cs file and I got keyword completions so it must be related to the extension/editor services. |
@MartinGC94 in the latest extension prerelease version there's a language server EDIT: Sorry I forgot that change hasn't landed yet, you can install this latest commit VSIX: |
Also this step in your repro process:
I'm not 100% the LSP is gonna use that pwsh instance with the language client once you do that? @andyleejordan? |
Good to know, we'll take a look at it. |
No, not it is not. Good catch 😄 |
@JustinGrote Logs:
[Trace - 7:42:59 PM] Sending request 'textDocument/completion - (62)'.
Params: {
"textDocument": {
"uri": "untitled:Untitled-1"
},
"position": {
"line": 0,
"character": 0
},
"context": {
"triggerKind": 1
}
}
[Trace - 7:42:59 PM] Received notification 'window/logMessage'. OmniSharp.Extensions.LanguageServer.Shared.LspRequestRouter: Finding descriptors for textDocument/completion | Method='textDocument/completion' OmniSharp.Extensions.LanguageServer.Server.Matchers.TextDocumentMatcher: Found attributes 1, powershell::untitled:Untitled-1 | Count='1' Attributes='System.Linq.Enumerable+SelectListIterator`2[OmniSharp.Extensions.LanguageServer.Protocol.Document.TextDocumentAttributes,System.String]' OmniSharp.Extensions.LanguageServer.Server.Matchers.TextDocumentMatcher: Looking for handler for descriptors textDocument/completion | Method='textDocument/completion' OmniSharp.Extensions.LanguageServer.Server.Matchers.TextDocumentMatcher: Checking handler textDocument/completion:Microsoft.PowerShell.EditorServices.Handlers.PsesCompletionHandler | Method='textDocument/completion' Handler='Microsoft.PowerShell.EditorServices.Handlers.PsesCompletionHandler' OmniSharp.Extensions.LanguageServer.Server.Matchers.TextDocumentMatcher: Registration options OmniSharp.Extensions.LanguageServer.Protocol.Models.CompletionRegistrationOptions | OptionsName='OmniSharp.Extensions.LanguageServer.Protocol.Models.CompletionRegistrationOptions' OmniSharp.Extensions.LanguageServer.Server.Matchers.TextDocumentMatcher: Document Selector [powershell], [pwsh], [ps1], [psm1], [psd1], [/.ps1] | TextDocumentSelector='[powershell], [pwsh], [ps1], [psm1], [psd1], [/.ps1]' OmniSharp.Extensions.LanguageServer.Server.Matchers.TextDocumentMatcher: Handler Selected: Microsoft.PowerShell.EditorServices.Handlers.PsesCompletionHandler a6035ec2-abc9-44d3-8fcb-08735ce619ba via [powershell], [pwsh], [ps1], [psm1], [psd1], [**/.ps1] (targeting OmniSharp.Extensions.JsonRpc.IJsonRpcRequestHandler OmniSharp.Extensions.JsonRpc.ProcessScheduler: Swapping from Parallel to Serial | From='Parallel' To='Serial' OmniSharp.Extensions.JsonRpc.ProcessScheduler: Cancelling any outstanding requests (switch from parallel to serial) | OmniSharp.Extensions.JsonRpc.ProcessScheduler: Completing existing request process type Parallel | Type='Parallel' OmniSharp.Extensions.JsonRpc.ProcessScheduler: Queueing Serial:textDocument/completion:62 request for processing | Type='Serial' Name='textDocument/completion:62' OmniSharp.Extensions.JsonRpc.DefaultRequestInvoker: Starting: Processing request textDocument/completion 62 | Method='textDocument/completion' ResponseId='62' OmniSharp.Extensions.LanguageServer.Shared.LspRequestRouter: Starting: Routing Request (62) textDocument/completion | Id='62' Method='textDocument/completion' OmniSharp.Extensions.LanguageServer.Shared.LspRequestRouter: Converting params for Request (62) textDocument/completion to OmniSharp.Extensions.LanguageServer.Protocol.Models.CompletionParams | Id='62' Method='textDocument/completion' Type='OmniSharp.Extensions.LanguageServer.Protocol.Models.CompletionParams' OmniSharp.Extensions.LanguageServer.Shared.LspRequestRouter: Converting params for Notification textDocument/completion to OmniSharp.Extensions.LanguageServer.Protocol.Models.CompletionParams | Method='textDocument/completion' Type='OmniSharp.Extensions.LanguageServer.Protocol.Models.CompletionParams' Microsoft.PowerShell.EditorServices.Handlers.PsesCompletionHandler: Getting completions at offset 0 (line: 1, column: 1) | Microsoft.PowerShell.EditorServices.Handlers.PsesCompletionHandler: IntelliSense completed in 0ms - WordToComplete: "(null)" MatchCount: 0 | elapsed='0' word='' count='0' OmniSharp.Extensions.LanguageServer.Server.Pipelines.ResolveCommandPipeline: Updating Resolve items with wrapped data for textDocument/completion:Microsoft.PowerShell.EditorServices.Handlers.PsesCompletionHandler | Method='textDocument/completion' Handler='Microsoft.PowerShell.EditorServices.Handlers.PsesCompletionHandler' OmniSharp.Extensions.LanguageServer.Shared.LspRequestRouter: Response value was OmniSharp.Extensions.LanguageServer.Protocol.Models.CompletionList | Type='OmniSharp.Extensions.LanguageServer.Protocol.Models.CompletionList' OmniSharp.Extensions.LanguageServer.Shared.LspRequestRouter: Finished: Routing Request (62) textDocument/completion in 71ms | Id='62' Method='textDocument/completion' ElapsedMilliseconds='71' OmniSharp.Extensions.JsonRpc.DefaultRequestInvoker: Finished: Processing request textDocument/completion 62 in 71ms | Method='textDocument/completion' ResponseId='62' ElapsedMilliseconds='71' To my untrained eyes there's nothing interesting in that log. As for |
Prerequisites
Summary
In this PR: PowerShell/PowerShell#21171 I've added the ability to complete keywords without having to write a partial name, this works great except when the file is completely empty in VS code. The console host and even ISE handles completely empty input without any problems.
PowerShell Version
Visual Studio Code Version
Extension Version
ms-vscode.powershell@2024.0.0
Steps to Reproduce
$pid
Enter-PSHostProcess <PID from before>
Visuals
No response
Logs
No response
The text was updated successfully, but these errors were encountered: