PowerShell / vscode-powershell

Provides PowerShell language and debugging support for Visual Studio Code
https://marketplace.visualstudio.com/items/ms-vscode.PowerShell
MIT License
1.71k stars 488 forks source link

Intellisense loss after debugging #2364

Closed rjmholt closed 4 years ago

rjmholt commented 4 years ago
foreach ($str in 'hi','there','friend','i','like','you')
{ # <-- breakpoint here
    Write-Host $str
}

From the message log:


[Info  - 12:16:16 PM] Starting: Routing Notification textDocument/didChange
[Trace - 12:16:16 PM] Received notification 'window/logMessage'.
Params: {
    "type": 3,
    "message": "Converting params for Notification textDocument/didChange to OmniSharp.Extensions.LanguageServer.Protocol.Models.DidChangeTextDocumentParams"
}

[Info  - 12:16:16 PM] Converting params for Notification textDocument/didChange to OmniSharp.Extensions.LanguageServer.Protocol.Models.DidChangeTextDocumentParams
[Trace - 12:16:16 PM] Received notification 'window/logMessage'.
Params: {
    "type": 3,
    "message": "Resolved path: c:\\Users\\roholt\\OneDrive - Microsoft\\Dev\\sandbox\\asmDeps.ps1"
}

[Info  - 12:16:16 PM] Resolved path: c:\Users\roholt\OneDrive - Microsoft\Dev\sandbox\asmDeps.ps1
[Trace - 12:16:16 PM] Received notification 'textDocument/publishDiagnostics'.
Params: {
    "uri": "file:///c%3A/Users/roholt/OneDrive - Microsoft/Dev/sandbox/asmDeps.ps1",
    "diagnostics": []
}

[Trace - 12:16:16 PM] Received notification 'window/logMessage'.
Params: {
    "type": 3,
    "message": "Finished: Routing Notification textDocument/didChange in 0ms"
}

[Info  - 12:16:16 PM] Finished: Routing Notification textDocument/didChange in 0ms
[Trace - 12:16:16 PM] Sending request 'textDocument/documentHighlight - (14)'.
Params: {
    "textDocument": {
        "uri": "file:///c%3A/Users/roholt/OneDrive%20-%20Microsoft/Dev/sandbox/asmDeps.ps1"
    },
    "position": {
        "line": 5,
        "character": 3
    }
}

[Trace - 12:16:16 PM] Sending request 'textDocument/completion - (15)'.
Params: {
    "textDocument": {
        "uri": "file:///c%3A/Users/roholt/OneDrive%20-%20Microsoft/Dev/sandbox/asmDeps.ps1"
    },
    "position": {
        "line": 5,
        "character": 3
    },
    "context": {
        "triggerKind": 1
    }
}

[Trace - 12:16:16 PM] Received notification 'window/logMessage'.
Params: {
    "type": 3,
    "message": "Finding descriptor for textDocument/documentHighlight"
}

[Info  - 12:16:16 PM] Finding descriptor for textDocument/documentHighlight
[Trace - 12:16:16 PM] Received notification 'window/logMessage'.
Params: {
    "type": 3,
    "message": "Found attributes 1, powershell::file:///c%3A/Users/roholt/OneDrive - Microsoft/Dev/sandbox/asmDeps.ps1"
}

[Info  - 12:16:16 PM] Found attributes 1, powershell::file:///c%3A/Users/roholt/OneDrive - Microsoft/Dev/sandbox/asmDeps.ps1
[Trace - 12:16:16 PM] Received notification 'window/logMessage'.
Params: {
    "type": 3,
    "message": "Looking for handler for descriptors textDocument/documentHighlight"
}

[Info  - 12:16:16 PM] Looking for handler for descriptors textDocument/documentHighlight
[Trace - 12:16:16 PM] Received notification 'window/logMessage'.
Params: {
    "type": 3,
    "message": "Checking handler textDocument/documentHighlight:Microsoft.PowerShell.EditorServices.Handlers.DocumentHighlightHandler"
}

[Info  - 12:16:16 PM] Checking handler textDocument/documentHighlight:Microsoft.PowerShell.EditorServices.Handlers.DocumentHighlightHandler
[Trace - 12:16:16 PM] Received notification 'window/logMessage'.
Params: {
    "type": 3,
    "message": "Registration options OmniSharp.Extensions.LanguageServer.Protocol.Models.TextDocumentRegistrationOptions"
}

[Info  - 12:16:16 PM] Registration options OmniSharp.Extensions.LanguageServer.Protocol.Models.TextDocumentRegistrationOptions
[Trace - 12:16:16 PM] Received notification 'window/logMessage'.
Params: {
    "type": 3,
    "message": "Document Selector [powershell]"
}

[Info  - 12:16:16 PM] Document Selector [powershell]
[Trace - 12:16:16 PM] Received notification 'window/logMessage'.
Params: {
    "type": 3,
    "message": "Handler Selected: Microsoft.PowerShell.EditorServices.Handlers.DocumentHighlightHandler via [powershell] (targeting OmniSharp.Extensions.JsonRpc.IJsonRpcRequestHandler`2[[OmniSharp.Extensions.LanguageServer.Protocol.Models.DocumentHighlightParams, OmniSharp.Extensions.LanguageProtocol, Version=0.14.0.0, Culture=neutral, PublicKeyToken=6d868dff454e6022],[OmniSharp.Extensions.LanguageServer.Protocol.Models.DocumentHighlightContainer, OmniSharp.Extensions.LanguageProtocol, Version=0.14.0.0, Culture=neutral, PublicKeyToken=6d868dff454e6022]])"
}

[Info  - 12:16:16 PM] Handler Selected: Microsoft.PowerShell.EditorServices.Handlers.DocumentHighlightHandler via [powershell] (targeting OmniSharp.Extensions.JsonRpc.IJsonRpcRequestHandler`2[[OmniSharp.Extensions.LanguageServer.Protocol.Models.DocumentHighlightParams, OmniSharp.Extensions.LanguageProtocol, Version=0.14.0.0, Culture=neutral, PublicKeyToken=6d868dff454e6022],[OmniSharp.Extensions.LanguageServer.Protocol.Models.DocumentHighlightContainer, OmniSharp.Extensions.LanguageProtocol, Version=0.14.0.0, Culture=neutral, PublicKeyToken=6d868dff454e6022]])
[Trace - 12:16:16 PM] Received notification 'window/logMessage'.
Params: {
    "type": 3,
    "message": "Starting: Routing Request (14) textDocument/documentHighlight"
}

[Info  - 12:16:16 PM] Starting: Routing Request (14) textDocument/documentHighlight
[Trace - 12:16:16 PM] Received notification 'window/logMessage'.
Params: {
    "type": 3,
    "message": "Converting params for Request (14) textDocument/documentHighlight to OmniSharp.Extensions.LanguageServer.Protocol.Models.DocumentHighlightParams"
}

[Info  - 12:16:16 PM] Converting params for Request (14) textDocument/documentHighlight to OmniSharp.Extensions.LanguageServer.Protocol.Models.DocumentHighlightParams
[Trace - 12:16:16 PM] Received notification 'window/logMessage'.
Params: {
    "type": 3,
    "message": "Resolved path: c:\\Users\\roholt\\OneDrive - Microsoft\\Dev\\sandbox\\asmDeps.ps1"
}

[Info  - 12:16:16 PM] Resolved path: c:\Users\roholt\OneDrive - Microsoft\Dev\sandbox\asmDeps.ps1
[Trace - 12:16:16 PM] Received notification 'window/logMessage'.
Params: {
    "type": 3,
    "message": "Result was System.Threading.Tasks.Task`1[[OmniSharp.Extensions.LanguageServer.Protocol.Models.DocumentHighlightContainer, OmniSharp.Extensions.LanguageProtocol, Version=0.14.0.0, Culture=neutral, PublicKeyToken=6d868dff454e6022]]"
}

