File tree Expand file tree Collapse file tree 3 files changed +17
-3
lines changed
Expand file tree Collapse file tree 3 files changed +17
-3
lines changed Original file line number Diff line number Diff line change 2323 ApiResponseGetLineage ,
2424 ApiResponseGetModels ,
2525)
26+
27+ # Define the command constant
28+ EXTERNAL_MODEL_UPDATE_COLUMNS = "sqlmesh.external_model_update_columns"
29+
2630from sqlmesh .lsp .completions import get_sql_completions
2731from sqlmesh .lsp .context import (
2832 LSPContext ,
Original file line number Diff line number Diff 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 )
Original file line number Diff line number Diff 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
You can’t perform that action at this time.
0 commit comments