Skip to content

[Preview] Never ending formatting #3800

Closed
@PrzemyslawKlys

Description

@PrzemyslawKlys
Contributor

Prerequisites

  • I have written a descriptive issue title.
    I have searched all issues to ensure it has not already been reported.
    I have read the troubleshooting guide.
    I am sure this issue is with the extension itself and does not reproduce in a standalone PowerShell instance.
    I have verified that I am using the latest version of Visual Studio Code and the PowerShell extension.

Summary

I've been coding all day and suddenly - not sure what I did but I couldn't format anymore.

Stuck

After that - nothing works. Restarting helped

PowerShell Version

Name                           Value
----                           -----
PSVersion                      7.3.0-preview.1
PSEdition                      Core
GitCommitId                    7.3.0-preview.1
OS                             Microsoft Windows 10.0.22000
Platform                       Win32NT
PSCompatibleVersions           {1.0, 2.0, 3.0, 4.0…}
PSRemotingProtocolVersion      2.3
SerializationVersion           1.1.0.1
WSManStackVersion              3.0

Visual Studio Code Version

1.63.2
899d46d82c4c95423fb7e10e68eba52050e30ba3
x64

Extension Version

ms-vscode.powershell@2021.12.0
ms-vscode.powershell-preview@2022.1.1
tobysmith568.run-in-powershell@1.1.1
TylerLeonhardt.vscode-inline-values-powershell@0.0.5

Steps to Reproduce

Happened randomly during formatting

Visuals

No response

Logs

1643479538-9d087c75-4b26-4436-a88e-2ffd9e2962ef1643453184506.zip

2022-01-29 20:45:33.599 +01:00 [VRB] Looking for handler for descriptors textDocument/codeAction
2022-01-29 20:45:33.599 +01:00 [VRB] Checking handler textDocument/codeAction:Microsoft.PowerShell.EditorServices.Handlers.PsesCodeActionHandler
2022-01-29 20:45:33.599 +01:00 [VRB] Registration options OmniSharp.Extensions.LanguageServer.Protocol.Models.CodeActionRegistrationOptions
2022-01-29 20:45:33.599 +01:00 [VRB] Document Selector [powershell], [pwsh], [ps1], [psm1], [psd1], [**/*.ps*1]
2022-01-29 20:45:33.599 +01:00 [VRB] Handler Selected: Microsoft.PowerShell.EditorServices.Handlers.PsesCodeActionHandler d204ebb8-aa92-4314-98b9-b21c6694bfc8 via [powershell], [pwsh], [ps1], [psm1], [psd1], [**/*.ps*1] (targeting OmniSharp.Extensions.JsonRpc.IJsonRpcRequestHandler`2[[OmniSharp.Extensions.LanguageServer.Protocol.Models.CodeActionParams, OmniSharp.Extensions.LanguageProtocol, Version=0.19.0.0, Culture=neutral, PublicKeyToken=6d868dff454e6022],[OmniSharp.Extensions.LanguageServer.Protocol.Models.CommandOrCodeActionContainer, OmniSharp.Extensions.LanguageProtocol, Version=0.19.0.0, Culture=neutral, PublicKeyToken=6d868dff454e6022]])
2022-01-29 20:45:33.599 +01:00 [DBG] Queueing "Parallel":textDocument/codeAction:5110 request for processing
2022-01-29 20:45:33.599 +01:00 [DBG] Starting: Processing request textDocument/codeAction 5110
2022-01-29 20:45:33.599 +01:00 [DBG] Starting: Routing Request (5110) textDocument/codeAction
2022-01-29 20:45:33.599 +01:00 [VRB] Converting params for Request (5110) textDocument/codeAction to OmniSharp.Extensions.LanguageServer.Protocol.Models.CodeActionParams
2022-01-29 20:45:33.599 +01:00 [VRB] Converting params for Notification textDocument/codeAction to OmniSharp.Extensions.LanguageServer.Protocol.Models.CodeActionParams
2022-01-29 20:45:33.599 +01:00 [VRB] Updating Resolve items with wrapped data for textDocument/codeAction:Microsoft.PowerShell.EditorServices.Handlers.PsesCodeActionHandler
2022-01-29 20:45:33.600 +01:00 [VRB] Response value was OmniSharp.Extensions.LanguageServer.Protocol.Models.CommandOrCodeActionContainer
2022-01-29 20:45:33.600 +01:00 [DBG] Finished: Routing Request (5110) textDocument/codeAction in 0ms
2022-01-29 20:45:33.600 +01:00 [DBG] Finished: Processing request textDocument/codeAction 5110 in 0ms
2022-01-29 20:45:33.794 +01:00 [VRB] Named pipe connected
2022-01-29 20:45:33.794 +01:00 [VRB] Recreating debug adapter
2022-01-29 20:45:33.794 +01:00 [VRB] Subscribing debug server for session ended event
2022-01-29 20:45:33.794 +01:00 [VRB] Starting debug server
2022-01-29 20:45:33.808 +01:00 [INF] Host starting
2022-01-29 20:45:33.808 +01:00 [DBG] Host start requested after already started.
2022-01-29 20:45:43.270 +01:00 [DBG] Debug session ended, restarting debug service...
2022-01-29 20:45:43.270 +01:00 [VRB] Restarting debug server
2022-01-29 20:45:43.270 +01:00 [VRB] Recreating debug adapter transport
2022-01-29 20:45:43.270 +01:00 [VRB] Creating named pipe
2022-01-29 20:45:43.270 +01:00 [VRB] Waiting for named pipe connection
2022-01-29 20:48:35.479 +01:00 [VRB] Could not write to output handler, perhaps serialization failed?
System.Threading.Channels.ChannelClosedException: The channel has been closed.
   at System.Threading.Channels.AsyncOperation`1.GetResult(Int16 token)
   at OmniSharp.Extensions.JsonRpc.OutputHandler.ProcessOutputStream(CancellationToken cancellationToken)

Activity

ghost added
Needs: TriageMaintainer attention needed!
on Jan 29, 2022
JustinGrote

JustinGrote commented on Jan 29, 2022

@JustinGrote
Collaborator

I've had the formatter hang on me a couple times but not for long, worth looking into.

dbrennand

dbrennand commented on Sep 20, 2022

@dbrennand

Hi, I'm seeing this exact exception, but intellisense and F8 also stop working when this exception appears in the extension logs:

2022-09-20 16:17:35.956 +01:00 [VRB] Could not write to output handler, perhaps serialization failed?
System.Threading.Channels.ChannelClosedException: The channel has been closed.
   at System.Threading.Channels.AsyncOperation`1.GetResult(Int16 token)
   at OmniSharp.Extensions.JsonRpc.OutputHandler.ProcessOutputStream(CancellationToken cancellationToken)

@PrzemyslawKlys Did you ever fix this problem?

Thanks 🙂

PrzemyslawKlys

PrzemyslawKlys commented on Sep 20, 2022

@PrzemyslawKlys
ContributorAuthor

I use newest preview. Havent had issues since months

dbrennand

dbrennand commented on Sep 21, 2022

@dbrennand

Hmmm, OK thanks @PrzemyslawKlys - Are you using PowerShell 7.2.6 and may I ask what version of the PSReadLine module do you have?

I read in issue #3393 that PSReadLine may be causing the exception?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

      Development

      No branches or pull requests

        Participants

        @PrzemyslawKlys@JustinGrote@StevenBucher98@dbrennand

        Issue actions

          [Preview] Never ending formatting · Issue #3800 · PowerShell/vscode-powershell