-
Notifications
You must be signed in to change notification settings - Fork 106
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
docs: Add example for custom initialization options #307 #310
Conversation
This seems to only provide the ability to assign a value for I think the library needs to instead provide a way to set the value of any field in this Unfortunately, right now it seems like the only way to achieve that is by overriding |
Yes, it only handles InitializationOptions, not InitializeParams. You would be better off opening another issue or pull request to address your question. |
I feel like having to create your own process builder just to pass InitializationOptions might not be a good design. Probably we can expose APIs from the |
Yes, if |
What I've tried with the current codeNothing worked, unfortunately. :( Nonetheless, I'm listing my attempts below in case I'm simply not doing it properly. CustomServerWrapper to override
|
initializeFuture = languageServer.initialize(initParams).thenApply(res -> { |
Proposition
@NipunaRanasinghe I think you are right: providing a method like customizeInitializeParams(initParams: InitializeParams)
in the LanguageServerDefinition
would be good enough:
public void customizeInitializeParams(InitializeParams params) {
return;
}
private InitializeParams getInitParams() {
// same stuff before
serverDefinition.customizeInitializeParams(initParams); // this gets added
return initParams;
}
People could override this new method and add on top of the pre-processing that this library already does. This way, it's easy to keep part of the automation we already benefit from, while also giving all the possible freedom to the library's users.
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.
Okay, I have updated it. Please help me review it. |
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.
GitHub's code suggestion feature does not seem to play well with the markdown code notation. But you'll get the gist of it.
I believe a readme should be light: we should avoid showing lengthy examples. Minimal examples, with reference points is preferable. The JavaDoc provided by the library should be sufficient if users are trying to dig deeper for their understanding.
Also, let's avoid mentioning things that just got deprecated: let's lead users to use the more recent versions. This also has the benefit of decluttering the readme.
Purpose
Resolves #307
Goals
Just add some example for custom initialization options