[Info  - 12:16:16 PM] Result was System.Threading.Tasks.Task`1[[OmniSharp.Extensions.LanguageServer.Protocol.Models.DocumentHighlightContainer, OmniSharp.Extensions.LanguageProtocol, Version=0.14.0.0, Culture=neutral, PublicKeyToken=6d868dff454e6022]]
[Trace - 12:16:16 PM] Received notification 'window/logMessage'.
Params: {
    "type": 3,
    "message": "Response value was OmniSharp.Extensions.LanguageServer.Protocol.Models.DocumentHighlightContainer"
}

[Info  - 12:16:16 PM] Response value was OmniSharp.Extensions.LanguageServer.Protocol.Models.DocumentHighlightContainer
[Trace - 12:16:16 PM] Received notification 'window/logMessage'.
Params: {
    "type": 3,
    "message": "Finished: Routing Request (14) textDocument/documentHighlight in 0ms"
}

[Info  - 12:16:16 PM] Finished: Routing Request (14) textDocument/documentHighlight in 0ms
[Trace - 12:16:16 PM] Received response 'textDocument/documentHighlight - (14)' in 5ms.
Result: [
    {
        "range": {
            "start": {
                "line": 5,
                "character": 0
            },
            "end": {
                "line": 5,
                "character": 3
            }
        },
        "kind": 3
    }
]

[Trace - 12:16:16 PM] Received notification 'window/logMessage'.
Params: {
    "type": 3,
    "message": "Finding descriptor for textDocument/completion"
}

[Info  - 12:16:16 PM] Finding descriptor for textDocument/completion
[Trace - 12:16:16 PM] Received notification 'window/logMessage'.
Params: {
    "type": 3,
    "message": "Found attributes 1, powershell::file:///c%3A/Users/roholt/OneDrive - Microsoft/Dev/sandbox/asmDeps.ps1"
}

[Info  - 12:16:16 PM] Found attributes 1, powershell::file:///c%3A/Users/roholt/OneDrive - Microsoft/Dev/sandbox/asmDeps.ps1
[Trace - 12:16:16 PM] Received notification 'window/logMessage'.
Params: {
    "type": 3,
    "message": "Looking for handler for descriptors textDocument/completion"
}

[Info  - 12:16:16 PM] Looking for handler for descriptors textDocument/completion
[Trace - 12:16:16 PM] Received notification 'window/logMessage'.
Params: {
    "type": 3,
    "message": "Checking handler textDocument/completion:Microsoft.PowerShell.EditorServices.Handlers.CompletionHandler"
}

[Info  - 12:16:16 PM] Checking handler textDocument/completion:Microsoft.PowerShell.EditorServices.Handlers.CompletionHandler
[Trace - 12:16:16 PM] Received notification 'window/logMessage'.
Params: {
    "type": 3,
    "message": "Registration options OmniSharp.Extensions.LanguageServer.Protocol.Models.CompletionRegistrationOptions"
}

[Info  - 12:16:16 PM] Registration options OmniSharp.Extensions.LanguageServer.Protocol.Models.CompletionRegistrationOptions
[Trace - 12:16:16 PM] Received notification 'window/logMessage'.
Params: {
    "type": 3,
    "message": "Document Selector [powershell]"
}

[Info  - 12:16:16 PM] Document Selector [powershell]
[Trace - 12:16:16 PM] Received notification 'window/logMessage'.
Params: {
    "type": 3,
    "message": "Handler Selected: Microsoft.PowerShell.EditorServices.Handlers.CompletionHandler via [powershell] (targeting OmniSharp.Extensions.JsonRpc.IJsonRpcRequestHandler`2[[OmniSharp.Extensions.LanguageServer.Protocol.Models.CompletionParams, OmniSharp.Extensions.LanguageProtocol, Version=0.14.0.0, Culture=neutral, PublicKeyToken=6d868dff454e6022],[OmniSharp.Extensions.LanguageServer.Protocol.Models.CompletionList, OmniSharp.Extensions.LanguageProtocol, Version=0.14.0.0, Culture=neutral, PublicKeyToken=6d868dff454e6022]])"
}

