microsoft / vscode-powerquery

Visual Studio Code extension for Power Query / M.
MIT License
88 stars 16 forks source link

improve handling of invariant errors #179

Closed mattmasson closed 2 years ago

mattmasson commented 2 years ago

The underlying parser or language-services layer is returning InvariantErrors for what seems to be wrapped cancellation tokens. This results in a constant stream of error windows in VS Code. I couldn't figure out the source of the error, but it seems related to Signature Help operations and/or timeouts?

I've turned these errors into warnings at the console level, rather than error popups.

[Warn  - 11:24:10 AM] InvariantError during onSignatureHelp.
[Warn  - 11:24:10 AM] {
    "topOfStack": "Error: InvariantError: Expected value to be instanceof Error - {\n    \"typeof\": \"object\",\n    \"value\": {\n        \"kind\": \"Error\",",
    "message": "InvariantError: Expected value to be instanceof Error - {\n    \"typeof\": \"object\",\n    \"value\": {\n        \"kind\": \"Error\",\n        \"error\": {\n            \"innerError\": {\n                \"cancellationToken\": {\n                    \"threshold\": 1666884242716,\n                    \"wasForceCancelled\": true\n                }\n            }\n        }\n    }\n}",
    "name": "InvariantError"
}