-
Notifications
You must be signed in to change notification settings - Fork 380
Expand file tree
/
Copy pathcustom.ts
More file actions
108 lines (88 loc) · 2.3 KB
/
custom.ts
File metadata and controls
108 lines (88 loc) · 2.3 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
export interface AllModelsMethod {
method: 'sqlmesh/all_models'
request: AllModelsRequest
response: AllModelsResponse
}
export interface RenderModelMethod {
method: 'sqlmesh/render_model'
request: RenderModelRequest
response: RenderModelResponse
}
interface RenderModelRequest {
textDocumentUri: string
}
interface RenderModelResponse {
models: RenderModelEntry[]
}
export interface RenderModelEntry {
name: string
fqn: string
description: string | null | undefined
rendered_query: string
}
// @eslint-disable-next-line @typescript-eslint/consistent-type-definition
export type CustomLSPMethods =
| AllModelsMethod
| AbstractAPICall
| RenderModelMethod
| AllModelsForRenderMethod
| SupportedMethodsMethod
| FormatProjectMethod
interface AllModelsRequest {
textDocument: {
uri: string
}
}
interface AllModelsResponse {
models: string[]
keywords: string[]
}
export interface AbstractAPICallRequest {
endpoint: string
method: string
params: Record<string, any>
body: Record<string, any>
}
export interface AbstractAPICall {
method: 'sqlmesh/api'
request: AbstractAPICallRequest
response: object
}
export interface AllModelsForRenderMethod {
method: 'sqlmesh/all_models_for_render'
request: AllModelsForRenderRequest
response: AllModelsForRenderResponse
}
// eslint-disable-next-line @typescript-eslint/no-empty-object-type
interface AllModelsForRenderRequest {}
interface AllModelsForRenderResponse {
models: ModelForRendering[]
}
export interface ModelForRendering {
name: string
fqn: string
description: string | null | undefined
uri: string
}
export interface SupportedMethodsMethod {
method: 'sqlmesh/supported_methods'
request: SupportedMethodsRequest
response: SupportedMethodsResponse
}
// eslint-disable-next-line @typescript-eslint/no-empty-object-type
interface SupportedMethodsRequest {}
interface SupportedMethodsResponse {
methods: CustomMethod[]
}
interface CustomMethod {
name: string
}
export interface FormatProjectMethod {
method: 'sqlmesh/format_project'
request: FormatProjectRequest
response: FormatProjectResponse
}
// eslint-disable-next-line @typescript-eslint/no-empty-object-type
interface FormatProjectRequest {}
// eslint-disable-next-line @typescript-eslint/no-empty-object-type
interface FormatProjectResponse {}