[Info  - 12:16:16 PM] Handler Selected: Microsoft.PowerShell.EditorServices.Handlers.CompletionHandler via [powershell] (targeting OmniSharp.Extensions.JsonRpc.IJsonRpcRequestHandler`2[[OmniSharp.Extensions.LanguageServer.Protocol.Models.CompletionParams, OmniSharp.Extensions.LanguageProtocol, Version=0.14.0.0, Culture=neutral, PublicKeyToken=6d868dff454e6022],[OmniSharp.Extensions.LanguageServer.Protocol.Models.CompletionList, OmniSharp.Extensions.LanguageProtocol, Version=0.14.0.0, Culture=neutral, PublicKeyToken=6d868dff454e6022]])
[Trace - 12:16:16 PM] Received notification 'window/logMessage'.
Params: {
    "type": 3,
    "message": "Starting: Routing Request (15) textDocument/completion"
}

[Info  - 12:16:16 PM] Starting: Routing Request (15) textDocument/completion
[Trace - 12:16:16 PM] Received notification 'window/logMessage'.
Params: {
    "type": 3,
    "message": "Converting params for Request (15) textDocument/completion to OmniSharp.Extensions.LanguageServer.Protocol.Models.CompletionParams"
}

[Info  - 12:16:16 PM] Converting params for Request (15) textDocument/completion to OmniSharp.Extensions.LanguageServer.Protocol.Models.CompletionParams
[Trace - 12:16:16 PM] Received notification 'window/logMessage'.
Params: {
    "type": 3,
    "message": "Resolved path: c:\\Users\\roholt\\OneDrive - Microsoft\\Dev\\sandbox\\asmDeps.ps1"
}

[Info  - 12:16:16 PM] Resolved path: c:\Users\roholt\OneDrive - Microsoft\Dev\sandbox\asmDeps.ps1
[Trace - 12:16:16 PM] Received notification 'window/logMessage'.
Params: {
    "type": 3,
    "message": "Getting completions at offset 90 (line: 6, column: 4)"
}

[Info  - 12:16:16 PM] Getting completions at offset 90 (line: 6, column: 4)
[Trace - 12:16:16 PM] Received notification 'window/logMessage'.
Params: {
    "type": 3,
    "message": "Updating Resolve items with wrapped data for textDocument/completion:Microsoft.PowerShell.EditorServices.Handlers.CompletionHandler"
}

[Info  - 12:16:16 PM] Updating Resolve items with wrapped data for textDocument/completion:Microsoft.PowerShell.EditorServices.Handlers.CompletionHandler
[Trace - 12:16:16 PM] Received notification 'window/logMessage'.
Params: {
    "type": 3,
    "message": "Result was System.Threading.Tasks.Task`1[[OmniSharp.Extensions.LanguageServer.Protocol.Models.CompletionList, OmniSharp.Extensions.LanguageProtocol, Version=0.14.0.0, Culture=neutral, PublicKeyToken=6d868dff454e6022]]"
}

[Info  - 12:16:16 PM] Result was System.Threading.Tasks.Task`1[[OmniSharp.Extensions.LanguageServer.Protocol.Models.CompletionList, OmniSharp.Extensions.LanguageProtocol, Version=0.14.0.0, Culture=neutral, PublicKeyToken=6d868dff454e6022]]
[Trace - 12:16:16 PM] Received notification 'window/logMessage'.
Params: {
    "type": 3,
    "message": "Response value was OmniSharp.Extensions.LanguageServer.Protocol.Models.CompletionList"
}

[Info  - 12:16:16 PM] Response value was OmniSharp.Extensions.LanguageServer.Protocol.Models.CompletionList
[Trace - 12:16:16 PM] Received notification 'window/logMessage'.
Params: {
    "type": 3,
    "message": "Finished: Routing Request (15) textDocument/completion in 0ms"
}

[Info  - 12:16:16 PM] Finished: Routing Request (15) textDocument/completion in 0ms
[Trace - 12:16:16 PM] Received response 'textDocument/completion - (15)' in 7ms.
Result: []

[Trace - 12:16:16 PM] Sending notification 'textDocument/didChange'.
Params: {
    "textDocument": {
        "uri": "file:///c%3A/Users/roholt/OneDrive%20-%20Microsoft/Dev/sandbox/asmDeps.ps1",
        "version": 6
    },
    "contentChanges": [
        {
            "range": {
                "start": {
                    "line": 5,
                    "character": 3
                },
                "end": {
                    "line": 5,
                    "character": 3
                }
            },
            "rangeLength": 0,
            "text": "-"
        }
    ]
}

[Trace - 12:16:16 PM] Sending request 'textDocument/completion - (16)'.
Params: {
    "textDocument": {
        "uri": "file:///c%3A/Users/roholt/OneDrive%20-%20Microsoft/Dev/sandbox/asmDeps.ps1"
    },
    "position": {
        "line": 5,
        "character": 4
    },
    "context": {
        "triggerKind": 2,
        "triggerCharacter": "-"
    }
}

[Trace - 12:16:16 PM] Received notification 'window/logMessage'.
Params: {
    "type": 3,
    "message": "Finding descriptor for textDocument/didChange"
}

[Info  - 12:16:16 PM] Finding descriptor for textDocument/didChange
[Trace - 12:16:16 PM] Received notification 'window/logMessage'.
Params: {
    "type": 3,
    "message": "Found attributes 1, powershell::file:///c%3A/Users/roholt/OneDrive - Microsoft/Dev/sandbox/asmDeps.ps1"
}

[Info  - 12:16:16 PM] Found attributes 1, powershell::file:///c%3A/Users/roholt/OneDrive - Microsoft/Dev/sandbox/asmDeps.ps1
[Trace - 12:16:16 PM] Received notification 'window/logMessage'.
Params: {
    "type": 3,
    "message": "Looking for handler for descriptors textDocument/didChange"
}

[Info  - 12:16:16 PM] Looking for handler for descriptors textDocument/didChange
[Trace - 12:16:16 PM] Sending request 'textDocument/documentHighlight - (17)'.
Params: {
    "textDocument": {
        "uri": "file:///c%3A/Users/roholt/OneDrive%20-%20Microsoft/Dev/sandbox/asmDeps.ps1"
    },
    "position": {
        "line": 5,
        "character": 4
    }
}

[Trace - 12:16:16 PM] Received notification 'window/logMessage'.
Params: {
    "type": 3,
    "message": "Checking handler textDocument/didChange:Microsoft.PowerShell.EditorServices.Handlers.TextDocumentHandler"
}

[Info  - 12:16:16 PM] Checking handler textDocument/didChange:Microsoft.PowerShell.EditorServices.Handlers.TextDocumentHandler
[Trace - 12:16:16 PM] Received notification 'window/logMessage'.
Params: {
    "type": 3,
    "message": "Registration options OmniSharp.Extensions.LanguageServer.Protocol.Models.TextDocumentChangeRegistrationOptions"
}

[Info  - 12:16:16 PM] Registration options OmniSharp.Extensions.LanguageServer.Protocol.Models.TextDocumentChangeRegistrationOptions
[Trace - 12:16:16 PM] Received notification 'window/logMessage'.
Params: {
    "type": 3,
    "message": "Document Selector [powershell]"
}

[Info  - 12:16:16 PM] Document Selector [powershell]
[Trace - 12:16:16 PM] Received notification 'window/logMessage'.
Params: {
    "type": 3,
    "message": "Handler Selected: Microsoft.PowerShell.EditorServices.Handlers.TextDocumentHandler via [powershell] (targeting OmniSharp.Extensions.JsonRpc.IJsonRpcNotificationHandler`1[[OmniSharp.Extensions.LanguageServer.Protocol.Models.DidChangeTextDocumentParams, OmniSharp.Extensions.LanguageProtocol, Version=0.14.0.0, Culture=neutral, PublicKeyToken=6d868dff454e6022]])"
}

