Vscode-powershell: Killing the PSIC generates an error

Created on 5 Jun 2017  路  3Comments  路  Source: PowerShell/vscode-powershell

System Details

  • Operating system name and version: Windows 10 CU
  • VS Code version: 1.12.2
  • PowerShell extension version: 1.2.1
  • Output from $PSVersionTable: 5.1.15063.296

Issue Description

Fire up VSCode and open a PS file. After the PSIC has started, press the trash can icon to kill the terminal. You get this error:

image

Expected: this should shutdown the PSIC cleanly with no VSCode errors.

Attached Logs

[21:9:32] Language server starting...
powershell.exe started --
    exe: C:\WINDOWS\Sysnative\WindowsPowerShell\v1.0\powershell.exe
    pid: 48388
    args: C:\Users\Keith\.vscode\extensions\ms-vscode.powershell-1.2.1\scripts\Start-EditorServices.ps1 -EditorServicesVersion '1.2.1' -HostName 'Visual Studio Code Host' -HostProfileId 'Microsoft.VSCode' -HostVersion '1.2.1' -BundledModulesPath 'C:\Users\Keith\.vscode\extensions\ms-vscode.powershell-1.2.1\modules' -EnableConsoleRepl -WaitForDebugger -LogLevel 'Verbose' -LogPath 'C:\Users\Keith\.vscode\extensions\ms-vscode.powershell-1.2.1\logs\1496632172-f1e7347b-677f-4cd5-a5b2-76aaa4cca5591496603001087\EditorServices.log' -SessionDetailsPath 'C:\Users\Keith\.vscode\extensions\ms-vscode.powershell-1.2.1\sessions\PSES-VSCode-47740-924917' -FeatureFlags @()


[21:9:34] Language server started.
{"debugServicePort":21724,"status":"started","channel":"tcp","languageServicePort":16506}
Connecting to language service on port 16506...

Language service connected.

powershell.exe terminated or terminal UI was closed


powershell.exe terminated or terminal UI was closed


powershell.exe terminated or terminal UI was closed
6/4/2017 9:09:35 PM [VERBOSE] - Method "ReadMessage" at line 111 of C:\projects\powershelleditorservices\src\PowerShellEditorServices.Protocol\MessageProtocol\MessageReader.cs

    READ MESSAGE:

    {
      "jsonrpc": "2.0",
      "method": "$/cancelRequest",
      "params": {
        "id": 3
      }
    }

6/4/2017 9:09:35 PM [ERROR] - Method "DispatchMessage" at line 142 of C:\projects\powershelleditorservices\src\PowerShellEditorServices.Protocol\MessageProtocol\MessageDispatcher.cs

    MessageDispatcher: No handler registered for Event type '$/cancelRequest'

6/4/2017 9:09:35 PM [VERBOSE] - Method "OnSessionStateChanged" at line 1095 of C:\projects\powershelleditorservices\src\PowerShellEditorServices\Session\PowerShellContext.cs

    Session state changed --

        Old state: Running
        New state: Ready
        Result: Completed

6/4/2017 9:09:35 PM [VERBOSE] - Method "ExecuteCommand" at line 511 of C:\projects\powershelleditorservices\src\PowerShellEditorServices\Session\PowerShellContext.cs

    Execution completed successfully.

6/4/2017 9:09:36 PM [VERBOSE] - Method "DelayThenInvokeDiagnostics" at line 1407 of C:\projects\powershelleditorservices\src\PowerShellEditorServices.Protocol\Server\LanguageServer.cs

    Analyzing script file: c:\Users\Keith\Documents\WindowsPowerShell\Modules\Pester\4.0.3\Functions\It.ps1

6/4/2017 9:09:37 PM [VERBOSE] - Method "GetDiagnosticRecordsAsync" at line 383 of C:\projects\powershelleditorservices\src\PowerShellEditorServices\Analysis\AnalysisService.cs

    Found 0 violations

6/4/2017 9:09:37 PM [VERBOSE] - Method "DelayThenInvokeDiagnostics" at line 1411 of C:\projects\powershelleditorservices\src\PowerShellEditorServices.Protocol\Server\LanguageServer.cs

    Analysis complete.

6/4/2017 9:09:37 PM [VERBOSE] - Method "WriteMessage" at line 59 of C:\projects\powershelleditorservices\src\PowerShellEditorServices.Protocol\MessageProtocol\MessageWriter.cs

    WRITE MESSAGE:

    {
      "jsonrpc": "2.0",
      "method": "textDocument/publishDiagnostics",
      "params": {
        "uri": "file:///c%3A/Users/Keith/Documents/WindowsPowerShell/Modules/Pester/4.0.3/Functions/It.ps1",
        "diagnostics": []
      }
    }
Area-Integrated Console Issue-Bug

All 3 comments

The problem here is that I have no way of knowing whether the user clicked the trashcan. The only notification I get (for now) is that the terminal closed and it looks the same whether the process crashed or the user closed it. I'll see if I can get them to add an indicator to the event that describes what happened.

@daviwil Is there a VSCode issue we can upvote, for the notification?

This issue is the expected behavior and I don't think we should change it. The PSIC provides all the language features for the PowerShell extension behind the scenes and we already have a mechanism to hide it at start up if you don't want to see it so I'm going to close this.

If anyone disagrees, please let us know!

Was this page helpful?
0 / 5 - 0 ratings