Commit d34d24c
committed
fix(lsp): read self.context_state instead of stale local variable in _context_get_or_load
_context_get_or_load captures self.context_state into a local variable
`state` at the top of the method. After _create_lsp_context() or
_ensure_context_for_document() successfully updates self.context_state
to ContextLoaded, the final check on line 1077 reads the stale local
`state` (still NoContext) instead of self.context_state.
This causes the method to always raise RuntimeError("Context failed to
load") on the first didOpen, even when context loading succeeds. The
LSP logs "Loaded SQLMesh Context" then immediately crashes. In VS Code,
this puts the client into a permanent "Client got disposed and can't be
restarted" state.
Signed-off-by: jthurlburt <jthurlburt818@gmail.com>1 parent 8f092ac commit d34d24c
1 file changed
+2
-2
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1074 | 1074 | | |
1075 | 1075 | | |
1076 | 1076 | | |
1077 | | - | |
1078 | | - | |
| 1077 | + | |
| 1078 | + | |
1079 | 1079 | | |
1080 | 1080 | | |
1081 | 1081 | | |
| |||
0 commit comments