[Info  - 12:16:16 PM] Handler Selected: Microsoft.PowerShell.EditorServices.Handlers.TextDocumentHandler via [powershell] (targeting OmniSharp.Extensions.JsonRpc.IJsonRpcNotificationHandler`1[[OmniSharp.Extensions.LanguageServer.Protocol.Models.DidChangeTextDocumentParams, OmniSharp.Extensions.LanguageProtocol, Version=0.14.0.0, Culture=neutral, PublicKeyToken=6d868dff454e6022]])
[Trace - 12:16:16 PM] Received notification 'window/logMessage'.
Params: {
    "type": 3,
    "message": "Starting: Routing Notification textDocument/didChange"
}

[Info  - 12:16:16 PM] Starting: Routing Notification textDocument/didChange
[Trace - 12:16:16 PM] Received notification 'window/logMessage'.
Params: {
    "type": 3,
    "message": "Converting params for Notification textDocument/didChange to OmniSharp.Extensions.LanguageServer.Protocol.Models.DidChangeTextDocumentParams"
}

[Info  - 12:16:16 PM] Converting params for Notification textDocument/didChange to OmniSharp.Extensions.LanguageServer.Protocol.Models.DidChangeTextDocumentParams
[Trace - 12:16:16 PM] Received notification 'window/logMessage'.
Params: {
    "type": 3,
    "message": "Finding descriptor for textDocument/completion"
}

[Info  - 12:16:16 PM] Finding descriptor for textDocument/completion
[Trace - 12:16:16 PM] Received notification 'window/logMessage'.
Params: {
    "type": 3,
    "message": "Resolved path: c:\\Users\\roholt\\OneDrive - Microsoft\\Dev\\sandbox\\asmDeps.ps1"
}

[Info  - 12:16:16 PM] Resolved path: c:\Users\roholt\OneDrive - Microsoft\Dev\sandbox\asmDeps.ps1
[Trace - 12:16:16 PM] Received notification 'textDocument/publishDiagnostics'.
Params: {
    "uri": "file:///c%3A/Users/roholt/OneDrive - Microsoft/Dev/sandbox/asmDeps.ps1",
    "diagnostics": []
}

[Trace - 12:16:16 PM] Received notification 'window/logMessage'.
Params: {
    "type": 3,
    "message": "Finished: Routing Notification textDocument/didChange in 0ms"
}

[Info  - 12:16:16 PM] Finished: Routing Notification textDocument/didChange in 0ms
[Trace - 12:16:16 PM] Received notification 'window/logMessage'.
Params: {
    "type": 3,
    "message": "Found attributes 1, powershell::file:///c%3A/Users/roholt/OneDrive - Microsoft/Dev/sandbox/asmDeps.ps1"
}

[Info  - 12:16:16 PM] Found attributes 1, powershell::file:///c%3A/Users/roholt/OneDrive - Microsoft/Dev/sandbox/asmDeps.ps1
[Trace - 12:16:16 PM] Received notification 'window/logMessage'.
Params: {
    "type": 3,
    "message": "Looking for handler for descriptors textDocument/completion"
}

[Info  - 12:16:16 PM] Looking for handler for descriptors textDocument/completion
[Trace - 12:16:16 PM] Received notification 'window/logMessage'.
Params: {
    "type": 3,
    "message": "Checking handler textDocument/completion:Microsoft.PowerShell.EditorServices.Handlers.CompletionHandler"
}

[Info  - 12:16:16 PM] Checking handler textDocument/completion:Microsoft.PowerShell.EditorServices.Handlers.CompletionHandler
[Trace - 12:16:16 PM] Received notification 'window/logMessage'.
Params: {
    "type": 3,
    "message": "Registration options OmniSharp.Extensions.LanguageServer.Protocol.Models.CompletionRegistrationOptions"
}

[Info  - 12:16:16 PM] Registration options OmniSharp.Extensions.LanguageServer.Protocol.Models.CompletionRegistrationOptions
[Trace - 12:16:16 PM] Received notification 'window/logMessage'.
Params: {
    "type": 3,
    "message": "Document Selector [powershell]"
}

[Info  - 12:16:16 PM] Document Selector [powershell]
[Trace - 12:16:16 PM] Received notification 'window/logMessage'.
Params: {
    "type": 3,
    "message": "Handler Selected: Microsoft.PowerShell.EditorServices.Handlers.CompletionHandler via [powershell] (targeting OmniSharp.Extensions.JsonRpc.IJsonRpcRequestHandler`2[[OmniSharp.Extensions.LanguageServer.Protocol.Models.CompletionParams, OmniSharp.Extensions.LanguageProtocol, Version=0.14.0.0, Culture=neutral, PublicKeyToken=6d868dff454e6022],[OmniSharp.Extensions.LanguageServer.Protocol.Models.CompletionList, OmniSharp.Extensions.LanguageProtocol, Version=0.14.0.0, Culture=neutral, PublicKeyToken=6d868dff454e6022]])"
}

