Skip to content
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

Make lsp-clients-go-server configurable #742

Closed
wants to merge 1 commit into from

Conversation

nanjj
Copy link

@nanjj nanjj commented Apr 1, 2019

Current logic ignored lsp-clients-go-server and fixed to gopls,
while gopls does not work all the time.

@yyoncho yyoncho mentioned this pull request Apr 1, 2019
@yyoncho
Copy link
Member

yyoncho commented Apr 1, 2019

@seagle0128

Moving the discussion into the pull request.

It looks good, except two issues.

The implementation is different from other clients. e.g. typescript-language-server and javascript-typescript-stdio.

My understanding is that the 3 servers are fork of one and the same language servers and that they have the same configuration options, functions, and so on which is not the same as js-ts/ts servers AFAIK.

The server-id looks not good for go-go-langserver.

I agree.

IMO, for consistency, should remove the configuration sp-clients-go-server and keep lsp-clients-go-server-args. Or, make other clients configurable as #742 , which is not as original design, right?

The priority is the user experience, we are not coupled to a particular design decision. One of the problems is that if you do:

(setq ... "bingo")
(require 'lsp-clients)
(setq ... "gopls")

The server still will be "bingo".

@seagle0128
Copy link
Collaborator

My understanding is that the 3 servers are fork of one and the same language servers and that they have the same configuration options, functions, and so on which is not the same as js-ts/ts servers AFAIK.

They have different configurations actually. To me they are same as js-ts/ts servers.

For example:

$ gopls --help
The Go Language source tools.

Usage: gopls [flags] <command> [command-flags] [command-args]

Available commands are:
  serve : run a server for Go code using the Language Server Protocol
  query : answer queries about go source code

gopls flags are:
  -listen string
    	address on which to listen for remote connections
  -logfile string
    	filename to log to. if value is "auto", then logging to a default output file is enabled
  -mode string
    	no effect
  -port int
    	port on which to run gopls for debugging purposes
  -profile.cpu string
    	write CPU profile to this file
  -profile.mem string
    	write memory profile to this file
  -profile.trace string
    	write trace log to this file
  -remote string
    	*EXPERIMENTAL* - forward all commands to a remote lsp
$ bingo -h
Usage of bingo:
  -addr string
    	server listen address (tcp) (default ":4389")
  -build-tags string
    	build tags, separated by spaces.
  -cache-style string
    	set global cache style: none, on-demand, always. Can be overridden by InitializationOptions. (default "always")
  -diagnostics
    	enable diagnostics. no actual effect, just for compatible with ide-go
  -diagnostics-style string
    	diagnostics style: none, instant, onsave. Can be overridden by InitializationOptions. (default "instant")
  -disable-func-snippet
    	disable argument snippets on func completion. Can be overridden by InitializationOptions.
  -enhance-signature-help
    	enhance signature help with return result. Can be overridden by InitializationOptions.
  -format-style string
    	which format style is used to format documents. Supported: gofmt and goimports. Can be overridden by InitializationOptions. (default "goimports")
  -format-tool string
    	which tool is used to format documents. no actual effect, just for compatible with ide-go (default "goimports")
  -freeosmemory int
    	the interval time that aggressively free memory back to the OS, unit is second, default value is 0, means no free memroy back to the OS
  -func-snippet-enabled
    	enable argument snippets on func completion. no actual effect, just for compatible with ide-go (default true)
  -gocodecompletion
    	enable completion. no actual effect, just for compatible with ide-go
  -goimports-prefix string
    	set '--local' flag for the goimports invocation. Can be overridden by InitializationOptions.
  -logfile string
    	also log to this file (in addition to stderr)
  -maxparallelism int
    	use at max N parallel goroutines to fulfill requests. Can be overridden by InitializationOptions.
  -mode string
    	communication mode (stdio|tcp) (default "stdio")
  -pprof string
    	start a pprof http server (https://golang.org/pkg/net/http/pprof/)
  -trace
    	print all requests and responses
  -version
    	print version and exit

@seagle0128
Copy link
Collaborator

FYI
saibing/bingo#13 (comment)

@saibing who is the author of bingo, is starting developing gopls.

@yyoncho
Copy link
Member

yyoncho commented Apr 1, 2019

They have different configurations actually. To me they are same as js-ts/ts servers.

Ok, I was fooled by the fact that lsp-clients-go--make-init-options is used for the three language servers.

If @nanjj concern is that gopls is not ready to be the default language server we might switch the priorities temporary.

@fjl
Copy link
Contributor

fjl commented Apr 5, 2019

It's also good to allow overriding the path regardless of whether it'll always be one server or the other.

Current logic ignored `lsp-clients-go-server` and fixed to `gopls`,
while `gopls` does not work all the time.
@yyoncho
Copy link
Member

yyoncho commented Apr 18, 2019

Closing in favour of #771 .

@yyoncho yyoncho closed this Apr 18, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants