sqlmesh 0.203.1.dev5__py3-none-any.whl → 0.203.1.dev6__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 +13 -8
- sqlmesh/lsp/reference.py +19 -3
- {sqlmesh-0.203.1.dev5.dist-info → sqlmesh-0.203.1.dev6.dist-info}/METADATA +1 -1
- {sqlmesh-0.203.1.dev5.dist-info → sqlmesh-0.203.1.dev6.dist-info}/RECORD +9 -9
- {sqlmesh-0.203.1.dev5.dist-info → sqlmesh-0.203.1.dev6.dist-info}/WHEEL +0 -0
- {sqlmesh-0.203.1.dev5.dist-info → sqlmesh-0.203.1.dev6.dist-info}/entry_points.txt +0 -0
- {sqlmesh-0.203.1.dev5.dist-info → sqlmesh-0.203.1.dev6.dist-info}/licenses/LICENSE +0 -0
- {sqlmesh-0.203.1.dev5.dist-info → sqlmesh-0.203.1.dev6.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.203.1.
|
|
21
|
-
__version_tuple__ = version_tuple = (0, 203, 1, '
|
|
20
|
+
__version__ = version = '0.203.1.dev6'
|
|
21
|
+
__version_tuple__ = version_tuple = (0, 203, 1, 'dev6')
|
sqlmesh/lsp/main.py
CHANGED
|
@@ -496,14 +496,15 @@ class SQLMeshLanguageServer:
|
|
|
496
496
|
target_range = reference.target_range
|
|
497
497
|
target_selection_range = reference.target_range
|
|
498
498
|
|
|
499
|
-
|
|
500
|
-
|
|
501
|
-
|
|
502
|
-
|
|
503
|
-
|
|
504
|
-
|
|
499
|
+
if reference.uri is not None:
|
|
500
|
+
location_links.append(
|
|
501
|
+
types.LocationLink(
|
|
502
|
+
target_uri=reference.uri,
|
|
503
|
+
target_selection_range=target_selection_range,
|
|
504
|
+
target_range=target_range,
|
|
505
|
+
origin_selection_range=reference.range,
|
|
506
|
+
)
|
|
505
507
|
)
|
|
506
|
-
)
|
|
507
508
|
return location_links
|
|
508
509
|
except Exception as e:
|
|
509
510
|
ls.show_message(f"Error getting references: {e}", types.MessageType.Error)
|
|
@@ -521,7 +522,11 @@ class SQLMeshLanguageServer:
|
|
|
521
522
|
all_references = get_all_references(context, uri, params.position)
|
|
522
523
|
|
|
523
524
|
# Convert references to Location objects
|
|
524
|
-
locations = [
|
|
525
|
+
locations = [
|
|
526
|
+
types.Location(uri=ref.uri, range=ref.range)
|
|
527
|
+
for ref in all_references
|
|
528
|
+
if ref.uri is not None
|
|
529
|
+
]
|
|
525
530
|
|
|
526
531
|
return locations if locations else None
|
|
527
532
|
except Exception as e:
|
sqlmesh/lsp/reference.py
CHANGED
|
@@ -38,10 +38,13 @@ class LSPExternalModelReference(PydanticModel):
|
|
|
38
38
|
"""A LSP reference to an external model."""
|
|
39
39
|
|
|
40
40
|
type: t.Literal["external_model"] = "external_model"
|
|
41
|
-
uri: str
|
|
42
41
|
range: Range
|
|
43
|
-
markdown_description: t.Optional[str] = None
|
|
44
42
|
target_range: t.Optional[Range] = None
|
|
43
|
+
uri: t.Optional[str] = None
|
|
44
|
+
"""The URI of the external model, typically a YAML file, it is optional because
|
|
45
|
+
external models can be unregistered and so they URI is not available."""
|
|
46
|
+
|
|
47
|
+
markdown_description: t.Optional[str] = None
|
|
45
48
|
|
|
46
49
|
|
|
47
50
|
class LSPCteReference(PydanticModel):
|
|
@@ -224,7 +227,7 @@ def get_model_definitions_for_a_path(
|
|
|
224
227
|
references.extend(column_references)
|
|
225
228
|
continue
|
|
226
229
|
|
|
227
|
-
# For non-CTE tables, process as before (external model references)
|
|
230
|
+
# For non-CTE tables, process these as before (external model references)
|
|
228
231
|
# Normalize the table reference
|
|
229
232
|
unaliased = table.copy()
|
|
230
233
|
if unaliased.args.get("alias") is not None:
|
|
@@ -247,6 +250,19 @@ def get_model_definitions_for_a_path(
|
|
|
247
250
|
model_or_snapshot=normalized_reference_name, raise_if_missing=False
|
|
248
251
|
)
|
|
249
252
|
if referenced_model is None:
|
|
253
|
+
table_meta = TokenPositionDetails.from_meta(table.this.meta)
|
|
254
|
+
table_range_sqlmesh = table_meta.to_range(read_file)
|
|
255
|
+
start_pos_sqlmesh = table_range_sqlmesh.start
|
|
256
|
+
end_pos_sqlmesh = table_range_sqlmesh.end
|
|
257
|
+
references.append(
|
|
258
|
+
LSPExternalModelReference(
|
|
259
|
+
range=Range(
|
|
260
|
+
start=to_lsp_position(start_pos_sqlmesh),
|
|
261
|
+
end=to_lsp_position(end_pos_sqlmesh),
|
|
262
|
+
),
|
|
263
|
+
markdown_description="Unregistered external model",
|
|
264
|
+
)
|
|
265
|
+
)
|
|
250
266
|
continue
|
|
251
267
|
referenced_model_path = referenced_model._path
|
|
252
268
|
if referenced_model_path is None:
|
|
@@ -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=AIQ1_26j9yB63C5QS0uBWPuItPdMqMM1PeCen45FLq4,528
|
|
3
3
|
sqlmesh/magics.py,sha256=bEzYqXHcM0P3CjyUZ1O9arlmXAdLAhoglKbQ29fD9AE,41842
|
|
4
4
|
sqlmesh/py.typed,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
5
5
|
sqlmesh/cicd/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
@@ -171,8 +171,8 @@ sqlmesh/lsp/description.py,sha256=PjguwyVw5YeYSgT0JMhkf5U1Jry-sDPLvQ2caIR9JPQ,85
|
|
|
171
171
|
sqlmesh/lsp/errors.py,sha256=3NMim_5J00Eypz7t8b7XbkBfy8gIsRkeq-VcjD4COtc,1489
|
|
172
172
|
sqlmesh/lsp/helpers.py,sha256=EFc1u3-b7kSv5-tNwmKUDxId72RCLDBnN2lLTgRSzzQ,1020
|
|
173
173
|
sqlmesh/lsp/hints.py,sha256=j-blccBUil94yRoDjWfkSM0HqMmsKD6hP2TaWdWWVk4,3734
|
|
174
|
-
sqlmesh/lsp/main.py,sha256=
|
|
175
|
-
sqlmesh/lsp/reference.py,sha256=
|
|
174
|
+
sqlmesh/lsp/main.py,sha256=WTf4BEqsnWRq0U41orREU3tsN2nZgiusLUVCdF_liEo,39952
|
|
175
|
+
sqlmesh/lsp/reference.py,sha256=YFg0DwwCcr7A99ZJV69V1H3oYmEw4uRFrhhAYR3SJYw,33160
|
|
176
176
|
sqlmesh/lsp/rename.py,sha256=399v1vyVRHHxvbCHVcuS4Pl8K2N-Z60JdZ6e1znOI4s,4397
|
|
177
177
|
sqlmesh/lsp/uri.py,sha256=mvSLbZGmMTHPpliThOtVWiFcHnfJzp1w39q9l-xD2SI,802
|
|
178
178
|
sqlmesh/migrations/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
@@ -285,7 +285,7 @@ sqlmesh/utils/pydantic.py,sha256=o_NsXbIpDqNpUA1Uc5xF0ZzoXQYYB0DfHwdRxBwXPNk,120
|
|
|
285
285
|
sqlmesh/utils/rich.py,sha256=cwQ5nJ6sgz64xHtoh6_ec7ReV5YpsOGhMtUJnwoRfEI,3549
|
|
286
286
|
sqlmesh/utils/windows.py,sha256=r7Yin4WEwbvH7sKA3hOJtRsclmscNuBeCklCfVPvtQs,611
|
|
287
287
|
sqlmesh/utils/yaml.py,sha256=hvo5lmybYLcIx4p6CQwufS8X4MbwS60lEBnCmYJCXmU,2336
|
|
288
|
-
sqlmesh-0.203.1.
|
|
288
|
+
sqlmesh-0.203.1.dev6.dist-info/licenses/LICENSE,sha256=OlMefUjgWJdULtf84BLW0AZZcY8DwdgQqb_1j2862j8,11346
|
|
289
289
|
web/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
290
290
|
web/client/dist/index.html,sha256=SXykdSRNgrT1k6I2dPZPEfpxPjIsi8-yVFijt-naSA4,5472
|
|
291
291
|
web/client/dist/assets/Audits-Jm353fhk.js,sha256=ry6b5IKT3hLAfD5C3T2BqxulfauEV0n0YZ2vsP4eQ_U,1041
|
|
@@ -403,8 +403,8 @@ web/server/api/endpoints/models.py,sha256=kwj0s7uve3iZSMfmjkoPVMFMeY1sD0peTeyrWf
|
|
|
403
403
|
web/server/api/endpoints/modules.py,sha256=8hqqgonGay_mJmpCw0IdbjsPhWlQH2VLdKAqha-myac,468
|
|
404
404
|
web/server/api/endpoints/plan.py,sha256=bbbY50W_2MsZSTxOHWMKz0tbIm75nsRSlPy8GI2fg9Q,9306
|
|
405
405
|
web/server/api/endpoints/table_diff.py,sha256=SCy3-pr5x6bEEiOaZGCDbiHQhpgxwmnz3Acqa2Ie6jI,2090
|
|
406
|
-
sqlmesh-0.203.1.
|
|
407
|
-
sqlmesh-0.203.1.
|
|
408
|
-
sqlmesh-0.203.1.
|
|
409
|
-
sqlmesh-0.203.1.
|
|
410
|
-
sqlmesh-0.203.1.
|
|
406
|
+
sqlmesh-0.203.1.dev6.dist-info/METADATA,sha256=1NhmFhYVKZRuyWZJ8hGPKFFTlo4Riv0E3usF6nf6CxU,26678
|
|
407
|
+
sqlmesh-0.203.1.dev6.dist-info/WHEEL,sha256=_zCd3N1l69ArxyTb8rzEoP9TpbYXkqRFSNOD5OuxnTs,91
|
|
408
|
+
sqlmesh-0.203.1.dev6.dist-info/entry_points.txt,sha256=pIYKtg-u-uO7BK_Y0qrdmfyj0bYrcMc3Xiqr5WE3VFk,121
|
|
409
|
+
sqlmesh-0.203.1.dev6.dist-info/top_level.txt,sha256=bspjo5vjELQkuN0qKuTFIbsrUt3Zeo8D2mlKeHG1LdE,12
|
|
410
|
+
sqlmesh-0.203.1.dev6.dist-info/RECORD,,
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|