[Info  - 12:16:16 PM] Handler Selected: Microsoft.PowerShell.EditorServices.Handlers.CompletionHandler via [powershell] (targeting OmniSharp.Extensions.JsonRpc.IJsonRpcRequestHandler`2[[OmniSharp.Extensions.LanguageServer.Protocol.Models.CompletionParams, OmniSharp.Extensions.LanguageProtocol, Version=0.14.0.0, Culture=neutral, PublicKeyToken=6d868dff454e6022],[OmniSharp.Extensions.LanguageServer.Protocol.Models.CompletionList, OmniSharp.Extensions.LanguageProtocol, Version=0.14.0.0, Culture=neutral, PublicKeyToken=6d868dff454e6022]])
[Trace - 12:16:16 PM] Received notification 'window/logMessage'.
Params: {
    "type": 3,
    "message": "Starting: Routing Request (16) textDocument/completion"
}

[Info  - 12:16:16 PM] Starting: Routing Request (16) textDocument/completion
[Trace - 12:16:16 PM] Received notification 'window/logMessage'.
Params: {
    "type": 3,
    "message": "Converting params for Request (16) textDocument/completion to OmniSharp.Extensions.LanguageServer.Protocol.Models.CompletionParams"
}

[Info  - 12:16:16 PM] Converting params for Request (16) textDocument/completion to OmniSharp.Extensions.LanguageServer.Protocol.Models.CompletionParams
[Trace - 12:16:16 PM] Received notification 'window/logMessage'.
Params: {
    "type": 3,
    "message": "Resolved path: c:\\Users\\roholt\\OneDrive - Microsoft\\Dev\\sandbox\\asmDeps.ps1"
}

[Info  - 12:16:16 PM] Resolved path: c:\Users\roholt\OneDrive - Microsoft\Dev\sandbox\asmDeps.ps1
[Trace - 12:16:16 PM] Received notification 'window/logMessage'.
Params: {
    "type": 3,
    "message": "Getting completions at offset 91 (line: 6, column: 5)"
}

[Info  - 12:16:16 PM] Getting completions at offset 91 (line: 6, column: 5)
[Trace - 12:16:16 PM] Received notification 'window/logMessage'.
Params: {
    "type": 3,
    "message": "Updating Resolve items with wrapped data for textDocument/completion:Microsoft.PowerShell.EditorServices.Handlers.CompletionHandler"
}

[Info  - 12:16:16 PM] Updating Resolve items with wrapped data for textDocument/completion:Microsoft.PowerShell.EditorServices.Handlers.CompletionHandler
[Trace - 12:16:16 PM] Received notification 'window/logMessage'.
Params: {
    "type": 3,
    "message": "Result was System.Threading.Tasks.Task`1[[OmniSharp.Extensions.LanguageServer.Protocol.Models.CompletionList, OmniSharp.Extensions.LanguageProtocol, Version=0.14.0.0, Culture=neutral, PublicKeyToken=6d868dff454e6022]]"
}

