55from sqlmesh .core .model .definition import SqlModel
66from sqlmesh .lsp .context import LSPContext , ModelTarget , AuditTarget
77from sqlglot import exp
8+ from sqlmesh .lsp .description import generate_markdown_description
89from sqlmesh .lsp .uri import URI
910from sqlmesh .utils .pydantic import PydanticModel
1011
@@ -16,12 +17,12 @@ class Reference(PydanticModel):
1617 Attributes:
1718 range: The range of the reference in the source file
1819 uri: The uri of the referenced model
19- description : The description of the referenced model
20+ markdown_description : The markdown description of the referenced model
2021 """
2122
2223 range : Range
2324 uri : str
24- description : t .Optional [str ] = None
25+ markdown_description : t .Optional [str ] = None
2526
2627
2728def by_position (position : Position ) -> t .Callable [[Reference ], bool ]:
@@ -176,11 +177,13 @@ def get_model_definitions_for_a_path(
176177 catalog_or_db_range = _range_from_token_position_details (catalog_or_db_meta , read_file )
177178 start_pos = catalog_or_db_range .start
178179
180+ description = generate_markdown_description (referenced_model )
181+
179182 references .append (
180183 Reference (
181184 uri = referenced_model_uri .value ,
182185 range = Range (start = start_pos , end = end_pos ),
183- description = referenced_model . description ,
186+ markdown_description = description ,
184187 )
185188 )
186189
0 commit comments