From b312e6be265cf35e2aacc10db60e061079961ea7 Mon Sep 17 00:00:00 2001 From: Ben King <9087625+benfdking@users.noreply.github.com> Date: Tue, 10 Jun 2025 13:12:38 +0100 Subject: [PATCH] refactor(lsp): share code for creation of lsp --- sqlmesh/lsp/main.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/sqlmesh/lsp/main.py b/sqlmesh/lsp/main.py index fdfb105a63..6544df2080 100755 --- a/sqlmesh/lsp/main.py +++ b/sqlmesh/lsp/main.py @@ -694,9 +694,9 @@ def _ensure_context_for_document( for a config.py or config.yml file in the parent directories. """ if self.lsp_context is not None: - context = self.lsp_context - context.context.load() # Reload or refresh context - self.lsp_context = LSPContext(context.context) + # If we already have a context, refresh it + paths = list(self.lsp_context.context.configs) + self._create_lsp_context(paths) return # No context yet: try to find config and load it