sqlmesh 0.189.3.dev28__py3-none-any.whl → 0.190.1.dev1__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/completions.py +14 -6
- sqlmesh/lsp/custom.py +8 -1
- sqlmesh/lsp/main.py +3 -1
- {sqlmesh-0.189.3.dev28.dist-info → sqlmesh-0.190.1.dev1.dist-info}/METADATA +1 -1
- {sqlmesh-0.189.3.dev28.dist-info → sqlmesh-0.190.1.dev1.dist-info}/RECORD +10 -10
- {sqlmesh-0.189.3.dev28.dist-info → sqlmesh-0.190.1.dev1.dist-info}/WHEEL +0 -0
- {sqlmesh-0.189.3.dev28.dist-info → sqlmesh-0.190.1.dev1.dist-info}/entry_points.txt +0 -0
- {sqlmesh-0.189.3.dev28.dist-info → sqlmesh-0.190.1.dev1.dist-info}/licenses/LICENSE +0 -0
- {sqlmesh-0.189.3.dev28.dist-info → sqlmesh-0.190.1.dev1.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.
|
|
21
|
-
__version_tuple__ = version_tuple = (0,
|
|
20
|
+
__version__ = version = '0.190.1.dev1'
|
|
21
|
+
__version_tuple__ = version_tuple = (0, 190, 1, 'dev1')
|
sqlmesh/lsp/completions.py
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
from functools import lru_cache
|
|
2
2
|
from sqlglot import Dialect, Tokenizer
|
|
3
|
-
from sqlmesh.lsp.custom import AllModelsResponse
|
|
3
|
+
from sqlmesh.lsp.custom import AllModelsResponse, MacroCompletion
|
|
4
4
|
from sqlmesh import macro
|
|
5
5
|
import typing as t
|
|
6
6
|
from sqlmesh.lsp.context import AuditTarget, LSPContext, ModelTarget
|
|
@@ -60,15 +60,23 @@ def get_models(context: t.Optional[LSPContext], file_uri: t.Optional[URI]) -> t.
|
|
|
60
60
|
return all_models
|
|
61
61
|
|
|
62
62
|
|
|
63
|
-
def get_macros(
|
|
64
|
-
|
|
65
|
-
|
|
63
|
+
def get_macros(
|
|
64
|
+
context: t.Optional[LSPContext], file_uri: t.Optional[URI]
|
|
65
|
+
) -> t.List[MacroCompletion]:
|
|
66
|
+
"""Return a list of macros with optional descriptions."""
|
|
67
|
+
macros: t.Dict[str, t.Optional[str]] = {}
|
|
68
|
+
|
|
69
|
+
for name, m in macro.get_registry().items():
|
|
70
|
+
macros[name] = getattr(m.func, "__doc__", None)
|
|
71
|
+
|
|
66
72
|
try:
|
|
67
73
|
if context is not None:
|
|
68
|
-
|
|
74
|
+
for name, m in context.context._macros.items():
|
|
75
|
+
macros[name] = getattr(m.func, "__doc__", None)
|
|
69
76
|
except Exception:
|
|
70
77
|
pass
|
|
71
|
-
|
|
78
|
+
|
|
79
|
+
return [MacroCompletion(name=name, description=doc) for name, doc in macros.items()]
|
|
72
80
|
|
|
73
81
|
|
|
74
82
|
def get_keywords(context: t.Optional[LSPContext], file_uri: t.Optional[URI]) -> t.Set[str]:
|
sqlmesh/lsp/custom.py
CHANGED
|
@@ -23,6 +23,13 @@ class AllModelsRequest(CustomMethodRequestBaseClass):
|
|
|
23
23
|
textDocument: types.TextDocumentIdentifier
|
|
24
24
|
|
|
25
25
|
|
|
26
|
+
class MacroCompletion(PydanticModel):
|
|
27
|
+
"""Information about a macro for autocompletion."""
|
|
28
|
+
|
|
29
|
+
name: str
|
|
30
|
+
description: t.Optional[str] = None
|
|
31
|
+
|
|
32
|
+
|
|
26
33
|
class AllModelsResponse(CustomMethodResponseBaseClass):
|
|
27
34
|
"""
|
|
28
35
|
Response to get all the models that are in the current project.
|
|
@@ -30,7 +37,7 @@ class AllModelsResponse(CustomMethodResponseBaseClass):
|
|
|
30
37
|
|
|
31
38
|
models: t.List[str]
|
|
32
39
|
keywords: t.List[str]
|
|
33
|
-
macros: t.List[
|
|
40
|
+
macros: t.List[MacroCompletion]
|
|
34
41
|
|
|
35
42
|
|
|
36
43
|
RENDER_MODEL_FEATURE = "sqlmesh/render_model"
|
sqlmesh/lsp/main.py
CHANGED
|
@@ -625,7 +625,8 @@ class SQLMeshLanguageServer:
|
|
|
625
625
|
and getattr(params.context, "trigger_character", None) == "@"
|
|
626
626
|
)
|
|
627
627
|
|
|
628
|
-
for
|
|
628
|
+
for macro in completion_response.macros:
|
|
629
|
+
macro_name = macro.name
|
|
629
630
|
insert_text = macro_name if triggered_by_at else f"@{macro_name}"
|
|
630
631
|
|
|
631
632
|
completion_items.append(
|
|
@@ -636,6 +637,7 @@ class SQLMeshLanguageServer:
|
|
|
636
637
|
filter_text=macro_name,
|
|
637
638
|
kind=types.CompletionItemKind.Function,
|
|
638
639
|
detail="SQLMesh Macro",
|
|
640
|
+
documentation=macro.description,
|
|
639
641
|
)
|
|
640
642
|
)
|
|
641
643
|
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
sqlmesh/__init__.py,sha256=QjwaamJIdW7voXoS880yAx7tHm-Im4_mqGA-XJgafos,7631
|
|
2
|
-
sqlmesh/_version.py,sha256=
|
|
2
|
+
sqlmesh/_version.py,sha256=ZZOoESKdHETwaV_Vjl91NS8kfaWiViqZ_Vp9mSULRVw,528
|
|
3
3
|
sqlmesh/magics.py,sha256=gjzoxREb1XT8Yho_PQMlMqhhkLq_sEfBM8S3PTgxvWE,40337
|
|
4
4
|
sqlmesh/py.typed,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
5
5
|
sqlmesh/cicd/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
@@ -159,13 +159,13 @@ sqlmesh/integrations/github/cicd/command.py,sha256=rNWb-aMOA9R23YumD5vPwR0PgPGGj
|
|
|
159
159
|
sqlmesh/integrations/github/cicd/config.py,sha256=tRhMZaLf1p6AWXvi67n85Q-lptJNGt1Wk_Jr61ytpiM,2104
|
|
160
160
|
sqlmesh/integrations/github/cicd/controller.py,sha256=IgUWK9orYSMiElO3GaL6Ja-osFgA7je3RDcLChWUi5s,43769
|
|
161
161
|
sqlmesh/lsp/api.py,sha256=_lA_buSPZFIoLJuINbS53LbNOOaHp3orb0uFTE3aCqI,2328
|
|
162
|
-
sqlmesh/lsp/completions.py,sha256=
|
|
162
|
+
sqlmesh/lsp/completions.py,sha256=OTI7Ga6NNtaC_k80W1wI9Tft0gMBmaTJOt6gW_DF6GE,6484
|
|
163
163
|
sqlmesh/lsp/context.py,sha256=QGbNL0sifxzVJ7T1U5oWcJ5FXrOrLrVKt1jtH1qM_50,6099
|
|
164
|
-
sqlmesh/lsp/custom.py,sha256=
|
|
164
|
+
sqlmesh/lsp/custom.py,sha256=3eNuwP4Q5vT7l9RxpPYUiY-91c2w5FSTEKSHdGJf7CA,2705
|
|
165
165
|
sqlmesh/lsp/description.py,sha256=4QIGC9ix8IzmWF6DVUNhY4m1Crk3sNQA6hZ1RbyqU78,827
|
|
166
166
|
sqlmesh/lsp/helpers.py,sha256=igzUgeYAO3LUZFr3qN4l9hzztOy66lRubX93KtCMduY,654
|
|
167
167
|
sqlmesh/lsp/hints.py,sha256=j-blccBUil94yRoDjWfkSM0HqMmsKD6hP2TaWdWWVk4,3734
|
|
168
|
-
sqlmesh/lsp/main.py,sha256=
|
|
168
|
+
sqlmesh/lsp/main.py,sha256=70h_T_YSNAkQm3G7kfjytx0_tKP9_cd6ySOpT_Vo3Gg,35696
|
|
169
169
|
sqlmesh/lsp/reference.py,sha256=2rAYfwrKRfxlYA3psTDLacxYWvuFaouMyS7plOSYHiQ,23883
|
|
170
170
|
sqlmesh/lsp/uri.py,sha256=mvSLbZGmMTHPpliThOtVWiFcHnfJzp1w39q9l-xD2SI,802
|
|
171
171
|
sqlmesh/migrations/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
@@ -275,7 +275,7 @@ sqlmesh/utils/pydantic.py,sha256=I898jAFqa3qU6lG2uPpRebVFncOUo8ZrLWM_R3K3DHU,116
|
|
|
275
275
|
sqlmesh/utils/rich.py,sha256=xNZyPCqEc4TAlJlsEthg-5eYUWpaizz0QjBzO7a1Yv4,1509
|
|
276
276
|
sqlmesh/utils/windows.py,sha256=r7Yin4WEwbvH7sKA3hOJtRsclmscNuBeCklCfVPvtQs,611
|
|
277
277
|
sqlmesh/utils/yaml.py,sha256=np-WVcwmwsKghCgAj1OBBMsK1SXSRn4wR-H37cGiFr8,2282
|
|
278
|
-
sqlmesh-0.
|
|
278
|
+
sqlmesh-0.190.1.dev1.dist-info/licenses/LICENSE,sha256=OlMefUjgWJdULtf84BLW0AZZcY8DwdgQqb_1j2862j8,11346
|
|
279
279
|
web/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
280
280
|
web/client/dist/index.html,sha256=k5bAEoPDJ0BhYQ4hBcKWObITCxIgqOUC28nGXvEDrt0,5472
|
|
281
281
|
web/client/dist/assets/Audits-Pgs8N6IE.js,sha256=BQuc9kiznZSqTnzNrJSDNqAAdOTGjNQJt32M1sHZFok,1041
|
|
@@ -393,8 +393,8 @@ web/server/api/endpoints/models.py,sha256=ud-lRwriyI_OYg9tZchrBgeiXELiRTLNEodraf
|
|
|
393
393
|
web/server/api/endpoints/modules.py,sha256=8hqqgonGay_mJmpCw0IdbjsPhWlQH2VLdKAqha-myac,468
|
|
394
394
|
web/server/api/endpoints/plan.py,sha256=OYuQ_4dgbhG9ibTcX1a8mvYgH3ANxw9Fhbb4wg6QWqc,9222
|
|
395
395
|
web/server/api/endpoints/table_diff.py,sha256=SCy3-pr5x6bEEiOaZGCDbiHQhpgxwmnz3Acqa2Ie6jI,2090
|
|
396
|
-
sqlmesh-0.
|
|
397
|
-
sqlmesh-0.
|
|
398
|
-
sqlmesh-0.
|
|
399
|
-
sqlmesh-0.
|
|
400
|
-
sqlmesh-0.
|
|
396
|
+
sqlmesh-0.190.1.dev1.dist-info/METADATA,sha256=0O6EhEIHwVFgtfAGBAnZjDD5OQiQqg33vvpyEnGkjl8,26540
|
|
397
|
+
sqlmesh-0.190.1.dev1.dist-info/WHEEL,sha256=_zCd3N1l69ArxyTb8rzEoP9TpbYXkqRFSNOD5OuxnTs,91
|
|
398
|
+
sqlmesh-0.190.1.dev1.dist-info/entry_points.txt,sha256=pIYKtg-u-uO7BK_Y0qrdmfyj0bYrcMc3Xiqr5WE3VFk,121
|
|
399
|
+
sqlmesh-0.190.1.dev1.dist-info/top_level.txt,sha256=bspjo5vjELQkuN0qKuTFIbsrUt3Zeo8D2mlKeHG1LdE,12
|
|
400
|
+
sqlmesh-0.190.1.dev1.dist-info/RECORD,,
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|