[Info  - 12:16:16 PM] Result was System.Threading.Tasks.Task`1[[OmniSharp.Extensions.LanguageServer.Protocol.Models.CompletionList, OmniSharp.Extensions.LanguageProtocol, Version=0.14.0.0, Culture=neutral, PublicKeyToken=6d868dff454e6022]]
[Trace - 12:16:16 PM] Received notification 'window/logMessage'.
Params: {
    "type": 3,
    "message": "Response value was OmniSharp.Extensions.LanguageServer.Protocol.Models.CompletionList"
}

[Info  - 12:16:16 PM] Response value was OmniSharp.Extensions.LanguageServer.Protocol.Models.CompletionList
[Trace - 12:16:16 PM] Received notification 'window/logMessage'.
Params: {
    "type": 3,
    "message": "Finished: Routing Request (16) textDocument/completion in 0ms"
}

[Info  - 12:16:16 PM] Finished: Routing Request (16) textDocument/completion in 0ms
[Trace - 12:16:16 PM] Received response 'textDocument/completion - (16)' in 11ms.
Result: []

It seems that the PowerShellContextState isn't being set properly and so completions get skipped for some time after debugging has ended.

rjmholt commented 4 years ago

(Note: eventually debugging comes back. @PrzemyslawKlys mentioned it might be a consequence of interacting with/cancelling the prompt)

TylerLeonhardt commented 4 years ago

Can't repro on macOS with a local build - can you try a local build?

PrzemyslawKlys commented 4 years ago

@TylerLeonhardt have you seen: https://github.com/PowerShell/vscode-powershell/issues/2439 - it's quite easy to reproduce.

TylerLeonhardt commented 4 years ago

The repro steps are the same right @PrzemyslawKlys?

PrzemyslawKlys commented 4 years ago

Hrmm, seems so. Have any code, press F5, any IntelliSense for parameters on next try doesn't work. Press Enter in console and everything works. So pressing F5, pressing Enter in console is the proper way to continue straight away. Or simply wait for "timeout" to happen (however not sure how long that is).

TylerLeonhardt commented 4 years ago

Yeah it looks like it's fixed in my local build unless there's a mac and windows behavior difference which is totally possible.

rjmholt commented 4 years ago

Yeah it looks like it's fixed in my local build unless there's a mac and windows behavior difference

I'll take a look today on my machine

rjmholt commented 4 years ago

So the root cause here is that the DisconnectHandler asks the PowerShellContextService to abort execution, which sets the session state to Aborted. Since that's not Ready, a number of things don't work. This issue is intermittent because of a race condition with running PowerShell commands overriding the state, but adding a lock causes it to reproduce all the time.

The problem now is that we need to understand why these session state concepts exist and what the cleanup from the aborted state is supposed to look like