@@ -1,6 +1,7 @@
11package app
22
33import (
4+ "cmp"
45 "context"
56 "log/slog"
67 "os/exec"
@@ -69,7 +70,7 @@ func (app *App) initLSPClients(ctx context.Context) {
6970 wg.Go(func() {
7071 app.createAndStartLSPClient(
7172 ctx, name,
72− toOurConfig(server),
73+ toOurConfig(server, app.config.LSP[name]),
7374 slices.Contains(userConfiguredLSPs, name),
7475 )
7576 })
@@ -83,7 +84,9 @@ func (app *App) initLSPClients(ctx context.Context) {
8384 }
8485}
8586
86−func toOurConfig(in *powernapconfig.ServerConfig) config.LSPConfig {
87+// toOurConfig merges powernap default config with user config.
88+// If user config is zero value, it means no user override exists.
89+func toOurConfig(in *powernapconfig.ServerConfig, user config.LSPConfig) config.LSPConfig {
8790 return config.LSPConfig{
8891 Command: in.Command,
8992 Args: in.Args,
@@ -92,6 +95,7 @@ func toOurConfig(in *powernapconfig.ServerConfig) config.LSPConfig {
9295 RootMarkers: in.RootMarkers,
9396 InitOptions: in.InitOptions,
9497 Options: in.Settings,
98+ Timeout: user.Timeout,
9599 }
96100}
97101
@@ -126,7 +130,7 @@ func (app *App) createAndStartLSPClient(ctx context.Context, name string, config
126130 lspClient.SetDiagnosticsCallback(updateLSPDiagnostics)
127131
128132 // Increase initialization timeout as some servers take more time to start.
129− initCtx, cancel := context.WithTimeout(ctx, 30*time.Second)
133+ initCtx, cancel := context.WithTimeout(ctx, time.Duration(cmp.Or(config.Timeout, 30))*time.Second)
130134 defer cancel()
131135
132136 // Initialize LSP client.