diff options
| -rw-r--r-- | internal/lsp/handlers_init.go | 2 | ||||
| -rw-r--r-- | internal/lsp/server.go | 5 |
2 files changed, 4 insertions, 3 deletions
diff --git a/internal/lsp/handlers_init.go b/internal/lsp/handlers_init.go index 29dc803..702871d 100644 --- a/internal/lsp/handlers_init.go +++ b/internal/lsp/handlers_init.go @@ -40,5 +40,5 @@ func (s *Server) handleShutdown(req Request) { } func (s *Server) handleExit() { - s.exited = true + s.exited.Store(true) } diff --git a/internal/lsp/server.go b/internal/lsp/server.go index dc76975..730169f 100644 --- a/internal/lsp/server.go +++ b/internal/lsp/server.go @@ -8,6 +8,7 @@ import ( "log" "strings" "sync" + "sync/atomic" "time" "codeberg.org/snonux/hexai/internal/appconfig" @@ -24,7 +25,7 @@ type Server struct { out io.Writer outMu sync.Mutex logger *log.Logger - exited bool + exited atomic.Bool mu sync.RWMutex docs map[string]*document logContext bool @@ -415,7 +416,7 @@ func (s *Server) Run() error { continue } go s.handle(req) - if s.exited { + if s.exited.Load() { return nil } } |
