Skip to content
This repository was archived by the owner on Feb 22, 2020. It is now read-only.

feat: add support for custom initializationOptions and originalRootUri #11

Closed
wants to merge 2 commits into from

Conversation

chrismwendt
Copy link
Contributor

This is a total hack, but actually helps sourcegraph-go activate and initiate a connection with go-langserver. See sourcegraph/sourcegraph-go#28

chrismwendt added a commit to sourcegraph/sourcegraph-go that referenced this pull request Mar 5, 2019
@codecov-io
Copy link

Codecov Report

Merging #11 into master will increase coverage by 0.01%.
The diff coverage is 75%.

Impacted file tree graph

@@            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
Impacted Files Coverage Δ
src/index.ts 61.87% <75%> (+0.1%) ⬆️

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update acf2df1...296475e. Read the comment docs.

src/index.ts Outdated
@@ -76,6 +76,7 @@ export interface RegisterOptions {
logger?: Logger
transport: () => Promise<LSPConnection> | LSPConnection
documentSelector: DocumentSelector
initializationOptions?: (url: URL) => any
Copy link
Contributor

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?

Copy link
Contributor

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)
Copy link
Contributor

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 :) ?

@chrismwendt
Copy link
Contributor Author

@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 😆

@chrismwendt
Copy link
Contributor Author

Closing in favor of #36

chrismwendt added a commit to sourcegraph/sourcegraph-go that referenced this pull request May 28, 2019
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants