@@ -104,12 +104,26 @@ export abstract class OmnisharpServer {
104104 }
105105
106106 private _readOptions ( ) : omnisharp . Options {
107- const config = vscode . workspace . getConfiguration ( 'csharp' ) ;
107+ // Extra effort is taken below to ensure that legacy versions of options
108+ // are supported below. In particular, these are:
109+ //
110+ // - "csharp.omnisharp" -> "omnisharp.path"
111+ // - "csharp.omnisharpUsesMono" -> "omnisharp.useMono"
108112
109- return {
110- path : config . get < string > ( 'omnisharp' ) ,
111- usesMono : config . get < boolean > ( 'omnisharpUsesMono' )
112- } ;
113+ const omnisharpConfig = vscode . workspace . getConfiguration ( 'omnisharp' ) ;
114+ const csharpConfig = vscode . workspace . getConfiguration ( 'csharp' ) ;
115+
116+ const path = omnisharpConfig . has ( 'path' )
117+ ? omnisharpConfig . get < string > ( 'path' )
118+ : csharpConfig . get < string > ( 'omnisharp' ) ;
119+
120+ const useMono = omnisharpConfig . has ( 'useMono' )
121+ ? omnisharpConfig . get < boolean > ( 'useMono' )
122+ : csharpConfig . get < boolean > ( 'omnisharpUsesMono' ) ;
123+
124+ const loggingLevel = omnisharpConfig . get < string > ( 'loggingLevel' ) ;
125+
126+ return { path, useMono, loggingLevel } ;
113127 }
114128
115129 private _recordRequestDelay ( requestName : string , elapsedTime : number ) {
@@ -237,7 +251,7 @@ export abstract class OmnisharpServer {
237251 const options = this . _readOptions ( ) ;
238252
239253 let flavor : omnisharp . Flavor ;
240- if ( options . path !== undefined && options . usesMono === true ) {
254+ if ( options . path !== undefined && options . useMono === true ) {
241255 flavor = omnisharp . Flavor . Mono ;
242256 }
243257 else {
@@ -250,11 +264,17 @@ export abstract class OmnisharpServer {
250264
251265 const solutionPath = launchTarget . target ;
252266 const cwd = dirname ( solutionPath ) ;
253- const args = [
267+ let args = [
254268 '-s' , solutionPath ,
255269 '--hostPID' , process . pid . toString ( ) ,
256270 'DotNet:enablePackageRestore=false'
257- ] . concat ( this . _extraArgs ) ;
271+ ] ;
272+
273+ if ( options . loggingLevel === 'verbose' ) {
274+ args . push ( '-v' ) ;
275+ }
276+
277+ args = args . concat ( this . _extraArgs ) ;
258278
259279 this . _fireEvent ( Events . StdOut , `[INFO] Starting OmniSharp at '${ solutionPath } '...\n` ) ;
260280 this . _fireEvent ( Events . BeforeServerStart , solutionPath ) ;
@@ -391,7 +411,7 @@ export abstract class OmnisharpServer {
391411 return omnisharp . findServerPath ( options . path ) . then ( serverPath => {
392412 return resolve ( serverPath ) ;
393413 } ) . catch ( err => {
394- vscode . window . showWarningMessage ( `Invalid "csharp.omnisharp" user setting specified ('${ options . path } ).` ) ;
414+ vscode . window . showWarningMessage ( `Invalid value specified for "omnisharp.path" ('${ options . path } ).` ) ;
395415 return reject ( err ) ;
396416 } ) ;
397417 }
@@ -409,9 +429,9 @@ export abstract class OmnisharpServer {
409429 this . _channel . appendLine ( " 1. If it's not already installed, download and install Mono (https://www.mono-project.com)" ) ;
410430 this . _channel . appendLine ( " 2. Download and untar the latest OmniSharp Mono release from https://github.com/OmniSharp/omnisharp-roslyn/releases/" ) ;
411431 this . _channel . appendLine ( " 3. In Visual Studio Code, select Preferences->User Settings to open settings.json." ) ;
412- this . _channel . appendLine ( " 4. In settings.json, add a new setting: \"csharp. omnisharp\": \"/path/to/omnisharp/OmniSharp.exe\"" ) ;
413- this . _channel . appendLine ( " 4 . In settings.json, add a new setting: \"csharp.omnisharpUsesMono \": true" ) ;
414- this . _channel . appendLine ( " 5 . Restart Visual Studio Code." ) ;
432+ this . _channel . appendLine ( " 4. In settings.json, add a new setting: \"omnisharp.path \": \"/path/to/omnisharp/OmniSharp.exe\"" ) ;
433+ this . _channel . appendLine ( " 5 . In settings.json, add a new setting: \"omnisharp.useMono \": true" ) ;
434+ this . _channel . appendLine ( " 6 . Restart Visual Studio Code." ) ;
415435 this . _channel . show ( ) ;
416436
417437 throw err ;
0 commit comments