22import typing as t
33from sqlmesh .utils .pydantic import PydanticModel
44
5+
6+ class CustomMethodRequestBaseClass (PydanticModel ):
7+ pass
8+
9+
10+ class CustomMethodResponseBaseClass (PydanticModel ):
11+ # Prefixing, so guaranteed not to collide
12+ response_error : t .Optional [str ] = None
13+
14+
515ALL_MODELS_FEATURE = "sqlmesh/all_models"
616
717
8- class AllModelsRequest (PydanticModel ):
18+ class AllModelsRequest (CustomMethodRequestBaseClass ):
919 """
1020 Request to get all the models that are in the current project.
1121 """
1222
1323 textDocument : types .TextDocumentIdentifier
1424
1525
16- class AllModelsResponse (PydanticModel ):
26+ class AllModelsResponse (CustomMethodResponseBaseClass ):
1727 """
1828 Response to get all the models that are in the current project.
1929 """
@@ -26,7 +36,7 @@ class AllModelsResponse(PydanticModel):
2636RENDER_MODEL_FEATURE = "sqlmesh/render_model"
2737
2838
29- class RenderModelRequest (PydanticModel ):
39+ class RenderModelRequest (CustomMethodRequestBaseClass ):
3040 textDocumentUri : str
3141
3242
@@ -41,7 +51,7 @@ class RenderModelEntry(PydanticModel):
4151 rendered_query : str
4252
4353
44- class RenderModelResponse (PydanticModel ):
54+ class RenderModelResponse (CustomMethodResponseBaseClass ):
4555 """
4656 Response to render a model.
4757 """
@@ -63,11 +73,11 @@ class ModelForRendering(PydanticModel):
6373 uri : str
6474
6575
66- class AllModelsForRenderRequest (PydanticModel ):
76+ class AllModelsForRenderRequest (CustomMethodRequestBaseClass ):
6777 pass
6878
6979
70- class AllModelsForRenderResponse (PydanticModel ):
80+ class AllModelsForRenderResponse (CustomMethodResponseBaseClass ):
7181 """
7282 Response to get all the models that are in the current project for rendering purposes.
7383 """
@@ -94,7 +104,7 @@ class CustomMethod(PydanticModel):
94104 name : str
95105
96106
97- class SupportedMethodsResponse (PydanticModel ):
107+ class SupportedMethodsResponse (CustomMethodResponseBaseClass ):
98108 """
99109 Response containing all supported custom LSP methods.
100110 """
@@ -105,15 +115,15 @@ class SupportedMethodsResponse(PydanticModel):
105115FORMAT_PROJECT_FEATURE = "sqlmesh/format_project"
106116
107117
108- class FormatProjectRequest (PydanticModel ):
118+ class FormatProjectRequest (CustomMethodRequestBaseClass ):
109119 """
110120 Request to format all models in the current project.
111121 """
112122
113123 pass
114124
115125
116- class FormatProjectResponse (PydanticModel ):
126+ class FormatProjectResponse (CustomMethodResponseBaseClass ):
117127 """
118128 Response to format project request.
119129 """
0 commit comments