-
Notifications
You must be signed in to change notification settings - Fork 89
Use InitializationOptions instead of flags to drive capabilities #280
Comments
Agree. The only draw back for such change is that all solution depends on us must adjust their cmd spawning the FYI, I am actually considering deprecating edit: It does support some caching without any extra setup. |
My another concern with flags is that when new flags get added, there is no clean way for the client to know if the user has the version of the language server that supports the said flag. The only way to do this would be to parse the output of So, why do we even have the |
I agree with this. Moving to interface GoInitializationOptions {
/**
* funcSnippetEnabled enables the returning of enable argument snippets
* on `func` completions, eg. func(foo string, arg2 bar).
* Requires code completion to be enabled.
*
* Defaults to true if not specified.
*/
funcSnippetEnabled?: boolean;
/**
* gocodeCompletionEnabled enables code completion feature (using gocode).
*
* Defaults to false if not specified.
*/
gocodeCompletionEnabled?: boolean;
/**
* MaxParallelism controls the maximum number of goroutines that should be used
* to fulfill requests. This is useful in editor environments where users do
* not want results ASAP, but rather just semi quickly without eating all of
* their CPU.
*
* Defaults to 8 if not specified.
*/
maxParallelism?: number;
/**
* useBinaryPkgCache controls whether or not $GOPATH/pkg binary .a files should
* be used.
*
* Defaults to true if not specified.
*/
useBinaryPkgCache?: boolean;
} |
At present there are 2 flags to the
go-langserver
that control features of the language serverOne can easily imagine other configuration options we would want to have down the line that controls other features. One such is already being discussed in #272 (comment) which is about the tool to use for formatting i.e gofmt vs goimports
InitializationOptions
is something sent to the server from the client which seems like a much better place than flags to control/configure features. Adding more flags togo-langserver
itself doesnt scale.cc @keegancsmith @slimsag
The text was updated successfully, but these errors were encountered: