@@ -171,18 +171,17 @@ async function activateServerForFolder(context: ExtensionContext, uri: Uri, fold
171
171
return ;
172
172
}
173
173
174
- const runArgs : string [ ] = [ '--lsp' ] ;
175
- let debugArgs : string [ ] = [ '--lsp' ] ;
174
+ let args : string [ ] = [ '--lsp' ] ;
176
175
177
176
const serverVariant = workspace . getConfiguration ( 'haskell' , uri ) . languageServerVariant ;
178
177
// ghcide does not accept -d and -l params
179
178
if ( serverVariant !== 'ghcide' ) {
180
179
if ( logLevel === 'messages' ) {
181
- debugArgs = debugArgs . concat ( [ '-d' ] ) ;
180
+ args = args . concat ( [ '-d' ] ) ;
182
181
}
183
182
184
183
if ( logFile !== '' ) {
185
- debugArgs = debugArgs . concat ( [ '-l' , logFile ] ) ;
184
+ args = args . concat ( [ '-l' , logFile ] ) ;
186
185
}
187
186
}
188
187
@@ -193,18 +192,18 @@ async function activateServerForFolder(context: ExtensionContext, uri: Uri, fold
193
192
cwd : folder ? undefined : path . dirname ( uri . fsPath ) ,
194
193
} ;
195
194
196
- // If the VS Code extension is launched in debug mode then the debug server
197
- // options are used, otherwise the run options are used .
195
+ // For our intents and purposes, the server should be launched the same way in
196
+ // both debug and run mode .
198
197
const serverOptions : ServerOptions = {
199
- run : { command : serverExecutable , transport : TransportKind . stdio , args : runArgs , options : exeOptions } ,
200
- debug : { command : serverExecutable , transport : TransportKind . stdio , args : debugArgs , options : exeOptions } ,
198
+ run : { command : serverExecutable , transport : TransportKind . stdio , args, options : exeOptions } ,
199
+ debug : { command : serverExecutable , transport : TransportKind . stdio , args, options : exeOptions } ,
201
200
} ;
202
201
203
202
// Set a unique name per workspace folder (useful for multi-root workspaces).
204
203
const langName = 'Haskell' + ( folder ? ` (${ folder . name } )` : '' ) ;
205
204
const outputChannel : OutputChannel = window . createOutputChannel ( langName ) ;
206
- outputChannel . appendLine ( '[client] run command: "' + serverExecutable + ' ' + runArgs . join ( ' ' ) + '"' ) ;
207
- outputChannel . appendLine ( '[client] debug command: "' + serverExecutable + ' ' + debugArgs . join ( ' ' ) + '"' ) ;
205
+ outputChannel . appendLine ( '[client] run command: "' + serverExecutable + ' ' + args . join ( ' ' ) + '"' ) ;
206
+ outputChannel . appendLine ( '[client] debug command: "' + serverExecutable + ' ' + args . join ( ' ' ) + '"' ) ;
208
207
209
208
outputChannel . appendLine ( `[client] server cwd: ${ exeOptions . cwd } ` ) ;
210
209
0 commit comments