on main help sign in
chore: minor internal/app improvements (#1696)
59e4adcChristian Rocha
internal/app/app.go+2−2
@@ -69,7 +69,7 @@ func New(ctx context.Context, conn *sql.DB, cfg *config.Config) (*App, error) {
69 messages := message.NewService(q)
69 messages := message.NewService(q)
70 files := history.NewService(q, conn)
70 files := history.NewService(q, conn)
71 skipPermissionsRequests := cfg.Permissions != nil && cfg.Permissions.SkipRequests
71 skipPermissionsRequests := cfg.Permissions != nil && cfg.Permissions.SkipRequests
72− allowedTools := []string{}
72+ var allowedTools []string
73 if cfg.Permissions != nil && cfg.Permissions.AllowedTools != nil {
73 if cfg.Permissions != nil && cfg.Permissions.AllowedTools != nil {
74 allowedTools = cfg.Permissions.AllowedTools
74 allowedTools = cfg.Permissions.AllowedTools
75 }
75 }
@@ -415,7 +415,7 @@ func (app *App) Shutdown() {
415 })
415 })
416 }
416 }
417
417
418− // Call call cleanup functions.
418+ // Call all cleanup functions.
419 for _, cleanup := range app.cleanupFuncs {
419 for _, cleanup := range app.cleanupFuncs {
420 if cleanup != nil {
420 if cleanup != nil {
421 wg.Go(func() {
421 wg.Go(func() {
internal/app/lsp.go+1−1
@@ -38,7 +38,7 @@ func (app *App) createAndStartLSPClient(ctx context.Context, name string, config
38 // Create LSP client.
38 // Create LSP client.
39 lspClient, err := lsp.New(ctx, name, config, app.config.Resolver())
39 lspClient, err := lsp.New(ctx, name, config, app.config.Resolver())
40 if err != nil {
40 if err != nil {
41− slog.Error("Failed to create LSP client for", name, err)
41+ slog.Error("Failed to create LSP client for", "name", name, "error", err)
42 updateLSPState(name, lsp.StateError, err, nil, 0)
42 updateLSPState(name, lsp.StateError, err, nil, 0)
43 return
43 return
44 }
44 }