-
Hello, I am having a hard time handling OperationCancelled and couldn't find any documentation. I realized that once I start working on workspaces with 100+ files and make quick modifications, the server throws OperationCancelled and need to restart.
I have a few questions:
Thank you all! |
Beta Was this translation helpful? Give feedback.
Replies: 2 comments 8 replies
-
Hey @sylverek, I'm wondering where this error is thrown (and not caught). Can you share a reproducible example with us? Normally, all operations that can throw this error are either run through the MutexLock or language server where they are caught and handled. Maybe debugging the language server with the "Uncaught Exceptions" breakpoint toggled could help narrowing down the problematic areas of the code. |
Beta Was this translation helpful? Give feedback.
-
We could add a logging feature with multiple levels (the usual error / warn / debug) and enable document builder timing when debug logging is on. Shall we create an issue for that? |
Beta Was this translation helpful? Give feedback.
Oh, ok that's a neat issue. So basically, what the
runCancellable
method expects is a function that returns maybe a promise that can be potentially caught. However, if you pass in(doc) => { this.indexManager.updateContent(doc, cancelToken); }
the return value is simplyvoid
, as the function is not async. TheupdateContent
will create it's own async-await chain that cannot be caught by the language server lifecycle. The following two will work: