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

Treat more exception types as non-fatal #35

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

baronfel
Copy link
Contributor

@baronfel baronfel commented Sep 5, 2022

Potentially fix ionide/FsAutoComplete#1009 by handling TaskCanceledException (as well as single-exception AggregateExceptions of the accepted types)

@razzmatazz
Copy link
Contributor

this just might work IMHO, but I can't test this on my machine as fake does not build fsac for me on my shiny arm64 mac :(

you said me a couple of months ago how F# unwraps (or rather does not unwrap) AggregateException in try/with clause, but maybe this is unrelated.

we probably want to add test-suite for ionide.lsp ? this could help define behaviour of the lib maybe? what do you think?

@baronfel
Copy link
Contributor Author

baronfel commented Sep 6, 2022

Tests are a good idea, I guess a test would be to make a dummy server with a long-running implementation (Async.Sleep ...) and then cancel it and verify that the overall server doesn't die?

@razzmatazz
Copy link
Contributor

Tests are a good idea, I guess a test would be to make a dummy server with a long-running implementation (Async.Sleep ...) and then cancel it and verify that the overall server doesn't die?

sounds good, but we need to have testing framework here.. should we/I port one from FSAC or can we code it separately in ionide.LSP.

Btw, how does FSAC test the server–does it do the testing out-of-process and sends stuff via the entire STDIO/LSP stack or does it invoke the handlers directly?

let rec (|HandleableException|_|) (e: exn) =
match e with
| :? LocalRpcException -> Some ()
| :? TaskCanceledException -> Some ()
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

if this change doesn't clash with the revamp branch, I also recommend catching OperationCanceledException

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

Successfully merging this pull request may close these issues.

LSP request cancellation seems to be causing server crashes with v0.57.0
3 participants