sqlmesh 0.186.1.dev6__py3-none-any.whl → 0.186.1.dev7__py3-none-any.whl
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- sqlmesh/_version.py +2 -2
- sqlmesh/lsp/main.py +25 -4
- {sqlmesh-0.186.1.dev6.dist-info → sqlmesh-0.186.1.dev7.dist-info}/METADATA +1 -1
- {sqlmesh-0.186.1.dev6.dist-info → sqlmesh-0.186.1.dev7.dist-info}/RECORD +8 -8
- {sqlmesh-0.186.1.dev6.dist-info → sqlmesh-0.186.1.dev7.dist-info}/WHEEL +0 -0
- {sqlmesh-0.186.1.dev6.dist-info → sqlmesh-0.186.1.dev7.dist-info}/entry_points.txt +0 -0
- {sqlmesh-0.186.1.dev6.dist-info → sqlmesh-0.186.1.dev7.dist-info}/licenses/LICENSE +0 -0
- {sqlmesh-0.186.1.dev6.dist-info → sqlmesh-0.186.1.dev7.dist-info}/top_level.txt +0 -0
sqlmesh/_version.py
CHANGED
|
@@ -17,5 +17,5 @@ __version__: str
|
|
|
17
17
|
__version_tuple__: VERSION_TUPLE
|
|
18
18
|
version_tuple: VERSION_TUPLE
|
|
19
19
|
|
|
20
|
-
__version__ = version = '0.186.1.
|
|
21
|
-
__version_tuple__ = version_tuple = (0, 186, 1, '
|
|
20
|
+
__version__ = version = '0.186.1.dev7'
|
|
21
|
+
__version_tuple__ = version_tuple = (0, 186, 1, 'dev7')
|
sqlmesh/lsp/main.py
CHANGED
|
@@ -69,10 +69,7 @@ class SQLMeshLanguageServer:
|
|
|
69
69
|
# Use user-provided instantiator to build the context
|
|
70
70
|
created_context = self.context_class(paths=[folder_path])
|
|
71
71
|
self.lsp_context = LSPContext(created_context)
|
|
72
|
-
ls
|
|
73
|
-
f"Loaded SQLMesh context from {config_path}",
|
|
74
|
-
types.MessageType.Info,
|
|
75
|
-
)
|
|
72
|
+
loaded_sqlmesh_message(ls, folder_path)
|
|
76
73
|
return # Exit after successfully loading any config
|
|
77
74
|
except Exception as e:
|
|
78
75
|
ls.show_message(
|
|
@@ -94,6 +91,9 @@ class SQLMeshLanguageServer:
|
|
|
94
91
|
@self.server.feature(API_FEATURE)
|
|
95
92
|
def api(ls: LanguageServer, request: ApiRequest) -> t.Dict[str, t.Any]:
|
|
96
93
|
ls.log_trace(f"API request: {request}")
|
|
94
|
+
if self.lsp_context is None:
|
|
95
|
+
current_path = Path.cwd()
|
|
96
|
+
self._ensure_context_in_folder(current_path)
|
|
97
97
|
if self.lsp_context is None:
|
|
98
98
|
raise RuntimeError("No context found")
|
|
99
99
|
|
|
@@ -291,6 +291,20 @@ class SQLMeshLanguageServer:
|
|
|
291
291
|
raise RuntimeError("No context found")
|
|
292
292
|
return self.lsp_context
|
|
293
293
|
|
|
294
|
+
def _ensure_context_in_folder(self, folder_uri: Path) -> None:
|
|
295
|
+
if self.lsp_context is not None:
|
|
296
|
+
return
|
|
297
|
+
for ext in ("py", "yml", "yaml"):
|
|
298
|
+
config_path = folder_uri / f"config.{ext}"
|
|
299
|
+
if config_path.exists():
|
|
300
|
+
try:
|
|
301
|
+
created_context = self.context_class(paths=[folder_uri])
|
|
302
|
+
self.lsp_context = LSPContext(created_context)
|
|
303
|
+
loaded_sqlmesh_message(self.server, folder_uri)
|
|
304
|
+
return
|
|
305
|
+
except Exception as e:
|
|
306
|
+
self.server.show_message(f"Error loading context: {e}", types.MessageType.Error)
|
|
307
|
+
|
|
294
308
|
def _ensure_context_for_document(
|
|
295
309
|
self,
|
|
296
310
|
document_uri: URI,
|
|
@@ -382,6 +396,13 @@ class SQLMeshLanguageServer:
|
|
|
382
396
|
self.server.start_io()
|
|
383
397
|
|
|
384
398
|
|
|
399
|
+
def loaded_sqlmesh_message(ls: LanguageServer, folder: Path) -> None:
|
|
400
|
+
ls.show_message(
|
|
401
|
+
f"Loaded SQLMesh context from {folder}",
|
|
402
|
+
types.MessageType.Info,
|
|
403
|
+
)
|
|
404
|
+
|
|
405
|
+
|
|
385
406
|
def main() -> None:
|
|
386
407
|
# Example instantiator that just uses the same signature as your original `Context` usage.
|
|
387
408
|
sqlmesh_server = SQLMeshLanguageServer(context_class=Context)
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
sqlmesh/__init__.py,sha256=69xw6bTmi4cW90M-sl3g6wLDgxVcLHcKg1q8GS3lqyA,7466
|
|
2
|
-
sqlmesh/_version.py,sha256
|
|
2
|
+
sqlmesh/_version.py,sha256=K99fmWclfGcyAo9Fc8cy0TilhN1wP7ue3CLxOqVeHis,528
|
|
3
3
|
sqlmesh/magics.py,sha256=JHorAZNtezf123jmTyNSoUC9yHmv-08hMP205PJmmIo,39750
|
|
4
4
|
sqlmesh/py.typed,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
5
5
|
sqlmesh/cicd/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
@@ -159,7 +159,7 @@ sqlmesh/lsp/api.py,sha256=LJdECSaEZoPbu_Xl4KscVG-WLt7_g4dY-zKGO68dH14,2162
|
|
|
159
159
|
sqlmesh/lsp/completions.py,sha256=Uo8lUzPBeoB58Eu2642YoAtNI0pgIFWFSvwmuJALTv4,3583
|
|
160
160
|
sqlmesh/lsp/context.py,sha256=Ff09vrsawdYS-7YcXbGZW_RU-tj_-k8WV7maCghpYp0,1438
|
|
161
161
|
sqlmesh/lsp/custom.py,sha256=GvNAiW7imPI8xmIx3qLWN5FljGPHFJKh0N5b6aZnwRo,489
|
|
162
|
-
sqlmesh/lsp/main.py,sha256=
|
|
162
|
+
sqlmesh/lsp/main.py,sha256=yX4HDvg6MmXvApndvHWUh9tsSXIWoa2hzgN3TtSzT2s,18044
|
|
163
163
|
sqlmesh/lsp/reference.py,sha256=MiTnNmaGrVs1Scms3jHkZ89Cu8_ZLJGAHcs1LRywFdU,8129
|
|
164
164
|
sqlmesh/lsp/uri.py,sha256=mvSLbZGmMTHPpliThOtVWiFcHnfJzp1w39q9l-xD2SI,802
|
|
165
165
|
sqlmesh/migrations/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
@@ -268,7 +268,7 @@ sqlmesh/utils/pydantic.py,sha256=I898jAFqa3qU6lG2uPpRebVFncOUo8ZrLWM_R3K3DHU,116
|
|
|
268
268
|
sqlmesh/utils/rich.py,sha256=xNZyPCqEc4TAlJlsEthg-5eYUWpaizz0QjBzO7a1Yv4,1509
|
|
269
269
|
sqlmesh/utils/windows.py,sha256=r7Yin4WEwbvH7sKA3hOJtRsclmscNuBeCklCfVPvtQs,611
|
|
270
270
|
sqlmesh/utils/yaml.py,sha256=np-WVcwmwsKghCgAj1OBBMsK1SXSRn4wR-H37cGiFr8,2282
|
|
271
|
-
sqlmesh-0.186.1.
|
|
271
|
+
sqlmesh-0.186.1.dev7.dist-info/licenses/LICENSE,sha256=OlMefUjgWJdULtf84BLW0AZZcY8DwdgQqb_1j2862j8,11346
|
|
272
272
|
web/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
273
273
|
web/client/dist/index.html,sha256=xQIU9G6dbuTnmbHZ61bSYbh0gYz9A2lb4BRwLlXL94Y,5472
|
|
274
274
|
web/client/dist/assets/Audits-Dcl7Y5yf.js,sha256=D2CfXzrdXFdD_-7c51tBJCKNwUY9yGeIpDEaRae7V8I,1041
|
|
@@ -386,8 +386,8 @@ web/server/api/endpoints/models.py,sha256=ud-lRwriyI_OYg9tZchrBgeiXELiRTLNEodraf
|
|
|
386
386
|
web/server/api/endpoints/modules.py,sha256=8hqqgonGay_mJmpCw0IdbjsPhWlQH2VLdKAqha-myac,468
|
|
387
387
|
web/server/api/endpoints/plan.py,sha256=OYuQ_4dgbhG9ibTcX1a8mvYgH3ANxw9Fhbb4wg6QWqc,9222
|
|
388
388
|
web/server/api/endpoints/table_diff.py,sha256=Wd5YxeKbZB7AkrDvqFgvV9ZQlnKYOF1n5W_w2EHE_Zw,2085
|
|
389
|
-
sqlmesh-0.186.1.
|
|
390
|
-
sqlmesh-0.186.1.
|
|
391
|
-
sqlmesh-0.186.1.
|
|
392
|
-
sqlmesh-0.186.1.
|
|
393
|
-
sqlmesh-0.186.1.
|
|
389
|
+
sqlmesh-0.186.1.dev7.dist-info/METADATA,sha256=vPlYOndgQsEtLIevDpCPJIw1Hak1BjT3kACW4HIszHY,25523
|
|
390
|
+
sqlmesh-0.186.1.dev7.dist-info/WHEEL,sha256=zaaOINJESkSfm_4HQVc5ssNzHCPXhJm0kEUakpsEHaU,91
|
|
391
|
+
sqlmesh-0.186.1.dev7.dist-info/entry_points.txt,sha256=pIYKtg-u-uO7BK_Y0qrdmfyj0bYrcMc3Xiqr5WE3VFk,121
|
|
392
|
+
sqlmesh-0.186.1.dev7.dist-info/top_level.txt,sha256=bspjo5vjELQkuN0qKuTFIbsrUt3Zeo8D2mlKeHG1LdE,12
|
|
393
|
+
sqlmesh-0.186.1.dev7.dist-info/RECORD,,
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|