Skip to content

Commit 1891ef7

Browse files
authored
improve lsp error messaging (#4148)
1 parent 2d87813 commit 1891ef7

1 file changed

Lines changed: 5 additions & 1 deletion

File tree

sqlmesh/lsp/main.py

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -95,13 +95,17 @@ def ensure_context_for_document(self, document: TextDocument) -> TextDocument:
9595
for ext in ("py", "yml", "yaml"):
9696
config_path = path / f"config.{ext}"
9797
if config_path.exists():
98-
with suppress(Exception):
98+
try:
9999
# Use user-provided instantiator to build the context
100100
self.context = self.context_class(paths=[path])
101101
self.server.show_message(f"Context loaded for: {path}")
102102
loaded = True
103103
# Re-check context for document now that it's loaded
104104
return self.ensure_context_for_document(document)
105+
except Exception as e:
106+
self.server.show_message(
107+
f"Error loading context: {e}", types.MessageType.Error
108+
)
105109
path = path.parent
106110

107111
return document

0 commit comments

Comments
 (0)