-
Notifications
You must be signed in to change notification settings - Fork 3
fix: do not register providers inside of withConnection #42
Conversation
8b73e20
to
0a1a3bf
Compare
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.
I'm not extremely familiar with lsp-client, but at first glance I wouldn't have expected withConnection()
to have side effects such as provider registration based on its prototype and docstring.
Based solely on that, this seems like a sensible fix.
Linking #41 (comment) |
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.
Just wanted to be explicit that I think this would not work because the connections are expected to be put in the cache (so they need providers too), see #41 (comment). It's been a while since I looked at this though.
Is it correct behavior on the sourcegraph side to invoke all providers when the provider set changes (even for providers that didn't de/re/un register)? |
@efritz IMO it's incorrect. Linking "Do not call all providers when the set changes (it may be high time to take another stab at https://github.com/sourcegraph/sourcegraph/issues/2962#issuecomment-478389985)" #41 (comment)
I'll take a stab at recording that bit in the connection map. |
0a1a3bf
to
7a57c47
Compare
I looked at this a bit closer and concluded that it's not a problem because the change in this PR never causes a root browsable in the Sourcegraph UI to be missing providers. |
Codecov Report
@@ Coverage Diff @@
## master #42 +/- ##
=======================================
Coverage 64.96% 64.96%
=======================================
Files 11 11
Lines 294 294
Branches 20 20
=======================================
Hits 191 191
Misses 103 103
Continue to review full report at Codecov.
|
Fixes #41 by passing a flag
registerProviders
around internally.This may or may not be a desirable solution, but at least it serves as something to discuss.