sqlmesh 0.181.1.dev2__py3-none-any.whl → 0.181.1.dev3__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 +6 -5
- sqlmesh/lsp/reference.py +33 -0
- {sqlmesh-0.181.1.dev2.dist-info → sqlmesh-0.181.1.dev3.dist-info}/METADATA +1 -1
- {sqlmesh-0.181.1.dev2.dist-info → sqlmesh-0.181.1.dev3.dist-info}/RECORD +9 -9
- {sqlmesh-0.181.1.dev2.dist-info → sqlmesh-0.181.1.dev3.dist-info}/WHEEL +0 -0
- {sqlmesh-0.181.1.dev2.dist-info → sqlmesh-0.181.1.dev3.dist-info}/entry_points.txt +0 -0
- {sqlmesh-0.181.1.dev2.dist-info → sqlmesh-0.181.1.dev3.dist-info}/licenses/LICENSE +0 -0
- {sqlmesh-0.181.1.dev2.dist-info → sqlmesh-0.181.1.dev3.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.181.1.
|
|
21
|
-
__version_tuple__ = version_tuple = (0, 181, 1, '
|
|
20
|
+
__version__ = version = '0.181.1.dev3'
|
|
21
|
+
__version_tuple__ = version_tuple = (0, 181, 1, 'dev3')
|
sqlmesh/lsp/main.py
CHANGED
|
@@ -14,7 +14,10 @@ from sqlmesh.core.linter.definition import AnnotatedRuleViolation
|
|
|
14
14
|
from sqlmesh.lsp.completions import get_sql_completions
|
|
15
15
|
from sqlmesh.lsp.context import LSPContext, ModelTarget
|
|
16
16
|
from sqlmesh.lsp.custom import ALL_MODELS_FEATURE, AllModelsRequest, AllModelsResponse
|
|
17
|
-
from sqlmesh.lsp.reference import
|
|
17
|
+
from sqlmesh.lsp.reference import (
|
|
18
|
+
get_model_definitions_for_a_path,
|
|
19
|
+
filter_references_by_position,
|
|
20
|
+
)
|
|
18
21
|
|
|
19
22
|
|
|
20
23
|
class SQLMeshLanguageServer:
|
|
@@ -189,9 +192,7 @@ class SQLMeshLanguageServer:
|
|
|
189
192
|
references = get_model_definitions_for_a_path(
|
|
190
193
|
self.lsp_context, params.text_document.uri
|
|
191
194
|
)
|
|
192
|
-
|
|
193
|
-
return []
|
|
194
|
-
|
|
195
|
+
filtered_references = filter_references_by_position(references, params.position)
|
|
195
196
|
return [
|
|
196
197
|
types.LocationLink(
|
|
197
198
|
target_uri=reference.uri,
|
|
@@ -205,7 +206,7 @@ class SQLMeshLanguageServer:
|
|
|
205
206
|
),
|
|
206
207
|
origin_selection_range=reference.range,
|
|
207
208
|
)
|
|
208
|
-
for reference in
|
|
209
|
+
for reference in filtered_references
|
|
209
210
|
]
|
|
210
211
|
|
|
211
212
|
except Exception as e:
|
sqlmesh/lsp/reference.py
CHANGED
|
@@ -14,6 +14,39 @@ class Reference(PydanticModel):
|
|
|
14
14
|
uri: str
|
|
15
15
|
|
|
16
16
|
|
|
17
|
+
def filter_references_by_position(
|
|
18
|
+
references: t.List[Reference], position: Position
|
|
19
|
+
) -> t.List[Reference]:
|
|
20
|
+
"""
|
|
21
|
+
Filter references to only include those that contain the given position.
|
|
22
|
+
|
|
23
|
+
Args:
|
|
24
|
+
references: List of Reference objects
|
|
25
|
+
position: The cursor position to check
|
|
26
|
+
|
|
27
|
+
Returns:
|
|
28
|
+
List of Reference objects that contain the position
|
|
29
|
+
"""
|
|
30
|
+
filtered_references = []
|
|
31
|
+
|
|
32
|
+
for reference in references:
|
|
33
|
+
# Check if position is within the reference range
|
|
34
|
+
range_start = reference.range.start
|
|
35
|
+
range_end = reference.range.end
|
|
36
|
+
|
|
37
|
+
# Position is within range if it's after or at start and before or at end
|
|
38
|
+
if (
|
|
39
|
+
range_start.line < position.line
|
|
40
|
+
or (range_start.line == position.line and range_start.character <= position.character)
|
|
41
|
+
) and (
|
|
42
|
+
range_end.line > position.line
|
|
43
|
+
or (range_end.line == position.line and range_end.character >= position.character)
|
|
44
|
+
):
|
|
45
|
+
filtered_references.append(reference)
|
|
46
|
+
|
|
47
|
+
return filtered_references
|
|
48
|
+
|
|
49
|
+
|
|
17
50
|
def get_model_definitions_for_a_path(
|
|
18
51
|
lint_context: LSPContext, document_uri: str
|
|
19
52
|
) -> t.List[Reference]:
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
sqlmesh/__init__.py,sha256=uPXld_xTZ2NTruSfVJ_vR_w-uAxR3T-gMXAb-EphTe8,7167
|
|
2
|
-
sqlmesh/_version.py,sha256=
|
|
2
|
+
sqlmesh/_version.py,sha256=UmyRudwujStwkg8fCiTZPPqrQz-uxV47SXbuZcuhJOI,528
|
|
3
3
|
sqlmesh/magics.py,sha256=7BU9ec9zE4tjvZ3hdEqwFX2VVV-CI0h06TGZo_Ssi8M,39070
|
|
4
4
|
sqlmesh/py.typed,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
5
5
|
sqlmesh/cicd/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
@@ -158,8 +158,8 @@ sqlmesh/integrations/github/cicd/controller.py,sha256=AiEMsRW4WSVxXP_7oQSIdzBzmY
|
|
|
158
158
|
sqlmesh/lsp/completions.py,sha256=ScW0H9couhfW6QckEX2djVYTClRPXpT2Hdcg1qLfUUY,3479
|
|
159
159
|
sqlmesh/lsp/context.py,sha256=vUpbWYjKYuwDvU3zkzhAgw9An-TeVYe_5KTk-ec_UwM,1569
|
|
160
160
|
sqlmesh/lsp/custom.py,sha256=GvNAiW7imPI8xmIx3qLWN5FljGPHFJKh0N5b6aZnwRo,489
|
|
161
|
-
sqlmesh/lsp/main.py,sha256=
|
|
162
|
-
sqlmesh/lsp/reference.py,sha256=
|
|
161
|
+
sqlmesh/lsp/main.py,sha256=Xt7cwoocmmefsFO4UvBPlIsiXWs7YEGRp6jgT2tKn60,13672
|
|
162
|
+
sqlmesh/lsp/reference.py,sha256=veet4JZpVmUOIMiRPOvMtzu4DQEPT9Vk9c2bWAsFuQA,7366
|
|
163
163
|
sqlmesh/migrations/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
164
164
|
sqlmesh/migrations/v0001_init.py,sha256=h8FwMYJj9_O8yGpk12guaSaGwX5A3we2GiKeHrXi15o,2048
|
|
165
165
|
sqlmesh/migrations/v0002_remove_identify.py,sha256=ZeHuodZcQzRRZX0B0Y7SSkK3qqlDuz316kmvzojeyoU,113
|
|
@@ -265,7 +265,7 @@ sqlmesh/utils/pandas.py,sha256=j_tYhuPcWpzuPceZZ6IhdTVbmxYyGJW7l4FHr4bQqjM,1824
|
|
|
265
265
|
sqlmesh/utils/pydantic.py,sha256=ioaAzYF42PutEJRyAS11-AHguiCG3yWI6VRcTVa2G-g,10470
|
|
266
266
|
sqlmesh/utils/rich.py,sha256=xNZyPCqEc4TAlJlsEthg-5eYUWpaizz0QjBzO7a1Yv4,1509
|
|
267
267
|
sqlmesh/utils/yaml.py,sha256=np-WVcwmwsKghCgAj1OBBMsK1SXSRn4wR-H37cGiFr8,2282
|
|
268
|
-
sqlmesh-0.181.1.
|
|
268
|
+
sqlmesh-0.181.1.dev3.dist-info/licenses/LICENSE,sha256=OlMefUjgWJdULtf84BLW0AZZcY8DwdgQqb_1j2862j8,11346
|
|
269
269
|
web/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
270
270
|
web/client/dist/index.html,sha256=cQRIlDgkl6OgeWuHI9hM8bJhKUE9-Ji2NpQa2hlgNM8,5472
|
|
271
271
|
web/client/dist/assets/Audits-4U9LnWyN.js,sha256=reXu-sKJ76kiaAZIGkCPvgO68Km9tj1PN_9mx6X6WAY,997
|
|
@@ -382,8 +382,8 @@ web/server/api/endpoints/models.py,sha256=SzS5bshzdXyM6hb948sZ_3k-xhpGCHkxkb7pHz
|
|
|
382
382
|
web/server/api/endpoints/modules.py,sha256=8hqqgonGay_mJmpCw0IdbjsPhWlQH2VLdKAqha-myac,468
|
|
383
383
|
web/server/api/endpoints/plan.py,sha256=OYuQ_4dgbhG9ibTcX1a8mvYgH3ANxw9Fhbb4wg6QWqc,9222
|
|
384
384
|
web/server/api/endpoints/table_diff.py,sha256=Wd5YxeKbZB7AkrDvqFgvV9ZQlnKYOF1n5W_w2EHE_Zw,2085
|
|
385
|
-
sqlmesh-0.181.1.
|
|
386
|
-
sqlmesh-0.181.1.
|
|
387
|
-
sqlmesh-0.181.1.
|
|
388
|
-
sqlmesh-0.181.1.
|
|
389
|
-
sqlmesh-0.181.1.
|
|
385
|
+
sqlmesh-0.181.1.dev3.dist-info/METADATA,sha256=l36AoWMTkn-01VKUdqHoDQDnrgOqRuaB8_RQ6WXFDhE,25307
|
|
386
|
+
sqlmesh-0.181.1.dev3.dist-info/WHEEL,sha256=0CuiUZ_p9E4cD6NyLD6UG80LBXYyiSYZOKDm5lp32xk,91
|
|
387
|
+
sqlmesh-0.181.1.dev3.dist-info/entry_points.txt,sha256=pIYKtg-u-uO7BK_Y0qrdmfyj0bYrcMc3Xiqr5WE3VFk,121
|
|
388
|
+
sqlmesh-0.181.1.dev3.dist-info/top_level.txt,sha256=bspjo5vjELQkuN0qKuTFIbsrUt3Zeo8D2mlKeHG1LdE,12
|
|
389
|
+
sqlmesh-0.181.1.dev3.dist-info/RECORD,,
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|