From ef9b18915bf8b6b9653fa2f018cb8dc5c9d85873 Mon Sep 17 00:00:00 2001 From: Vasily Kirichenko Date: Mon, 26 Dec 2016 11:19:23 +0300 Subject: [PATCH 1/2] enable Roslyn's non blocking code complete update Microsoft.CodeAnalysis.xxx packages to version 2.0.0-rc3-61225-01 --- .nuget/NuGet.Config | 1 + src/FSharpSource.Settings.targets | 2 +- vsintegration/packages.config | 12 +++++----- .../FSharp.Editor/Common/LanguageService.fs | 22 ++++++++++++++++++- 4 files changed, 29 insertions(+), 8 deletions(-) diff --git a/.nuget/NuGet.Config b/.nuget/NuGet.Config index d054d983ba1..6e7a50ea9f5 100644 --- a/.nuget/NuGet.Config +++ b/.nuget/NuGet.Config @@ -14,6 +14,7 @@ + diff --git a/src/FSharpSource.Settings.targets b/src/FSharpSource.Settings.targets index 2b9fe435d8e..b5256dad1bd 100644 --- a/src/FSharpSource.Settings.targets +++ b/src/FSharpSource.Settings.targets @@ -121,7 +121,7 @@ fsi.exe fslex.exe fsyacc.exe - 2.0.0-rc2 + 2.0.0-rc3-61225-01 14.0 14.3.25407 diff --git a/vsintegration/packages.config b/vsintegration/packages.config index 5b5d870661f..ab91451e15b 100644 --- a/vsintegration/packages.config +++ b/vsintegration/packages.config @@ -1,11 +1,11 @@ - - - - - - + + + + + + diff --git a/vsintegration/src/FSharp.Editor/Common/LanguageService.fs b/vsintegration/src/FSharp.Editor/Common/LanguageService.fs index 2c88f8929f1..8d26db580b5 100644 --- a/vsintegration/src/FSharp.Editor/Common/LanguageService.fs +++ b/vsintegration/src/FSharp.Editor/Common/LanguageService.fs @@ -18,6 +18,8 @@ open Microsoft.FSharp.Compiler.SourceCodeServices open Microsoft.CodeAnalysis open Microsoft.CodeAnalysis.Diagnostics open Microsoft.CodeAnalysis.Editor.Options +open Microsoft.CodeAnalysis.Completion +open Microsoft.CodeAnalysis.Options open Microsoft.VisualStudio open Microsoft.VisualStudio.Editor open Microsoft.VisualStudio.Text @@ -115,7 +117,6 @@ type internal ProjectInfoManager checkerProvider.Checker.InvalidateConfiguration(options) projectTable.[projectId] <- options - /// Get compilation defines relevant for syntax processing. /// Quicker then TryGetOptionsForDocumentOrProject as it doesn't need to recompute the exact project /// options for a script. @@ -174,6 +175,18 @@ type internal FSharpCheckerWorkspaceService = abstract Checker: FSharpChecker abstract ProjectInfoManager: ProjectInfoManager +type internal RoamingProfileStorageLocation(keyName: string) = + inherit OptionStorageLocation() + + member __.GetKeyNameForLanguage(languageName: string) = + let unsubstitutedKeyName = keyName + + match languageName with + | null -> unsubstitutedKeyName + | _ -> + let substituteLanguageName = if languageName = FSharpCommonConstants.FSharpLanguageName then "FSharp" else languageName + unsubstitutedKeyName.Replace("%LANGUAGE%", substituteLanguageName) + [] [, Microsoft.CodeAnalysis.Host.Mef.ServiceLayer.Default)>] type internal FSharpCheckerWorkspaceServiceFactory @@ -305,6 +318,13 @@ type internal FSharpLanguageService(package : FSharpPackage) as this = workspace.Options <- workspace.Options.WithChangedOption(NavigationBarOptions.ShowNavigationBar, FSharpCommonConstants.FSharpLanguageName, true) let textViewAdapter = this.Package.ComponentModel.GetService() + let blockForCompletionOption = + PerLanguageOption( + "CompletionOptions", "BlockForCompletionItems", defaultValue = true, + storageLocations = [| RoamingProfileStorageLocation("TextEditor.%%LANGUAGE%%.Specific.CompletionOptions - BlockForCompletionItems") |]) + + workspace.Options <- workspace.Options.WithChangedOption(blockForCompletionOption, FSharpCommonConstants.FSharpLanguageName, false) + match textView.GetBuffer() with | (VSConstants.S_OK, textLines) -> let filename = VsTextLines.GetFilename textLines From a9d84bd22612236350607bed96f2600f7dc40d8f Mon Sep 17 00:00:00 2001 From: Vasily Kirichenko Date: Thu, 29 Dec 2016 23:34:21 +0300 Subject: [PATCH 2/2] roll back to Microsoft.CodyAnalysis.xxx RC2 nuget packages --- .nuget/NuGet.Config | 1 - src/FSharpSource.Settings.targets | 2 +- vsintegration/packages.config | 12 ++++++------ 3 files changed, 7 insertions(+), 8 deletions(-) diff --git a/.nuget/NuGet.Config b/.nuget/NuGet.Config index 6e7a50ea9f5..d054d983ba1 100644 --- a/.nuget/NuGet.Config +++ b/.nuget/NuGet.Config @@ -14,7 +14,6 @@ - diff --git a/src/FSharpSource.Settings.targets b/src/FSharpSource.Settings.targets index b5256dad1bd..2b9fe435d8e 100644 --- a/src/FSharpSource.Settings.targets +++ b/src/FSharpSource.Settings.targets @@ -121,7 +121,7 @@ fsi.exe fslex.exe fsyacc.exe - 2.0.0-rc3-61225-01 + 2.0.0-rc2 14.0 14.3.25407 diff --git a/vsintegration/packages.config b/vsintegration/packages.config index ab91451e15b..5b5d870661f 100644 --- a/vsintegration/packages.config +++ b/vsintegration/packages.config @@ -1,11 +1,11 @@ - - - - - - + + + + + +