diff --git a/internal/lsp/server.go b/internal/lsp/server.go index 2a4345fb053..bc053a56612 100644 --- a/internal/lsp/server.go +++ b/internal/lsp/server.go @@ -113,8 +113,8 @@ func (s *Server) DidChangeWorkspaceFolders(ctx context.Context, params *protocol return s.changeFolders(ctx, params.Event) } -func (s *Server) DidChangeConfiguration(context.Context, *protocol.DidChangeConfigurationParams) error { - return notImplemented("DidChangeConfiguration") +func (s *Server) DidChangeConfiguration(ctx context.Context, params *protocol.DidChangeConfigurationParams) error { + return s.updateConfiguration(ctx, params.Settings) } func (s *Server) DidChangeWatchedFiles(ctx context.Context, params *protocol.DidChangeWatchedFilesParams) error { diff --git a/internal/lsp/workspace.go b/internal/lsp/workspace.go index d20b9d3dffe..1e4fa664976 100644 --- a/internal/lsp/workspace.go +++ b/internal/lsp/workspace.go @@ -43,5 +43,14 @@ func (s *Server) addView(ctx context.Context, name string, uri span.URI) (source s.fetchConfig(ctx, name, uri, &options) return s.session.NewView(ctx, name, uri, options) - +} + +func (s *Server) updateConfiguration(ctx context.Context, changed interface{}) error { + // go through all the views getting the config + for _, view := range s.session.Views() { + options := s.session.Options() + s.fetchConfig(ctx, view.Name(), view.Folder(), &options) + view.SetOptions(ctx, options) + } + return nil }