forked from nblockchain/fsharp-debian
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Added switch between old/new language services
- Loading branch information
Omar Tawfik
committed
Feb 12, 2016
1 parent
21571ca
commit 497c854
Showing
7 changed files
with
51 additions
and
28 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
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
42 changes: 42 additions & 0 deletions
42
vsintegration/src/FSharp.LanguageService/LanguageServiceUtils.fs
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,42 @@ | ||
// Copyright (c) Microsoft Corporation. All Rights Reserved. Licensed under the Apache License, Version 2.0. See License.txt in the project root for license information. | ||
|
||
namespace Microsoft.VisualStudio.FSharp.LanguageService | ||
|
||
open System | ||
open System.Configuration | ||
open System.Diagnostics | ||
|
||
module FSRoslynCommonConstants = | ||
[<Literal>] | ||
let packageGuid = "871D2A70-12A2-4e42-9440-425DD92A4116" | ||
[<Literal>] | ||
let languageServiceGuid = "BC6DD5A5-D4D6-4dab-A00D-A51242DBAF1B" | ||
[<Literal>] | ||
let editorFactoryGuid = "4EB7CCB7-4336-4FFD-B12B-396E9FD079A9" | ||
[<Literal>] | ||
let FSharpLanguageName = "F#" | ||
[<Literal>] | ||
let FSharpContentType = "F#" | ||
|
||
module LanguageServiceUtils = | ||
|
||
// This key can have 'off', 'vs', and 'roslyn' states. Will default to 'vs'. | ||
let private languageServiceTypeKey = "fsharp-language-service" | ||
|
||
let private getConfigValue(key: string) = | ||
try | ||
ConfigurationManager.AppSettings.[key].ToLower() | ||
with ex -> | ||
Debug.Assert(false, sprintf "Error loading 'devenv.exe.config' configuration[%s]: %A" key ex) | ||
String.Empty | ||
|
||
let shouldEnableVSLanguageService = | ||
match getConfigValue(languageServiceTypeKey) with | ||
| "off" -> false | ||
| "roslyn" -> false | ||
| _ -> true | ||
|
||
let shouldEnableRoslynLanguageService = | ||
match getConfigValue(languageServiceTypeKey) with | ||
| "roslyn" -> true | ||
| _ -> false |