Skip to content
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

Intellisense loss after debugging #2364

Closed
rjmholt opened this issue Dec 13, 2019 · 8 comments · Fixed by PowerShell/PowerShellEditorServices#1210
Closed

Intellisense loss after debugging #2364

rjmholt opened this issue Dec 13, 2019 · 8 comments · Fixed by PowerShell/PowerShellEditorServices#1210

Comments

@rjmholt
Copy link
Contributor

rjmholt commented Dec 13, 2019

foreach ($str in 'hi','there','friend','i','like','you')
{ # <-- breakpoint here
    Write-Host $str
}
  • Run through this in the debugger (I used F5) until it's finished execution
  • Type Get-<Tab> below
  • Get no completions

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
Copy link
Contributor Author

rjmholt commented Jan 27, 2020

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

@TylerLeonhardt
Copy link
Member

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

@PrzemyslawKlys
Copy link
Contributor

@TylerLeonhardt have you seen: #2439 - it's quite easy to reproduce.

@ghost ghost added the Needs: Maintainer Attention Maintainer attention needed! label Jan 27, 2020
@TylerLeonhardt
Copy link
Member

The repro steps are the same right @PrzemyslawKlys?

@PrzemyslawKlys
Copy link
Contributor

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
Copy link
Member

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
Copy link
Contributor Author

rjmholt commented Jan 27, 2020

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

@SydneyhSmith SydneyhSmith removed the Needs: Maintainer Attention Maintainer attention needed! label Jan 28, 2020
@rjmholt
Copy link
Contributor Author

rjmholt commented Feb 26, 2020

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

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

Successfully merging a pull request may close this issue.

4 participants