Skip to content

Commit 43f02b1

Browse files
committed
temp
1 parent 23d149b commit 43f02b1

File tree

3 files changed

+17
-3
lines changed

3 files changed

+17
-3
lines changed

sqlmesh/lsp/main.py

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,10 @@
2323
ApiResponseGetLineage,
2424
ApiResponseGetModels,
2525
)
26+
27+
# Define the command constant
28+
EXTERNAL_MODEL_UPDATE_COLUMNS = "sqlmesh.external_model_update_columns"
29+
2630
from sqlmesh.lsp.completions import get_sql_completions
2731
from sqlmesh.lsp.context import (
2832
LSPContext,

vscode/extension/src/extension.ts

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -131,8 +131,7 @@ export async function activate(context: vscode.ExtensionContext) {
131131
'LSP restart failed',
132132
)
133133
}
134-
context.subscriptions.push(lspClient)
135-
context.subscriptions.push(setupTestController(lspClient))
134+
// Don't push to subscriptions again during restart - it's already there
136135
} else {
137136
lspClient = new LSPClient()
138137
const result = await lspClient.start(invokedByUser)

vscode/extension/src/lsp/lsp.ts

Lines changed: 12 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -135,7 +135,18 @@ export class LSPClient implements Disposable {
135135
serverOptions,
136136
clientOptions,
137137
)
138-
await this.client.start()
138+
try {
139+
await this.client.start()
140+
} catch (error: any) {
141+
// Ignore the specific error about command already being registered
142+
if (error?.message?.includes("command 'sqlmesh.external_model_update_columns' already exists")) {
143+
traceInfo('Ignoring duplicate command registration error during restart')
144+
// Continue normally - the client is still functional
145+
} else {
146+
// Re-throw other errors
147+
throw error
148+
}
149+
}
139150
return ok(undefined)
140151
}
141152

0 commit comments

Comments
 (0)