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

HideDiagnostics configuration not honored #81

Open
cherrymui opened this issue Dec 2, 2024 · 0 comments
Open

HideDiagnostics configuration not honored #81

cherrymui opened this issue Dec 2, 2024 · 0 comments

Comments

@cherrymui
Copy link

If the -hidediag flag is not specified on the command line, it should honer the HideDiagnostics setting in the config file. Currently it is not:

$ cat ~/Library/Application\ Support/acme-lsp/config.toml | grep HideDiagnostics
HideDiagnostics = true
$ acme-lsp -showconfig | grep HideDiagnostics
HideDiagnostics = false

This is because it is overwritten by the flag's default value. The following patch fixes it

diff --git a/internal/lsp/acmelsp/config/config.go b/internal/lsp/acmelsp/config/config.go
index bbdb63f..f1033fd 100644
--- a/internal/lsp/acmelsp/config/config.go
+++ b/internal/lsp/acmelsp/config/config.go
@@ -257,7 +257,7 @@ func (cfg *Config) ParseFlags(flags Flags, f *flag.FlagSet, arguments []string)
 	if flags&LangServerFlags != 0 {
 		f.BoolVar(&cfg.Verbose, "debug", cfg.Verbose, "turn on debugging prints (deprecated: use -v)")
 		f.StringVar(&cfg.RootDirectory, "rootdir", cfg.RootDirectory, "root directory used for LSP initialization")
-		f.BoolVar(&cfg.HideDiagnostics, "hidediag", false, "hide diagnostics sent by LSP server")
+		f.BoolVar(&cfg.HideDiagnostics, "hidediag", cfg.HideDiagnostics, "hide diagnostics sent by LSP server")
 		f.BoolVar(&cfg.RPCTrace, "rpc.trace", false, "print the full rpc trace in lsp inspector format")
 		f.StringVar(&workspaces, "workspaces", "", "colon-separated list of initial workspace directories")
 		f.Var(&userServers, "server", `map filename to language server command. The format is

Thanks.

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

No branches or pull requests

1 participant