-
Notifications
You must be signed in to change notification settings - Fork 299
Retry symbol search whilst language server is still initialising #2634
Retry symbol search whilst language server is still initialising #2634
Conversation
* Langauge servers can take a while to initialise, and this has a specific error code associated with it when querying. * So detect that specific error response and retry symbol search every second until it works, or until the search menu is closed.
Specifically, I found this when trying to use the cquery (C++) language server. Opening a
which I traced to a specific error code coming from the language server. |
Unit test for menu `selectedIndex` reset to zero on filtering
Unit test for menu `selectedIndex` reset to zero on filtering
Hmm, those "WARNING: head commit changed" commits are annoying, but harmless (they're empty). I think I accidentally tried to amend a commit I'd already pushed. Not sure how those messages got put there, I've not seen that before. Something to do with eclipse (which I use as a history/conflict viewer), probably. |
menu.isOpen.returns(true) | ||
buffer = sinon.stub() | ||
buffer.language = "mocklang" | ||
buffer.filePath = "/mock/path" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@feltech since our CI runs on multiple platforms you might need to use path.join
here to make the mock paths platform agnostic
@feltech thanks for the PR its nice to see the language server get some much needed love and tests as well 😍, re. the retry strategy I'm wondering if its possible to also delay queries till the server is initialised. There is an |
Codecov Report
@@ Coverage Diff @@
## master #2634 +/- ##
=========================================
+ Coverage 45.38% 45.68% +0.3%
=========================================
Files 361 361
Lines 14576 14586 +10
Branches 1915 1916 +1
=========================================
+ Hits 6615 6664 +49
+ Misses 7737 7698 -39
Partials 224 224
Continue to review full report at Codecov.
|
Indeed, that |
@feltech based on the protocol it seems you have to wait for the |
Btw don't let the initialisation issue be a blocker for now, I'm planning to have a look at bits of our lsp client at some point to facilitate things like #1717 |
Good stuff! I have a couple more PRs incoming, so I'll perhaps take a deeper looks at language server initialize later. |
Can this be merged now then? (I assume it was waiting on some checks when you approved it @Akin909) |
@CrossR was good to merge just forgot to hit the button |
specific error code associated with it when querying.
second until it works, or until the search menu is closed.