-
Notifications
You must be signed in to change notification settings - Fork 3
feat: add support for custom initializationOptions and originalRootUri #11
Conversation
Codecov Report
@@ Coverage Diff @@
## master #11 +/- ##
==========================================
+ Coverage 65.48% 65.49% +0.01%
==========================================
Files 11 11
Lines 310 313 +3
Branches 19 20 +1
==========================================
+ Hits 203 205 +2
- Misses 107 108 +1
Continue to review full report at Codecov.
|
src/index.ts
Outdated
@@ -76,6 +76,7 @@ export interface RegisterOptions { | |||
logger?: Logger | |||
transport: () => Promise<LSPConnection> | LSPConnection | |||
documentSelector: DocumentSelector | |||
initializationOptions?: (url: URL) => any |
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.
It feels weird to have a parameter named initializationOptions
that is a function. Could you rename it getInitializationOptions()
? Could you also add a docstring explaining why it's needed?
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.
Could it return a more specific type than any
?
src/index.ts
Outdated
if (initParams.initializationOptions && clientRootUri) { | ||
initParams.initializationOptions = initParams.initializationOptions(clientRootUri) | ||
} else { | ||
console.log('Garr, did not work', initParams.initializationOptions, clientRootUri) |
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.
Do we want @sourcegraph/lsp-client
to emit logs in pirate lingo :) ?
@lguychard Oh, for sure, it's 100% weird and a total hack. This isn't intended to get merged in as-is. This was only intended to aid the discussion in sourcegraph/sourcegraph-go#28. There are more details to be sorted out. Have you seen https://yargs.js.org/ ? The entire README used to be written in pirate-speak 😆 |
c2c22fd
to
cc4506a
Compare
cc4506a
to
8d852f9
Compare
8d852f9
to
1a62c00
Compare
Closing in favor of #36 |
This is a total hack, but actually helps sourcegraph-go activate and initiate a connection with go-langserver. See sourcegraph/sourcegraph-go#28