-
Notifications
You must be signed in to change notification settings - Fork 676
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #721 from DustinCampbell/omnisharp-disable
Add 'omnisharp.autoStart' option that allows users to control whether OmniSharp is started automatically or not
- Loading branch information
Showing
6 changed files
with
64 additions
and
35 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,39 @@ | ||
/*--------------------------------------------------------------------------------------------- | ||
* Copyright (c) Microsoft Corporation. All rights reserved. | ||
* Licensed under the MIT License. See License.txt in the project root for license information. | ||
*--------------------------------------------------------------------------------------------*/ | ||
|
||
'use strict'; | ||
|
||
import * as vscode from 'vscode'; | ||
|
||
export interface Options { | ||
path?: string; | ||
useMono?: boolean; | ||
loggingLevel?: string; | ||
autoStart?: boolean; | ||
} | ||
|
||
export function readOptions(): Options { | ||
// Extra effort is taken below to ensure that legacy versions of options | ||
// are supported below. In particular, these are: | ||
// | ||
// - "csharp.omnisharp" -> "omnisharp.path" | ||
// - "csharp.omnisharpUsesMono" -> "omnisharp.useMono" | ||
|
||
const omnisharpConfig = vscode.workspace.getConfiguration('omnisharp'); | ||
const csharpConfig = vscode.workspace.getConfiguration('csharp'); | ||
|
||
const path = omnisharpConfig.has('path') | ||
? omnisharpConfig.get<string>('path') | ||
: csharpConfig.get<string>('omnisharp'); | ||
|
||
const useMono = omnisharpConfig.has('useMono') | ||
? omnisharpConfig.get<boolean>('useMono') | ||
: csharpConfig.get<boolean>('omnisharpUsesMono'); | ||
|
||
const loggingLevel = omnisharpConfig.get<string>('loggingLevel'); | ||
const autoStart = omnisharpConfig.get<boolean>('autoStart', true); | ||
|
||
return { path, useMono, loggingLevel, autoStart }; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters