From e3e148c795356e7a55059c5b09e03e82645d625b Mon Sep 17 00:00:00 2001 From: "Brett V. Forsgren" Date: Mon, 29 Apr 2019 11:37:46 -0700 Subject: [PATCH 1/7] update vs minor version (#6649) --- eng/Versions.props | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/eng/Versions.props b/eng/Versions.props index 3e989e6aa60..e80315e3e49 100644 --- a/eng/Versions.props +++ b/eng/Versions.props @@ -25,7 +25,7 @@ 16 - 1 + 2 $(VSMajorVersion).0 $(VSMajorVersion).$(VSMinorVersion).0 $(VSAssemblyVersionPrefix).0 From 52c75b395f0f0680048d430ad28a9b9c474593e3 Mon Sep 17 00:00:00 2001 From: "Kevin Ransom (msft)" Date: Tue, 14 May 2019 15:07:08 -0700 Subject: [PATCH 2/7] Update Versions.props --- eng/Versions.props | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/eng/Versions.props b/eng/Versions.props index 1d1a5679dfb..c2c31d5f6a7 100644 --- a/eng/Versions.props +++ b/eng/Versions.props @@ -18,8 +18,8 @@ $(FSCoreVersionPrefix).0 - 10.4 - $(FSPackageMajorVersion).3 + 10.5 + $(FSPackageMajorVersion).0 $(FSPackageVersion) $(FSPackageVersion).0 From 00cbd3f82a73f86fec123d78d4b0b3f998f1c4d6 Mon Sep 17 00:00:00 2001 From: Will Smith Date: Fri, 31 May 2019 00:47:00 -0700 Subject: [PATCH 3/7] Fixed uninitialized mutable locals inside loops (#6899) * Fixed uninitialized mutable locals inside loops * Update ForInDoMutableRegressionTest.fs --- src/fsharp/IlxGen.fs | 17 ++++- .../ForInDoMutableRegressionTest.fs | 73 +++++++++++++++++++ tests/fsharp/FSharpSuite.Tests.fsproj | 1 + 3 files changed, 88 insertions(+), 3 deletions(-) create mode 100644 tests/fsharp/Compiler/Regressions/ForInDoMutableRegressionTest.fs diff --git a/src/fsharp/IlxGen.fs b/src/fsharp/IlxGen.fs index c188b548073..826045231ac 100644 --- a/src/fsharp/IlxGen.fs +++ b/src/fsharp/IlxGen.fs @@ -826,8 +826,15 @@ and IlxGenEnv = /// Are we under the scope of a try, catch or finally? If so we can't tailcall. SEH = structured exception handling withinSEH: bool + + /// Are we inside of a recursive let binding, while loop, or a for loop? + isInLoop: bool } +let SetIsInLoop isInLoop eenv = + if eenv.isInLoop = isInLoop then eenv + else { eenv with isInLoop = isInLoop } + let ReplaceTyenv tyenv (eenv: IlxGenEnv) = {eenv with tyenv = tyenv } let EnvForTypars tps eenv = {eenv with tyenv = TypeReprEnv.ForTypars tps } @@ -3369,6 +3376,7 @@ and GenTryFinally cenv cgbuf eenv (bodyExpr, handlerExpr, m, resty, spTry, spFin //-------------------------------------------------------------------------- and GenForLoop cenv cgbuf eenv (spFor, v, e1, dir, e2, loopBody, m) sequel = + let eenv = SetIsInLoop true eenv let g = cenv.g // The JIT/NGen eliminate array-bounds checks for C# loops of form: @@ -3459,6 +3467,7 @@ and GenForLoop cenv cgbuf eenv (spFor, v, e1, dir, e2, loopBody, m) sequel = //-------------------------------------------------------------------------- and GenWhileLoop cenv cgbuf eenv (spWhile, e1, e2, m) sequel = + let eenv = SetIsInLoop true eenv let finish = CG.GenerateDelayMark cgbuf "while_finish" let startTest = CG.GenerateMark cgbuf "startTest" @@ -5083,6 +5092,7 @@ and GenLetRecFixup cenv cgbuf eenv (ilxCloSpec: IlxClosureSpec, e, ilField: ILFi /// Generate letrec bindings and GenLetRecBindings cenv (cgbuf: CodeGenBuffer) eenv (allBinds: Bindings, m) = + let eenv = SetIsInLoop true eenv // Fix up recursion for non-toplevel recursive bindings let bindsPossiblyRequiringFixup = allBinds |> List.filter (fun b -> @@ -5324,8 +5334,8 @@ and GenBindingAfterSequencePoint cenv cgbuf eenv sp (TBind(vspec, rhsExpr, _)) s | _ -> let storage = StorageForVal cenv.g m vspec eenv match storage, rhsExpr with - // locals are zero-init, no need to initialize them - | Local (_, realloc, _), Expr.Const (Const.Zero, _, _) when not realloc -> + // locals are zero-init, no need to initialize them, except if you are in a loop and the local is mutable. + | Local (_, realloc, _), Expr.Const (Const.Zero, _, _) when not realloc && not (eenv.isInLoop && vspec.IsMutable) -> CommitStartScope cgbuf startScopeMarkOpt | _ -> GenBindingRhs cenv cgbuf eenv SPSuppress vspec rhsExpr @@ -7463,7 +7473,8 @@ let GetEmptyIlxGenEnv (ilg: ILGlobals) ccu = liveLocals=IntMap.empty() innerVals = [] sigToImplRemapInfo = [] (* "module remap info" *) - withinSEH = false } + withinSEH = false + isInLoop = false } type IlxGenResults = { ilTypeDefs: ILTypeDef list diff --git a/tests/fsharp/Compiler/Regressions/ForInDoMutableRegressionTest.fs b/tests/fsharp/Compiler/Regressions/ForInDoMutableRegressionTest.fs new file mode 100644 index 00000000000..7319c2fab76 --- /dev/null +++ b/tests/fsharp/Compiler/Regressions/ForInDoMutableRegressionTest.fs @@ -0,0 +1,73 @@ +// Copyright (c) Microsoft Corporation. All Rights Reserved. See License.txt in the project root for license information. + +namespace FSharp.Compiler.UnitTests + +open System +open NUnit.Framework + +[] +module ForInDoMutableRegressionTest = + + /// This test is to ensure we initialize locals inside loops. + [] + let Script_ForInDoMutableRegressionTest() = + let script = + """ +open System.Collections.Generic + +let bug() = + for a in [1;2;3;4] do + let mutable x = null + if x = null then + x <- HashSet() + x.Add a |> ignore + let expected = [a] + let actual = List.ofSeq x + if expected <> actual then + failwith "Bug" + +let not_a_bug() = + for a in [1;2;3;4] do + let x = ref null + if (!x) = null then + x := HashSet() + (!x).Add a |> ignore + let expected = [a] + let actual = List.ofSeq (!x) + if expected <> actual then + failwith "Bug" + +let rec test_rec xs = + let mutable x = null + match xs with + | [] -> () + | a :: xs -> + if x = null then + x <- HashSet() + x.Add a |> ignore + let expected = [a] + let actual = List.ofSeq x + if expected <> actual then + failwith "Bug" + test_rec xs + +let test_for_loop () = + let xs = [|1;2;3;4|] + for i = 0 to xs.Length - 1 do + let a = xs.[i] + let mutable x = null + if x = null then + x <- HashSet() + x.Add a |> ignore + let expected = [a] + let actual = List.ofSeq x + if expected <> actual then + failwith "Bug" + +bug () +not_a_bug () +test_rec [1;2;3;4] +test_for_loop () + """ + + CompilerAssert.RunScript script [] diff --git a/tests/fsharp/FSharpSuite.Tests.fsproj b/tests/fsharp/FSharpSuite.Tests.fsproj index 56240b466b4..9376f62dcdf 100644 --- a/tests/fsharp/FSharpSuite.Tests.fsproj +++ b/tests/fsharp/FSharpSuite.Tests.fsproj @@ -37,6 +37,7 @@ + From 3de631a4ba0f54953bad33661008d39fb6df7669 Mon Sep 17 00:00:00 2001 From: Will Smith Date: Thu, 6 Jun 2019 15:29:37 -0700 Subject: [PATCH 4/7] Stop calling GetHierarchy in FSharpProjectOptionsReactor (#6946) * Stop calling GetHierarchy in FSharpProjectOptionsReactor * Fixing build --- fcs/build.fsx | 2 +- .../FSharpProjectOptionsManager.fs | 101 ++++++++---------- .../LegacyProjectWorkspaceMap.fs | 2 + 3 files changed, 46 insertions(+), 59 deletions(-) diff --git a/fcs/build.fsx b/fcs/build.fsx index ec53ced9c23..cf0e0d8deda 100644 --- a/fcs/build.fsx +++ b/fcs/build.fsx @@ -67,7 +67,7 @@ let releaseDir = Path.Combine(__SOURCE_DIRECTORY__, "../artifacts/bin/fcs/Releas let release = LoadReleaseNotes (__SOURCE_DIRECTORY__ + "/RELEASE_NOTES.md") let isAppVeyorBuild = buildServer = BuildServer.AppVeyor let isJenkinsBuild = buildServer = BuildServer.Jenkins -let isVersionTag tag = Version.TryParse tag |> fst +let isVersionTag (tag: string) = Version.TryParse tag |> fst let hasRepoVersionTag = isAppVeyorBuild && AppVeyorEnvironment.RepoTag && isVersionTag AppVeyorEnvironment.RepoTagName let assemblyVersion = if hasRepoVersionTag then AppVeyorEnvironment.RepoTagName else release.NugetVersion diff --git a/vsintegration/src/FSharp.Editor/LanguageService/FSharpProjectOptionsManager.fs b/vsintegration/src/FSharp.Editor/LanguageService/FSharpProjectOptionsManager.fs index 51cb4bbeec8..a555b47ff3a 100644 --- a/vsintegration/src/FSharp.Editor/LanguageService/FSharpProjectOptionsManager.fs +++ b/vsintegration/src/FSharp.Editor/LanguageService/FSharpProjectOptionsManager.fs @@ -24,58 +24,30 @@ open Microsoft.CodeAnalysis.ExternalAccess.FSharp.LanguageServices [] module private FSharpProjectOptionsHelpers = - let mapCpsProjectToSite(workspace:VisualStudioWorkspace, project:Project, serviceProvider:System.IServiceProvider, cpsCommandLineOptions: IDictionary) = - let hier = workspace.GetHierarchy(project.Id) + let mapCpsProjectToSite(project:Project, cpsCommandLineOptions: IDictionary) = let sourcePaths, referencePaths, options = match cpsCommandLineOptions.TryGetValue(project.Id) with | true, (sourcePaths, options) -> sourcePaths, [||], options | false, _ -> [||], [||], [||] + let mutable errorReporter = Unchecked.defaultof<_> { - new IProvideProjectSite with - member x.GetProjectSite() = - let mutable errorReporter = - let reporter = ProjectExternalErrorReporter(project.Id, "FS", serviceProvider) - Some(reporter:> IVsLanguageServiceBuildErrorReporter2) - - { - new IProjectSite with - member __.Description = project.Name - member __.CompilationSourceFiles = sourcePaths - member __.CompilationOptions = - Array.concat [options; referencePaths |> Array.map(fun r -> "-r:" + r)] - member __.CompilationReferences = referencePaths - member site.CompilationBinOutputPath = site.CompilationOptions |> Array.tryPick (fun s -> if s.StartsWith("-o:") then Some s.[3..] else None) - member __.ProjectFileName = project.FilePath - member __.AdviseProjectSiteChanges(_,_) = () - member __.AdviseProjectSiteCleaned(_,_) = () - member __.AdviseProjectSiteClosed(_,_) = () - member __.IsIncompleteTypeCheckEnvironment = false - member __.TargetFrameworkMoniker = "" - member __.ProjectGuid = project.Id.Id.ToString() - member __.LoadTime = System.DateTime.Now - member __.ProjectProvider = Some (x) - member __.BuildErrorReporter with get () = errorReporter and set (v) = errorReporter <- v - } - interface IVsHierarchy with - member __.SetSite(psp) = hier.SetSite(psp) - member __.GetSite(psp) = hier.GetSite(ref psp) - member __.QueryClose(pfCanClose)= hier.QueryClose(ref pfCanClose) - member __.Close() = hier.Close() - member __.GetGuidProperty(itemid, propid, pguid) = hier.GetGuidProperty(itemid, propid, ref pguid) - member __.SetGuidProperty(itemid, propid, rguid) = hier.SetGuidProperty(itemid, propid, ref rguid) - member __.GetProperty(itemid, propid, pvar) = hier.GetProperty(itemid, propid, ref pvar) - member __.SetProperty(itemid, propid, var) = hier.SetProperty(itemid, propid, var) - member __.GetNestedHierarchy(itemid, iidHierarchyNested, ppHierarchyNested, pitemidNested) = - hier.GetNestedHierarchy(itemid, ref iidHierarchyNested, ref ppHierarchyNested, ref pitemidNested) - member __.GetCanonicalName(itemid, pbstrName) = hier.GetCanonicalName(itemid, ref pbstrName) - member __.ParseCanonicalName(pszName, pitemid) = hier.ParseCanonicalName(pszName, ref pitemid) - member __.Unused0() = hier.Unused0() - member __.AdviseHierarchyEvents(pEventSink, pdwCookie) = hier.AdviseHierarchyEvents(pEventSink, ref pdwCookie) - member __.UnadviseHierarchyEvents(dwCookie) = hier.UnadviseHierarchyEvents(dwCookie) - member __.Unused1() = hier.Unused1() - member __.Unused2() = hier.Unused2() - member __.Unused3() = hier.Unused3() - member __.Unused4() = hier.Unused4() + new IProjectSite with + member __.Description = project.Name + member __.CompilationSourceFiles = sourcePaths + member __.CompilationOptions = + Array.concat [options; referencePaths |> Array.map(fun r -> "-r:" + r)] + member __.CompilationReferences = referencePaths + member site.CompilationBinOutputPath = site.CompilationOptions |> Array.tryPick (fun s -> if s.StartsWith("-o:") then Some s.[3..] else None) + member __.ProjectFileName = project.FilePath + member __.AdviseProjectSiteChanges(_,_) = () + member __.AdviseProjectSiteCleaned(_,_) = () + member __.AdviseProjectSiteClosed(_,_) = () + member __.IsIncompleteTypeCheckEnvironment = false + member __.TargetFrameworkMoniker = "" + member __.ProjectGuid = project.Id.Id.ToString() + member __.LoadTime = System.DateTime.Now + member __.ProjectProvider = None + member __.BuildErrorReporter with get () = errorReporter and set (v) = errorReporter <- v } let hasProjectVersionChanged (oldProject: Project) (newProject: Project) = @@ -108,11 +80,13 @@ type private FSharpProjectOptionsMessage = | ClearSingleFileOptionsCache of DocumentId [] -type private FSharpProjectOptionsReactor (workspace: VisualStudioWorkspace, settings: EditorOptions, serviceProvider, checkerProvider: FSharpCheckerProvider) = +type private FSharpProjectOptionsReactor (_workspace: VisualStudioWorkspace, settings: EditorOptions, _serviceProvider, checkerProvider: FSharpCheckerProvider) = let cancellationTokenSource = new CancellationTokenSource() // Hack to store command line options from HandleCommandLineChanges - let cpsCommandLineOptions = new ConcurrentDictionary() + let cpsCommandLineOptions = ConcurrentDictionary() + + let legacyProjectSites = ConcurrentDictionary() let cache = Dictionary() let singleFileCache = Dictionary() @@ -158,6 +132,16 @@ type private FSharpProjectOptionsReactor (workspace: VisualStudioWorkspace, sett else return Some(parsingOptions, projectOptions) } + + let tryGetProjectSite (project: Project) = + // Cps + if cpsCommandLineOptions.ContainsKey project.Id then + Some (mapCpsProjectToSite(project, cpsCommandLineOptions)) + else + // Legacy + match legacyProjectSites.TryGetValue project.Id with + | true, site -> Some site + | _ -> None let rec tryComputeOptions (project: Project) = async { @@ -183,15 +167,9 @@ type private FSharpProjectOptionsReactor (workspace: VisualStudioWorkspace, sett return None else - let hier = workspace.GetHierarchy(projectId) - let projectSite = - match hier with - // Legacy - | (:? IProvideProjectSite as provideSite) -> provideSite.GetProjectSite() - // Cps - | _ -> - let provideSite = mapCpsProjectToSite(workspace, project, serviceProvider, cpsCommandLineOptions) - provideSite.GetProjectSite() + match tryGetProjectSite project with + | None -> return None + | Some projectSite -> let otherOptions = project.ProjectReferences @@ -283,6 +261,7 @@ type private FSharpProjectOptionsReactor (workspace: VisualStudioWorkspace, sett | FSharpProjectOptionsMessage.ClearOptions(projectId) -> cache.Remove(projectId) |> ignore + legacyProjectSites.TryRemove(projectId) |> ignore | FSharpProjectOptionsMessage.ClearSingleFileOptionsCache(documentId) -> singleFileCache.Remove(documentId) |> ignore } @@ -304,6 +283,9 @@ type private FSharpProjectOptionsReactor (workspace: VisualStudioWorkspace, sett member __.SetCpsCommandLineOptions(projectId, sourcePaths, options) = cpsCommandLineOptions.[projectId] <- (sourcePaths, options) + member __.SetLegacyProjectSite (projectId, projectSite) = + legacyProjectSites.[projectId] <- projectSite + member __.TryGetCachedOptionsByProjectId(projectId) = match cache.TryGetValue(projectId) with | true, result -> Some(result) @@ -344,6 +326,9 @@ type internal FSharpProjectOptionsManager | _ -> () ) + member __.SetLegacyProjectSite (projectId, projectSite) = + reactor.SetLegacyProjectSite (projectId, projectSite) + /// Clear a project from the project table member this.ClearInfoForProject(projectId:ProjectId) = reactor.ClearOptionsByProjectId(projectId) diff --git a/vsintegration/src/FSharp.Editor/LanguageService/LegacyProjectWorkspaceMap.fs b/vsintegration/src/FSharp.Editor/LanguageService/LegacyProjectWorkspaceMap.fs index 0bf2e5c8063..426ecf9a5f2 100644 --- a/vsintegration/src/FSharp.Editor/LanguageService/LegacyProjectWorkspaceMap.fs +++ b/vsintegration/src/FSharp.Editor/LanguageService/LegacyProjectWorkspaceMap.fs @@ -46,6 +46,8 @@ type internal LegacyProjectWorkspaceMap(solution: IVsSolution, let projectId = projectContext.Id + projectInfoManager.SetLegacyProjectSite (projectId, site) + // Sync the source files in projectContext. Note that these source files are __not__ maintained in order in projectContext // as edits are made. It seems this is ok because the source file list is only used to drive roslyn per-file checking. let updatedFiles = site.CompilationSourceFiles |> wellFormedFilePathSetIgnoreCase From bff4fffde6c760c07ecdbc4bb8447a3d54a35f49 Mon Sep 17 00:00:00 2001 From: "Brett V. Forsgren" Date: Wed, 12 Jun 2019 10:30:59 -0700 Subject: [PATCH 5/7] don't ship LSP in VS in `release/dev16.2` (#6983) --- eng/targets/Settings.props | 3 ++- .../Vsix/VisualFSharpFull/Source.extension.vsixmanifest | 3 +++ .../src/FSharp.Editor/QuickInfo/QuickInfoProvider.fs | 9 +++++---- .../src/FSharp.UIResources/AdvancedOptionsControl.xaml | 3 +++ 4 files changed, 13 insertions(+), 5 deletions(-) diff --git a/eng/targets/Settings.props b/eng/targets/Settings.props index 5d145af11cf..6360088320f 100644 --- a/eng/targets/Settings.props +++ b/eng/targets/Settings.props @@ -8,7 +8,8 @@ - true + + false diff --git a/vsintegration/Vsix/VisualFSharpFull/Source.extension.vsixmanifest b/vsintegration/Vsix/VisualFSharpFull/Source.extension.vsixmanifest index e272923a3da..cae75397665 100644 --- a/vsintegration/Vsix/VisualFSharpFull/Source.extension.vsixmanifest +++ b/vsintegration/Vsix/VisualFSharpFull/Source.extension.vsixmanifest @@ -28,7 +28,10 @@ + + diff --git a/vsintegration/src/FSharp.Editor/QuickInfo/QuickInfoProvider.fs b/vsintegration/src/FSharp.Editor/QuickInfo/QuickInfoProvider.fs index 8ac6f929186..7b90bb3aefc 100644 --- a/vsintegration/src/FSharp.Editor/QuickInfo/QuickInfoProvider.fs +++ b/vsintegration/src/FSharp.Editor/QuickInfo/QuickInfoProvider.fs @@ -164,7 +164,7 @@ type internal FSharpAsyncQuickInfoSource checkerProvider:FSharpCheckerProvider, projectInfoManager:FSharpProjectOptionsManager, textBuffer:ITextBuffer, - settings: EditorOptions + _settings: EditorOptions ) = static let joinWithLineBreaks segments = @@ -206,9 +206,10 @@ type internal FSharpAsyncQuickInfoSource // This method can be called from the background thread. // Do not call IServiceProvider.GetService here. override __.GetQuickInfoItemAsync(session:IAsyncQuickInfoSession, cancellationToken:CancellationToken) : Task = - // if using LSP, just bail early - if settings.Advanced.UsePreviewTextHover then Task.FromResult(null) - else + // The following lines should be disabled for branch `release/dev16.2`, enabled otherwise + //// if using LSP, just bail early + //if settings.Advanced.UsePreviewTextHover then Task.FromResult(null) + //else let triggerPoint = session.GetTriggerPoint(textBuffer.CurrentSnapshot) match triggerPoint.HasValue with | false -> Task.FromResult(null) diff --git a/vsintegration/src/FSharp.UIResources/AdvancedOptionsControl.xaml b/vsintegration/src/FSharp.UIResources/AdvancedOptionsControl.xaml index a14d4cbadfb..f8dd82f7d06 100644 --- a/vsintegration/src/FSharp.UIResources/AdvancedOptionsControl.xaml +++ b/vsintegration/src/FSharp.UIResources/AdvancedOptionsControl.xaml @@ -24,10 +24,13 @@ + + From 0aeb4a056f1edd9603ce0cf139d7df4ca8c7a51e Mon Sep 17 00:00:00 2001 From: Will Smith Date: Thu, 13 Jun 2019 12:14:13 -0700 Subject: [PATCH 6/7] Roslyn Shim - Round 2 (#6734) * Added shims over document diagnostic analyzers * Shims over completions and sig help * Removed content type definitions, putting them in external access * Added shim over InlineRenameService * We are now simply using export on the diagnostic analyzers * Using shim for document highlights service * GoToDefinition implemented with shims * NavigableSymbolsService shimmed * GoToDefinitionService shimmed * NavigationBarItemService shimmmed * Shimmed NavigateToSearchService * Quick cast fix * Using FSharpGlyphTags * Removed CommentSelectionService as it is ExternalAccess now * Shimmed BlockStructureService * Trying to finish shim * Removed folder from FSharp.Editor * Update package * fixing build * Trying to fix build * match roslyn package version --- RoslynPackageVersion.txt | 2 +- eng/Versions.props | 1 + .../BlockComment/CommentSelectionService.fs | 19 -- .../CodeFix/RemoveUnusedOpens.fs | 3 +- .../src/FSharp.Editor/CodeFix/SimplifyName.fs | 5 +- .../CodeLens/FSharpCodeLensService.fs | 7 +- .../src/FSharp.Editor/Common/ContentType.fs | 20 -- .../src/FSharp.Editor/Common/RoslynHelpers.fs | 8 - .../Completion/CompletionProvider.fs | 9 +- .../Completion/CompletionService.fs | 10 +- .../Completion/CompletionUtils.fs | 3 +- .../Completion/FileSystemCompletion.fs | 138 +++++++------- .../FSharp.Editor/Completion/SignatureHelp.fs | 27 +-- .../Diagnostics/DocumentDiagnosticAnalyzer.fs | 68 +++---- .../Diagnostics/ProjectDiagnosticAnalyzer.fs | 30 +-- .../SimplifyNameDiagnosticAnalyzer.fs | 180 ++++++++---------- .../Diagnostics/UnusedDeclarationsAnalyzer.fs | 66 +++---- .../UnusedOpensDiagnosticAnalyzer.fs | 64 +++---- .../DocumentHighlightsService.fs | 16 +- .../src/FSharp.Editor/FSharp.Editor.fsproj | 3 +- .../InlineRename/InlineRenameService.fs | 36 ++-- .../LanguageService/LanguageService.fs | 2 +- .../Navigation/FindUsagesService.fs | 2 +- .../Navigation/GoToDefinition.fs | 43 ++--- .../Navigation/GoToDefinitionService.fs | 5 +- .../Navigation/NavigableSymbolsService.fs | 3 +- .../Navigation/NavigateToSearchService.fs | 94 ++++----- .../Navigation/NavigationBarItemService.fs | 33 +--- .../Structure/BlockStructureService.fs | 59 +++--- .../FSharp.LanguageService.fsproj | 1 + .../GetTypesVS.UnitTests.fsproj | 3 +- .../UnitTests/VisualFSharp.UnitTests.fsproj | 1 + 32 files changed, 413 insertions(+), 548 deletions(-) delete mode 100644 vsintegration/src/FSharp.Editor/BlockComment/CommentSelectionService.fs delete mode 100644 vsintegration/src/FSharp.Editor/Common/ContentType.fs diff --git a/RoslynPackageVersion.txt b/RoslynPackageVersion.txt index fd1d6f6d9bc..cc99af67911 100644 --- a/RoslynPackageVersion.txt +++ b/RoslynPackageVersion.txt @@ -1 +1 @@ -3.1.0-beta3-19222-02 +3.2.0-beta4-19312-15 diff --git a/eng/Versions.props b/eng/Versions.props index 3cd88abc9bf..258d4255ad6 100644 --- a/eng/Versions.props +++ b/eng/Versions.props @@ -55,6 +55,7 @@ https://dotnet.myget.org/F/roslyn-tools/api/v3/index.json; https://api.nuget.org/v3/index.json; https://dotnet.myget.org/F/roslyn/api/v3/index.json; + https://dotnet.myget.org/F/roslyn-analyzers/api/v3/index.json; https://dotnet.myget.org/F/symreader-converter/api/v3/index.json; https://dotnet.myget.org/F/interactive-window/api/v3/index.json; https://myget.org/F/vs-devcore/api/v3/index.json; diff --git a/vsintegration/src/FSharp.Editor/BlockComment/CommentSelectionService.fs b/vsintegration/src/FSharp.Editor/BlockComment/CommentSelectionService.fs deleted file mode 100644 index 4c54a45a519..00000000000 --- a/vsintegration/src/FSharp.Editor/BlockComment/CommentSelectionService.fs +++ /dev/null @@ -1,19 +0,0 @@ -namespace Microsoft.VisualStudio.FSharp.Editor - -open Microsoft.CodeAnalysis.CommentSelection -open Microsoft.CodeAnalysis.Host.Mef -open System.Composition -open System.Threading.Tasks - -[] -[, FSharpConstants.FSharpLanguageName)>] -type CommentSelectionService() = - interface ICommentSelectionService with - member this.GetInfoAsync(_document, _textSpan, _cancellationToken) = - Task.FromResult(CommentSelectionInfo(supportsSingleLineComment=true, - supportsBlockComment=true, - singleLineCommentString="//", - blockCommentStartString="(*", - blockCommentEndString="*)")) - - member this.FormatAsync(document, _changes, _cancellationToken) = Task.FromResult(document) diff --git a/vsintegration/src/FSharp.Editor/CodeFix/RemoveUnusedOpens.fs b/vsintegration/src/FSharp.Editor/CodeFix/RemoveUnusedOpens.fs index e2ccc7e22c8..8b659aafb32 100644 --- a/vsintegration/src/FSharp.Editor/CodeFix/RemoveUnusedOpens.fs +++ b/vsintegration/src/FSharp.Editor/CodeFix/RemoveUnusedOpens.fs @@ -10,6 +10,7 @@ open Microsoft.CodeAnalysis.Diagnostics open Microsoft.CodeAnalysis.Text open Microsoft.CodeAnalysis.CodeFixes open Microsoft.CodeAnalysis.CodeActions +open Microsoft.CodeAnalysis.ExternalAccess.FSharp.Diagnostics open FSharp.Compiler.Range @@ -21,7 +22,7 @@ type internal FSharpRemoveUnusedOpensCodeFixProvider projectInfoManager: FSharpProjectOptionsManager ) = inherit CodeFixProvider() - let fixableDiagnosticIds = [IDEDiagnosticIds.RemoveUnnecessaryImportsDiagnosticId] + let fixableDiagnosticIds = [FSharpIDEDiagnosticIds.RemoveUnnecessaryImportsDiagnosticId] let createCodeFix (title: string, context: CodeFixContext) = CodeAction.Create( diff --git a/vsintegration/src/FSharp.Editor/CodeFix/SimplifyName.fs b/vsintegration/src/FSharp.Editor/CodeFix/SimplifyName.fs index aeeae1773ef..a2768640387 100644 --- a/vsintegration/src/FSharp.Editor/CodeFix/SimplifyName.fs +++ b/vsintegration/src/FSharp.Editor/CodeFix/SimplifyName.fs @@ -10,12 +10,13 @@ open Microsoft.CodeAnalysis open Microsoft.CodeAnalysis.Diagnostics open Microsoft.CodeAnalysis.Text open Microsoft.CodeAnalysis.CodeFixes +open Microsoft.CodeAnalysis.ExternalAccess.FSharp.Diagnostics open SymbolHelpers -[] +[] type internal FSharpSimplifyNameCodeFixProvider() = inherit CodeFixProvider() - let fixableDiagnosticId = IDEDiagnosticIds.SimplifyNamesDiagnosticId + let fixableDiagnosticId = FSharpIDEDiagnosticIds.SimplifyNamesDiagnosticId override __.FixableDiagnosticIds = ImmutableArray.Create(fixableDiagnosticId) diff --git a/vsintegration/src/FSharp.Editor/CodeLens/FSharpCodeLensService.fs b/vsintegration/src/FSharp.Editor/CodeLens/FSharpCodeLensService.fs index add51361f19..21a70f89e2e 100644 --- a/vsintegration/src/FSharp.Editor/CodeLens/FSharpCodeLensService.fs +++ b/vsintegration/src/FSharp.Editor/CodeLens/FSharpCodeLensService.fs @@ -14,6 +14,7 @@ open System.Windows.Media.Animation open Microsoft.CodeAnalysis open Microsoft.CodeAnalysis.Editor.Shared.Extensions open Microsoft.CodeAnalysis.ExternalAccess.FSharp.Classification +open Microsoft.CodeAnalysis.ExternalAccess.FSharp.Editor.Shared.Extensions open FSharp.Compiler open FSharp.Compiler.SourceCodeServices @@ -91,7 +92,7 @@ type internal FSharpCodeLensService logInfof "Tagged text %A" taggedText #endif let textBlock = new TextBlock(Background = Brushes.AliceBlue, Opacity = 0.0, TextTrimming = TextTrimming.None) - DependencyObjectExtensions.SetDefaultTextProperties(textBlock, formatMap.Value) + FSharpDependencyObjectExtensions.SetDefaultTextProperties(textBlock, formatMap.Value) let prefix = Documents.Run settings.CodeLens.Prefix prefix.Foreground <- SolidColorBrush(Color.FromRgb(153uy, 153uy, 153uy)) @@ -116,7 +117,7 @@ type internal FSharpCodeLensService coloredProperties.SetForeground(Color.FromRgb(153uy, 153uy, 153uy)) let run = Documents.Run text.Text - DependencyObjectExtensions.SetTextProperties (run, actualProperties) + FSharpDependencyObjectExtensions.SetTextProperties (run, actualProperties) let inl = match text with @@ -126,7 +127,7 @@ type internal FSharpCodeLensService navigation.NavigateTo nav.Range) h :> Documents.Inline | _ -> run :> _ - DependencyObjectExtensions.SetTextProperties (inl, actualProperties) + FSharpDependencyObjectExtensions.SetTextProperties (inl, actualProperties) textBlock.Inlines.Add inl diff --git a/vsintegration/src/FSharp.Editor/Common/ContentType.fs b/vsintegration/src/FSharp.Editor/Common/ContentType.fs deleted file mode 100644 index 2e92332ccbe..00000000000 --- a/vsintegration/src/FSharp.Editor/Common/ContentType.fs +++ /dev/null @@ -1,20 +0,0 @@ -// Copyright (c) Microsoft Corporation. All Rights Reserved. See License.txt in the project root for license information. - -namespace Microsoft.VisualStudio.FSharp.Editor - -open System.ComponentModel.Composition - -open Microsoft.CodeAnalysis.Editor -open Microsoft.VisualStudio.Utilities -open Microsoft.CodeAnalysis.ExternalAccess.FSharp.Editor - -module FSharpStaticTypeDefinitions = - [] - [] - [] - let FSharpContentTypeDefinition = ContentTypeDefinition() - - [] - [] - [] - let FSharpSignatureHelpContentTypeDefinition = ContentTypeDefinition() diff --git a/vsintegration/src/FSharp.Editor/Common/RoslynHelpers.fs b/vsintegration/src/FSharp.Editor/Common/RoslynHelpers.fs index 4d66d133b78..ae8c5fe4fb6 100644 --- a/vsintegration/src/FSharp.Editor/Common/RoslynHelpers.fs +++ b/vsintegration/src/FSharp.Editor/Common/RoslynHelpers.fs @@ -130,14 +130,6 @@ module internal RoslynHelpers = let StartAsyncUnitAsTask cancellationToken (computation:Async) = StartAsyncAsTask cancellationToken computation :> Task - let private TheSupportedDiagnostics = - // We are constructing our own descriptors at run-time. Compiler service is already doing error formatting and localization. - let dummyDescriptors = - [| for i in 0 .. 10000 -> DiagnosticDescriptor(sprintf "FS%04d" i, String.Empty, String.Empty, String.Empty, DiagnosticSeverity.Error, true, null, null) |] - ImmutableArray.Create(dummyDescriptors) - - let SupportedDiagnostics() = TheSupportedDiagnostics - let ConvertError(error: FSharpErrorInfo, location: Location) = // Normalize the error message into the same format that we will receive it from the compiler. // This ensures that IntelliSense and Compiler errors in the 'Error List' are de-duplicated. diff --git a/vsintegration/src/FSharp.Editor/Completion/CompletionProvider.fs b/vsintegration/src/FSharp.Editor/Completion/CompletionProvider.fs index 989f210a19a..9ec89f069dd 100644 --- a/vsintegration/src/FSharp.Editor/Completion/CompletionProvider.fs +++ b/vsintegration/src/FSharp.Editor/Completion/CompletionProvider.fs @@ -12,6 +12,7 @@ open Microsoft.CodeAnalysis open Microsoft.CodeAnalysis.Completion open Microsoft.CodeAnalysis.Options open Microsoft.CodeAnalysis.Text +open Microsoft.CodeAnalysis.ExternalAccess.FSharp.Completion open Microsoft.VisualStudio.Shell @@ -48,7 +49,7 @@ type internal FSharpCompletionProvider |> List.filter (fun (keyword, _) -> not (PrettyNaming.IsOperatorName keyword)) |> List.sortBy (fun (keyword, _) -> keyword) |> List.mapi (fun n (keyword, description) -> - CommonCompletionItem.Create(keyword, null, CompletionItemRules.Default, Nullable Glyph.Keyword, sortText = sprintf "%06d" (1000000 + n)) + FSharpCommonCompletionItem.Create(keyword, null, CompletionItemRules.Default, Nullable Glyph.Keyword, sortText = sprintf "%06d" (1000000 + n)) .AddProperty("description", description) .AddProperty(IsKeywordPropName, "")) @@ -73,7 +74,7 @@ type internal FSharpCompletionProvider // * let xs = [1..10] <<---- Don't commit autocomplete! (same for arrays) let noCommitChars = [|' '; '='; ','; '.'; '<'; '>'; '('; ')'; '!'; ':'; '['; ']'; '|'|].ToImmutableArray() - CompletionItemRules.Default.WithCommitCharacterRule(CharacterSetModificationRule.Create(CharacterSetModificationKind.Remove, noCommitChars)) + CompletionItemRules.Default.WithCommitCharacterRules(ImmutableArray.Create (CharacterSetModificationRule.Create(CharacterSetModificationKind.Remove, noCommitChars))) static let getRules showAfterCharIsTyped = if showAfterCharIsTyped then noCommitOnSpaceRules else CompletionItemRules.Default @@ -152,7 +153,7 @@ type internal FSharpCompletionProvider | _, idents -> Array.last idents let completionItem = - CommonCompletionItem.Create(name, null, rules = getRules intellisenseOptions.ShowAfterCharIsTyped, glyph = Nullable (Microsoft.CodeAnalysis.ExternalAccess.FSharp.FSharpGlyphHelpersObsolete.Convert(glyph)), filterText = filterText) + FSharpCommonCompletionItem.Create(name, null, rules = getRules intellisenseOptions.ShowAfterCharIsTyped, glyph = Nullable glyph, filterText = filterText) .AddProperty(FullNamePropName, declarationItem.FullName) let completionItem = @@ -198,7 +199,7 @@ type internal FSharpCompletionProvider } override this.ShouldTriggerCompletion(sourceText: SourceText, caretPosition: int, trigger: CompletionTrigger, _: OptionSet) = - use _logBlock = Logger.LogBlockMessage this.Name LogEditorFunctionId.Completion_ShouldTrigger + use _logBlock = Logger.LogBlock LogEditorFunctionId.Completion_ShouldTrigger let getInfo() = let documentId = workspace.GetDocumentIdInCurrentContext(sourceText.Container) diff --git a/vsintegration/src/FSharp.Editor/Completion/CompletionService.fs b/vsintegration/src/FSharp.Editor/Completion/CompletionService.fs index ef138b72c7d..6303e2498d2 100644 --- a/vsintegration/src/FSharp.Editor/Completion/CompletionService.fs +++ b/vsintegration/src/FSharp.Editor/Completion/CompletionService.fs @@ -9,6 +9,7 @@ open Microsoft.CodeAnalysis open Microsoft.CodeAnalysis.Completion open Microsoft.CodeAnalysis.Host open Microsoft.CodeAnalysis.Host.Mef +open Microsoft.CodeAnalysis.ExternalAccess.FSharp.Completion open Microsoft.VisualStudio.Shell @@ -26,10 +27,11 @@ type internal FSharpCompletionService let builtInProviders = ImmutableArray.Create( FSharpCompletionProvider(workspace, serviceProvider, checkerProvider, projectInfoManager, assemblyContentProvider), - HashDirectiveCompletionProvider(workspace, projectInfoManager, - [ Completion.Create("""\s*#load\s+(@?"*(?"[^"]*"?))""", [".fs"; ".fsx"], useIncludeDirectives = true) - Completion.Create("""\s*#r\s+(@?"*(?"[^"]*"?))""", [".dll"; ".exe"], useIncludeDirectives = true) - Completion.Create("""\s*#I\s+(@?"*(?"[^"]*"?))""", ["\x00"], useIncludeDirectives = false) ])) + FSharpCommonCompletionProvider.Create( + HashDirectiveCompletionProvider(workspace, projectInfoManager, + [ Completion.Create("""\s*#load\s+(@?"*(?"[^"]*"?))""", [".fs"; ".fsx"], useIncludeDirectives = true) + Completion.Create("""\s*#r\s+(@?"*(?"[^"]*"?))""", [".dll"; ".exe"], useIncludeDirectives = true) + Completion.Create("""\s*#I\s+(@?"*(?"[^"]*"?))""", ["\x00"], useIncludeDirectives = false) ]))) override this.Language = FSharpConstants.FSharpLanguageName override this.GetBuiltInProviders() = builtInProviders diff --git a/vsintegration/src/FSharp.Editor/Completion/CompletionUtils.fs b/vsintegration/src/FSharp.Editor/Completion/CompletionUtils.fs index 6691640c4fd..5d210d5f363 100644 --- a/vsintegration/src/FSharp.Editor/Completion/CompletionUtils.fs +++ b/vsintegration/src/FSharp.Editor/Completion/CompletionUtils.fs @@ -8,6 +8,7 @@ open Microsoft.CodeAnalysis open Microsoft.CodeAnalysis.Classification open Microsoft.CodeAnalysis.Text open Microsoft.CodeAnalysis.Completion +open Microsoft.CodeAnalysis.ExternalAccess.FSharp.Completion open System.Globalization open FSharp.Compiler.SourceCodeServices @@ -81,7 +82,7 @@ module internal CompletionUtils = | _ -> false let isStartingNewWord (sourceText, position) = - CommonCompletionUtilities.IsStartingNewWord(sourceText, position, (fun ch -> isIdentifierStartCharacter ch), (fun ch -> isIdentifierPartCharacter ch)) + FSharpCommonCompletionUtilities.IsStartingNewWord(sourceText, position, (fun ch -> isIdentifierStartCharacter ch), (fun ch -> isIdentifierPartCharacter ch)) let shouldProvideCompletion (documentId: DocumentId, filePath: string, defines: string list, sourceText: SourceText, triggerPosition: int) : bool = let textLines = sourceText.Lines diff --git a/vsintegration/src/FSharp.Editor/Completion/FileSystemCompletion.fs b/vsintegration/src/FSharp.Editor/Completion/FileSystemCompletion.fs index e92caa22d4d..d8028425009 100644 --- a/vsintegration/src/FSharp.Editor/Completion/FileSystemCompletion.fs +++ b/vsintegration/src/FSharp.Editor/Completion/FileSystemCompletion.fs @@ -12,6 +12,7 @@ open Microsoft.CodeAnalysis open Microsoft.CodeAnalysis.Completion open Microsoft.CodeAnalysis.Text open Microsoft.CodeAnalysis.Classification +open Microsoft.CodeAnalysis.ExternalAccess.FSharp.Completion type internal Completion = { DirectiveRegex: Regex @@ -23,7 +24,6 @@ type internal Completion = UseIncludeDirectives = useIncludeDirectives } type internal HashDirectiveCompletionProvider(workspace: Workspace, projectInfoManager: FSharpProjectOptionsManager, completions: Completion list) = - inherit CommonCompletionProvider() let [] NetworkPath = "\\\\" let commitRules = ImmutableArray.Create(CharacterSetModificationRule.Create(CharacterSetModificationKind.Replace, '"', '\\', ',', '/')) @@ -82,75 +82,77 @@ type internal HashDirectiveCompletionProvider(workspace: Workspace, projectInfoM ) |> Seq.toList - override this.ProvideCompletionsAsync(context) = - asyncMaybe { - let document = context.Document - let position = context.Position - do! let extension = Path.GetExtension document.FilePath - Option.guard (extension = ".fsx" || extension = ".fsscript") - - let! ct = liftAsync Async.CancellationToken - let! text = document.GetTextAsync(ct) - do! Option.guard (isInStringLiteral(text, position)) - let line = text.Lines.GetLineFromPosition(position) - let lineText = text.ToString(TextSpan.FromBounds(line.Start, position)) + interface IFSharpCommonCompletionProvider with + + member this.ProvideCompletionsAsync(context) = + asyncMaybe { + let document = context.Document + let position = context.Position + do! let extension = Path.GetExtension document.FilePath + Option.guard (extension = ".fsx" || extension = ".fsscript") + + let! ct = liftAsync Async.CancellationToken + let! text = document.GetTextAsync(ct) + do! Option.guard (isInStringLiteral(text, position)) + let line = text.Lines.GetLineFromPosition(position) + let lineText = text.ToString(TextSpan.FromBounds(line.Start, position)) - let! completion, quotedPathGroup = - completions |> List.tryPick (fun completion -> - match completion.DirectiveRegex.Match lineText with - | m when m.Success -> - let quotedPathGroup = m.Groups.["literal"] - let endsWithQuote = PathCompletionUtilities.EndsWithQuote(quotedPathGroup.Value) - if endsWithQuote && (position >= line.Start + m.Length) then - None - else - Some (completion, quotedPathGroup) - | _ -> None) - - let snapshot = text.FindCorrespondingEditorTextSnapshot() + let! completion, quotedPathGroup = + completions |> List.tryPick (fun completion -> + match completion.DirectiveRegex.Match lineText with + | m when m.Success -> + let quotedPathGroup = m.Groups.["literal"] + let endsWithQuote = PathCompletionUtilities.EndsWithQuote(quotedPathGroup.Value) + if endsWithQuote && (position >= line.Start + m.Length) then + None + else + Some (completion, quotedPathGroup) + | _ -> None) + + let snapshot = text.FindCorrespondingEditorTextSnapshot() - do! Option.guard (not (isNull snapshot)) - - let extraSearchPaths = - if completion.UseIncludeDirectives then - getIncludeDirectives (text, position) - else [] - - let defaultSearchPath = Path.GetDirectoryName document.FilePath - let searchPaths = defaultSearchPath :: extraSearchPaths - - let helper = - FileSystemCompletionHelper( - Glyph.OpenFolder, - completion.AllowableExtensions |> List.tryPick getFileGlyph |> Option.defaultValue Glyph.None, - Seq.toImmutableArray searchPaths, - null, - completion.AllowableExtensions |> Seq.toImmutableArray, - rules) + do! Option.guard (not (isNull snapshot)) + + let extraSearchPaths = + if completion.UseIncludeDirectives then + getIncludeDirectives (text, position) + else [] + + let defaultSearchPath = Path.GetDirectoryName document.FilePath + let searchPaths = defaultSearchPath :: extraSearchPaths + + let helper = + FSharpFileSystemCompletionHelper( + Glyph.OpenFolder, + completion.AllowableExtensions |> List.tryPick getFileGlyph |> Option.defaultValue Glyph.None, + Seq.toImmutableArray searchPaths, + null, + completion.AllowableExtensions |> Seq.toImmutableArray, + rules) - let pathThroughLastSlash = getPathThroughLastSlash(text, position, quotedPathGroup) - let! items = helper.GetItemsAsync(pathThroughLastSlash, ct) |> Async.AwaitTask |> liftAsync - context.AddItems(items) - } - |> Async.Ignore - |> RoslynHelpers.StartAsyncUnitAsTask context.CancellationToken + let pathThroughLastSlash = getPathThroughLastSlash(text, position, quotedPathGroup) + let! items = helper.GetItemsAsync(pathThroughLastSlash, ct) |> Async.AwaitTask |> liftAsync + context.AddItems(items) + } + |> Async.Ignore + |> RoslynHelpers.StartAsyncUnitAsTask context.CancellationToken - override __.IsInsertionTrigger(text, position, _) = - // Bring up completion when the user types a quote (i.e.: #r "), or if they type a slash - // path separator character, or if they type a comma (#r "foo,version..."). - // Also, if they're starting a word. i.e. #r "c:\W - let ch = text.[position] - let isTriggerChar = - ch = '"' || ch = '\\' || ch = ',' || ch = '/' || - CommonCompletionUtilities.IsStartingNewWord(text, position, (fun x -> Char.IsLetter x), (fun x -> Char.IsLetterOrDigit x)) - isTriggerChar && isInStringLiteral(text, position) + member __.IsInsertionTrigger(text, position, _) = + // Bring up completion when the user types a quote (i.e.: #r "), or if they type a slash + // path separator character, or if they type a comma (#r "foo,version..."). + // Also, if they're starting a word. i.e. #r "c:\W + let ch = text.[position] + let isTriggerChar = + ch = '"' || ch = '\\' || ch = ',' || ch = '/' || + FSharpCommonCompletionUtilities.IsStartingNewWord(text, position, (fun x -> Char.IsLetter x), (fun x -> Char.IsLetterOrDigit x)) + isTriggerChar && isInStringLiteral(text, position) - override __.GetTextChangeAsync(selectedItem, ch, cancellationToken) = - // When we commit "\\" when the user types \ we have to adjust for the fact that the - // controller will automatically append \ after we commit. Because of that, we don't - // want to actually commit "\\" as we'll end up with "\\\". So instead we just commit - // "\" and know that controller will append "\" and give us "\\". - if selectedItem.DisplayText = NetworkPath && ch = Nullable '\\' then - Task.FromResult(Nullable(TextChange(selectedItem.Span, "\\"))) - else - base.GetTextChangeAsync(selectedItem, ch, cancellationToken) \ No newline at end of file + member __.GetTextChangeAsync(baseGetTextChangeAsync, selectedItem, ch, cancellationToken) = + // When we commit "\\" when the user types \ we have to adjust for the fact that the + // controller will automatically append \ after we commit. Because of that, we don't + // want to actually commit "\\" as we'll end up with "\\\". So instead we just commit + // "\" and know that controller will append "\" and give us "\\". + if selectedItem.DisplayText = NetworkPath && ch = Nullable '\\' then + Task.FromResult(Nullable(TextChange(selectedItem.Span, "\\"))) + else + baseGetTextChangeAsync.Invoke(selectedItem, ch, cancellationToken) \ No newline at end of file diff --git a/vsintegration/src/FSharp.Editor/Completion/SignatureHelp.fs b/vsintegration/src/FSharp.Editor/Completion/SignatureHelp.fs index 288feb97870..cde4f1d22dd 100644 --- a/vsintegration/src/FSharp.Editor/Completion/SignatureHelp.fs +++ b/vsintegration/src/FSharp.Editor/Completion/SignatureHelp.fs @@ -9,6 +9,7 @@ open System.Collections.Generic open Microsoft.CodeAnalysis open Microsoft.CodeAnalysis.SignatureHelp open Microsoft.CodeAnalysis.Text +open Microsoft.CodeAnalysis.ExternalAccess.FSharp.SignatureHelp open Microsoft.VisualStudio.Text open Microsoft.VisualStudio.Shell @@ -19,7 +20,7 @@ open FSharp.Compiler.Range open FSharp.Compiler.SourceCodeServices [] -[] +[)>] type internal FSharpSignatureHelpProvider [] ( @@ -188,7 +189,7 @@ type internal FSharpSignatureHelpProvider return Some items } - interface ISignatureHelpProvider with + interface IFSharpSignatureHelpProvider with member this.IsTriggerCharacter(c) = c ='(' || c = '<' || c = ',' member this.IsRetriggerCharacter(c) = c = ')' || c = '>' || c = '=' @@ -200,7 +201,7 @@ type internal FSharpSignatureHelpProvider let! textVersion = document.GetTextVersionAsync(cancellationToken) let triggerTypedChar = - if triggerInfo.TriggerCharacter.HasValue && triggerInfo.TriggerReason = SignatureHelpTriggerReason.TypeCharCommand then + if triggerInfo.TriggerCharacter.HasValue && triggerInfo.TriggerReason = FSharpSignatureHelpTriggerReason.TypeCharCommand then Some triggerInfo.TriggerCharacter.Value else None @@ -211,27 +212,13 @@ type internal FSharpSignatureHelpProvider |> Array.map (fun (hasParamArrayArg, doc, prefixParts, separatorParts, suffixParts, parameters, descriptionParts) -> let parameters = parameters |> Array.map (fun (paramName, isOptional, _typeText, paramDoc, displayParts) -> - SignatureHelpParameter(paramName,isOptional,documentationFactory=(fun _ -> paramDoc :> seq<_>),displayParts=displayParts)) - SignatureHelpItem(isVariadic=hasParamArrayArg, documentationFactory=(fun _ -> doc :> seq<_>),prefixParts=prefixParts,separatorParts=separatorParts,suffixParts=suffixParts,parameters=parameters,descriptionParts=descriptionParts)) + FSharpSignatureHelpParameter(paramName,isOptional,documentationFactory=(fun _ -> paramDoc :> seq<_>),displayParts=displayParts)) + FSharpSignatureHelpItem(isVariadic=hasParamArrayArg, documentationFactory=(fun _ -> doc :> seq<_>),prefixParts=prefixParts,separatorParts=separatorParts,suffixParts=suffixParts,parameters=parameters,descriptionParts=descriptionParts)) - return SignatureHelpItems(items,applicableSpan,argumentIndex,argumentCount,Option.toObj argumentName) + return FSharpSignatureHelpItems(items,applicableSpan,argumentIndex,argumentCount,Option.toObj argumentName) with ex -> Assert.Exception(ex) return! None } |> Async.map Option.toObj |> RoslynHelpers.StartAsyncAsTask cancellationToken - -open System.ComponentModel.Composition -open Microsoft.VisualStudio.Utilities -open Microsoft.VisualStudio.Text.Classification -open Microsoft.CodeAnalysis.Editor.Implementation.IntelliSense.SignatureHelp.Presentation - -// Enable colorized signature help for F# buffers - -[)>] -[] -type internal FSharpSignatureHelpClassifierProvider [] (typeMap) = - interface IClassifierProvider with - override __.GetClassifier (buffer: ITextBuffer) = - buffer.Properties.GetOrCreateSingletonProperty(fun _ -> SignatureHelpClassifier(buffer, typeMap) :> _) diff --git a/vsintegration/src/FSharp.Editor/Diagnostics/DocumentDiagnosticAnalyzer.fs b/vsintegration/src/FSharp.Editor/Diagnostics/DocumentDiagnosticAnalyzer.fs index 44b94805950..273e0bad4b6 100644 --- a/vsintegration/src/FSharp.Editor/Diagnostics/DocumentDiagnosticAnalyzer.fs +++ b/vsintegration/src/FSharp.Editor/Diagnostics/DocumentDiagnosticAnalyzer.fs @@ -3,6 +3,7 @@ namespace Microsoft.VisualStudio.FSharp.Editor open System +open System.Composition open System.Collections.Immutable open System.Collections.Generic open System.Threading @@ -11,6 +12,7 @@ open System.Threading.Tasks open Microsoft.CodeAnalysis open Microsoft.CodeAnalysis.Diagnostics open Microsoft.CodeAnalysis.Text +open Microsoft.CodeAnalysis.Host.Mef open Microsoft.CodeAnalysis.ExternalAccess.FSharp.Diagnostics open FSharp.Compiler @@ -22,9 +24,8 @@ type internal DiagnosticsType = | Syntax | Semantic -[] -type internal FSharpDocumentDiagnosticAnalyzer() = - inherit DocumentDiagnosticAnalyzer() +[)>] +type internal FSharpDocumentDiagnosticAnalyzer [] () = static let userOpName = "DocumentDiagnosticAnalyzer" let getChecker(document: Document) = @@ -106,40 +107,33 @@ type internal FSharpDocumentDiagnosticAnalyzer() = return results } - override __.Priority = 10 // Default = 50 + interface IFSharpDocumentDiagnosticAnalyzer with - override this.SupportedDiagnostics = RoslynHelpers.SupportedDiagnostics() - - override this.AnalyzeSyntaxAsync(document: Document, cancellationToken: CancellationToken): Task> = - let projectInfoManager = getProjectInfoManager document - asyncMaybe { - let! parsingOptions, projectOptions = projectInfoManager.TryGetOptionsForEditingDocumentOrProject(document, cancellationToken) - let! sourceText = document.GetTextAsync(cancellationToken) - let! textVersion = document.GetTextVersionAsync(cancellationToken) - return! - FSharpDocumentDiagnosticAnalyzer.GetDiagnostics(getChecker document, document.FilePath, sourceText, textVersion.GetHashCode(), parsingOptions, projectOptions, DiagnosticsType.Syntax) - |> liftAsync - } - |> Async.map (Option.defaultValue ImmutableArray.Empty) - |> RoslynHelpers.StartAsyncAsTask cancellationToken - - override this.AnalyzeSemanticsAsync(document: Document, cancellationToken: CancellationToken): Task> = - let projectInfoManager = getProjectInfoManager document - asyncMaybe { - let! parsingOptions, _, projectOptions = projectInfoManager.TryGetOptionsForDocumentOrProject(document, cancellationToken) - let! sourceText = document.GetTextAsync(cancellationToken) - let! textVersion = document.GetTextVersionAsync(cancellationToken) - if document.Project.Name <> FSharpConstants.FSharpMiscellaneousFilesName || isScriptFile document.FilePath then + member this.AnalyzeSyntaxAsync(document: Document, cancellationToken: CancellationToken): Task> = + let projectInfoManager = getProjectInfoManager document + asyncMaybe { + let! parsingOptions, projectOptions = projectInfoManager.TryGetOptionsForEditingDocumentOrProject(document, cancellationToken) + let! sourceText = document.GetTextAsync(cancellationToken) + let! textVersion = document.GetTextVersionAsync(cancellationToken) return! - FSharpDocumentDiagnosticAnalyzer.GetDiagnostics(getChecker document, document.FilePath, sourceText, textVersion.GetHashCode(), parsingOptions, projectOptions, DiagnosticsType.Semantic) + FSharpDocumentDiagnosticAnalyzer.GetDiagnostics(getChecker document, document.FilePath, sourceText, textVersion.GetHashCode(), parsingOptions, projectOptions, DiagnosticsType.Syntax) |> liftAsync - else - return ImmutableArray.Empty - } - |> Async.map (Option.defaultValue ImmutableArray.Empty) - |> RoslynHelpers.StartAsyncAsTask cancellationToken - - interface IBuiltInAnalyzer with - member __.GetAnalyzerCategory() : DiagnosticAnalyzerCategory = DiagnosticAnalyzerCategory.SemanticDocumentAnalysis - member __.OpenFileOnly _ = true - + } + |> Async.map (Option.defaultValue ImmutableArray.Empty) + |> RoslynHelpers.StartAsyncAsTask cancellationToken + + member this.AnalyzeSemanticsAsync(document: Document, cancellationToken: CancellationToken): Task> = + let projectInfoManager = getProjectInfoManager document + asyncMaybe { + let! parsingOptions, _, projectOptions = projectInfoManager.TryGetOptionsForDocumentOrProject(document, cancellationToken) + let! sourceText = document.GetTextAsync(cancellationToken) + let! textVersion = document.GetTextVersionAsync(cancellationToken) + if document.Project.Name <> FSharpConstants.FSharpMiscellaneousFilesName || isScriptFile document.FilePath then + return! + FSharpDocumentDiagnosticAnalyzer.GetDiagnostics(getChecker document, document.FilePath, sourceText, textVersion.GetHashCode(), parsingOptions, projectOptions, DiagnosticsType.Semantic) + |> liftAsync + else + return ImmutableArray.Empty + } + |> Async.map (Option.defaultValue ImmutableArray.Empty) + |> RoslynHelpers.StartAsyncAsTask cancellationToken diff --git a/vsintegration/src/FSharp.Editor/Diagnostics/ProjectDiagnosticAnalyzer.fs b/vsintegration/src/FSharp.Editor/Diagnostics/ProjectDiagnosticAnalyzer.fs index 9b67e11819f..544039aa36a 100644 --- a/vsintegration/src/FSharp.Editor/Diagnostics/ProjectDiagnosticAnalyzer.fs +++ b/vsintegration/src/FSharp.Editor/Diagnostics/ProjectDiagnosticAnalyzer.fs @@ -14,20 +14,20 @@ open Microsoft.CodeAnalysis.Diagnostics open Microsoft.CodeAnalysis.Host.Mef open Microsoft.CodeAnalysis.Text open Microsoft.CodeAnalysis.SolutionCrawler +open Microsoft.CodeAnalysis.ExternalAccess.FSharp.Diagnostics open FSharp.Compiler open FSharp.Compiler.SourceCodeServices open FSharp.Compiler.Range -#if PROJECT_ANALYSIS // Project-wide error analysis. We don't enable this because ParseAndCheckProject checks projects against the versions of the files // saves to the file system. This is different to the versions of the files active in the editor. This results in out-of-sync error // messages while files are being edited -[] -type internal FSharpProjectDiagnosticAnalyzer() = - inherit ProjectDiagnosticAnalyzer() +[)>] +type internal FSharpProjectDiagnosticAnalyzer [] () = +#if PROJECT_ANALYSIS static member GetDiagnostics(options: FSharpProjectOptions) = async { let! checkProjectResults = FSharpLanguageService.Checker.ParseAndCheckProject(options) let results = @@ -42,13 +42,17 @@ type internal FSharpProjectDiagnosticAnalyzer() = |> Seq.toImmutableArray return results } - - override this.SupportedDiagnostics = CommonRoslynHelpers.SupportedDiagnostics() - - override this.AnalyzeProjectAsync(project: Project, cancellationToken: CancellationToken): Task> = - async { - match FSharpLanguageService.GetOptionsForProject(project.Id) with - | Some options -> return! FSharpProjectDiagnosticAnalyzer.GetDiagnostics(options) - | None -> return ImmutableArray.Empty - } |> CommonRoslynHelpers.StartAsyncAsTask cancellationToken +#endif + + interface IFSharpProjectDiagnosticAnalyzer with + + member this.AnalyzeProjectAsync(_project: Project, _cancellationToken: CancellationToken): Task> = +#if PROJECT_ANALYSIS + async { + match FSharpLanguageService.GetOptionsForProject(project.Id) with + | Some options -> return! FSharpProjectDiagnosticAnalyzer.GetDiagnostics(options) + | None -> return ImmutableArray.Empty + } |> CommonRoslynHelpers.StartAsyncAsTask cancellationToken +#else + Task.FromResult(ImmutableArray.Empty) #endif diff --git a/vsintegration/src/FSharp.Editor/Diagnostics/SimplifyNameDiagnosticAnalyzer.fs b/vsintegration/src/FSharp.Editor/Diagnostics/SimplifyNameDiagnosticAnalyzer.fs index 97235c0f1e0..f90717522a5 100644 --- a/vsintegration/src/FSharp.Editor/Diagnostics/SimplifyNameDiagnosticAnalyzer.fs +++ b/vsintegration/src/FSharp.Editor/Diagnostics/SimplifyNameDiagnosticAnalyzer.fs @@ -3,6 +3,7 @@ namespace rec Microsoft.VisualStudio.FSharp.Editor open System +open System.Composition open System.Collections.Immutable open System.Diagnostics open System.Threading @@ -13,15 +14,15 @@ open Microsoft.CodeAnalysis.Diagnostics open FSharp.Compiler open FSharp.Compiler.Range open System.Runtime.Caching +open Microsoft.CodeAnalysis.Host.Mef open Microsoft.CodeAnalysis.ExternalAccess.FSharp.Diagnostics type private TextVersionHash = int type private PerDocumentSavedData = { Hash: int; Diagnostics: ImmutableArray } -[] -type internal SimplifyNameDiagnosticAnalyzer() = - inherit DocumentDiagnosticAnalyzer() - +[)>] +type internal SimplifyNameDiagnosticAnalyzer [] () = + static let userOpName = "SimplifyNameDiagnosticAnalyzer" let getProjectInfoManager (document: Document) = document.Project.Solution.Workspace.Services.GetService().FSharpProjectOptionsManager let getChecker (document: Document) = document.Project.Solution.Workspace.Services.GetService().Checker @@ -30,105 +31,90 @@ type internal SimplifyNameDiagnosticAnalyzer() = // Make sure only one document is being analyzed at a time, to be nice static let guard = new SemaphoreSlim(1) - static let Descriptor = - DiagnosticDescriptor( - id = IDEDiagnosticIds.SimplifyNamesDiagnosticId, - title = SR.SimplifyName(), - messageFormat = SR.NameCanBeSimplified(), - category = DiagnosticCategory.Style, - defaultSeverity = DiagnosticSeverity.Hidden, - isEnabledByDefault = true, - customTags = FSharpDiagnosticCustomTags.Unnecessary) - static member LongIdentPropertyKey = "FullName" - override __.Priority = 100 // Default = 50 - override __.SupportedDiagnostics = ImmutableArray.Create Descriptor - override this.AnalyzeSyntaxAsync(_, _) = Task.FromResult ImmutableArray.Empty - override this.AnalyzeSemanticsAsync(document: Document, cancellationToken: CancellationToken) = - asyncMaybe { - do! Option.guard document.FSharpOptions.CodeFixes.SimplifyName - do Trace.TraceInformation("{0:n3} (start) SimplifyName", DateTime.Now.TimeOfDay.TotalSeconds) - do! Async.Sleep DefaultTuning.SimplifyNameInitialDelay |> liftAsync - let! _parsingOptions, projectOptions = getProjectInfoManager(document).TryGetOptionsForEditingDocumentOrProject(document, cancellationToken) - let! textVersion = document.GetTextVersionAsync(cancellationToken) - let textVersionHash = textVersion.GetHashCode() - let! _ = guard.WaitAsync(cancellationToken) |> Async.AwaitTask |> liftAsync - try - let key = document.Id.ToString() - match cache.Get(key) with - | :? PerDocumentSavedData as data when data.Hash = textVersionHash -> return data.Diagnostics - | _ -> - let! sourceText = document.GetTextAsync() - let checker = getChecker document - let! _, _, checkResults = checker.ParseAndCheckDocument(document, projectOptions, sourceText = sourceText, userOpName=userOpName) - let! symbolUses = checkResults.GetAllUsesOfAllSymbolsInFile() |> liftAsync - let mutable result = ResizeArray() - let symbolUses = - symbolUses - |> Array.filter (fun symbolUse -> not symbolUse.IsFromOpenStatement) - |> Array.Parallel.map (fun symbolUse -> - let lineStr = sourceText.Lines.[Line.toZ symbolUse.RangeAlternate.StartLine].ToString() - // for `System.DateTime.Now` it returns ([|"System"; "DateTime"|], "Now") - let partialName = QuickParse.GetPartialLongNameEx(lineStr, symbolUse.RangeAlternate.EndColumn - 1) - // `symbolUse.RangeAlternate.Start` does not point to the start of plid, it points to start of `name`, - // so we have to calculate plid's start ourselves. - let plidStartCol = symbolUse.RangeAlternate.EndColumn - partialName.PartialIdent.Length - (getPlidLength partialName.QualifyingIdents) - symbolUse, partialName.QualifyingIdents, plidStartCol, partialName.PartialIdent) - |> Array.filter (fun (_, plid, _, name) -> name <> "" && not (List.isEmpty plid)) - |> Array.groupBy (fun (symbolUse, _, plidStartCol, _) -> symbolUse.RangeAlternate.StartLine, plidStartCol) - |> Array.map (fun (_, xs) -> xs |> Array.maxBy (fun (symbolUse, _, _, _) -> symbolUse.RangeAlternate.EndColumn)) + interface IFSharpSimplifyNameDiagnosticAnalyzer with + + member this.AnalyzeSemanticsAsync(descriptor, document: Document, cancellationToken: CancellationToken) = + asyncMaybe { + do! Option.guard document.FSharpOptions.CodeFixes.SimplifyName + do Trace.TraceInformation("{0:n3} (start) SimplifyName", DateTime.Now.TimeOfDay.TotalSeconds) + do! Async.Sleep DefaultTuning.SimplifyNameInitialDelay |> liftAsync + let! _parsingOptions, projectOptions = getProjectInfoManager(document).TryGetOptionsForEditingDocumentOrProject(document, cancellationToken) + let! textVersion = document.GetTextVersionAsync(cancellationToken) + let textVersionHash = textVersion.GetHashCode() + let! _ = guard.WaitAsync(cancellationToken) |> Async.AwaitTask |> liftAsync + try + let key = document.Id.ToString() + match cache.Get(key) with + | :? PerDocumentSavedData as data when data.Hash = textVersionHash -> return data.Diagnostics + | _ -> + let! sourceText = document.GetTextAsync() + let checker = getChecker document + let! _, _, checkResults = checker.ParseAndCheckDocument(document, projectOptions, sourceText = sourceText, userOpName=userOpName) + let! symbolUses = checkResults.GetAllUsesOfAllSymbolsInFile() |> liftAsync + let mutable result = ResizeArray() + let symbolUses = + symbolUses + |> Array.filter (fun symbolUse -> not symbolUse.IsFromOpenStatement) + |> Array.Parallel.map (fun symbolUse -> + let lineStr = sourceText.Lines.[Line.toZ symbolUse.RangeAlternate.StartLine].ToString() + // for `System.DateTime.Now` it returns ([|"System"; "DateTime"|], "Now") + let partialName = QuickParse.GetPartialLongNameEx(lineStr, symbolUse.RangeAlternate.EndColumn - 1) + // `symbolUse.RangeAlternate.Start` does not point to the start of plid, it points to start of `name`, + // so we have to calculate plid's start ourselves. + let plidStartCol = symbolUse.RangeAlternate.EndColumn - partialName.PartialIdent.Length - (getPlidLength partialName.QualifyingIdents) + symbolUse, partialName.QualifyingIdents, plidStartCol, partialName.PartialIdent) + |> Array.filter (fun (_, plid, _, name) -> name <> "" && not (List.isEmpty plid)) + |> Array.groupBy (fun (symbolUse, _, plidStartCol, _) -> symbolUse.RangeAlternate.StartLine, plidStartCol) + |> Array.map (fun (_, xs) -> xs |> Array.maxBy (fun (symbolUse, _, _, _) -> symbolUse.RangeAlternate.EndColumn)) - for symbolUse, plid, plidStartCol, name in symbolUses do - if not symbolUse.IsFromDefinition then - let posAtStartOfName = - let r = symbolUse.RangeAlternate - if r.StartLine = r.EndLine then Range.mkPos r.StartLine (r.EndColumn - name.Length) - else r.Start + for symbolUse, plid, plidStartCol, name in symbolUses do + if not symbolUse.IsFromDefinition then + let posAtStartOfName = + let r = symbolUse.RangeAlternate + if r.StartLine = r.EndLine then Range.mkPos r.StartLine (r.EndColumn - name.Length) + else r.Start - let getNecessaryPlid (plid: string list) : Async = - let rec loop (rest: string list) (current: string list) = - async { - match rest with - | [] -> return current - | headIdent :: restPlid -> - let! res = checkResults.IsRelativeNameResolvableFromSymbol(posAtStartOfName, current, symbolUse.Symbol, userOpName=userOpName) - if res then return current - else return! loop restPlid (headIdent :: current) - } - loop (List.rev plid) [] + let getNecessaryPlid (plid: string list) : Async = + let rec loop (rest: string list) (current: string list) = + async { + match rest with + | [] -> return current + | headIdent :: restPlid -> + let! res = checkResults.IsRelativeNameResolvableFromSymbol(posAtStartOfName, current, symbolUse.Symbol, userOpName=userOpName) + if res then return current + else return! loop restPlid (headIdent :: current) + } + loop (List.rev plid) [] - do! Async.Sleep DefaultTuning.SimplifyNameEachItemDelay |> liftAsync // be less intrusive, give other work priority most of the time - let! necessaryPlid = getNecessaryPlid plid |> liftAsync + do! Async.Sleep DefaultTuning.SimplifyNameEachItemDelay |> liftAsync // be less intrusive, give other work priority most of the time + let! necessaryPlid = getNecessaryPlid plid |> liftAsync - match necessaryPlid with - | necessaryPlid when necessaryPlid = plid -> () - | necessaryPlid -> - let r = symbolUse.RangeAlternate - let necessaryPlidStartCol = r.EndColumn - name.Length - (getPlidLength necessaryPlid) + match necessaryPlid with + | necessaryPlid when necessaryPlid = plid -> () + | necessaryPlid -> + let r = symbolUse.RangeAlternate + let necessaryPlidStartCol = r.EndColumn - name.Length - (getPlidLength necessaryPlid) - let unnecessaryRange = - Range.mkRange r.FileName (Range.mkPos r.StartLine plidStartCol) (Range.mkPos r.EndLine necessaryPlidStartCol) + let unnecessaryRange = + Range.mkRange r.FileName (Range.mkPos r.StartLine plidStartCol) (Range.mkPos r.EndLine necessaryPlidStartCol) - let relativeName = (String.concat "." plid) + "." + name - result.Add( - Diagnostic.Create( - Descriptor, - RoslynHelpers.RangeToLocation(unnecessaryRange, sourceText, document.FilePath), - properties = (dict [SimplifyNameDiagnosticAnalyzer.LongIdentPropertyKey, relativeName]).ToImmutableDictionary())) + let relativeName = (String.concat "." plid) + "." + name + result.Add( + Diagnostic.Create( + descriptor, + RoslynHelpers.RangeToLocation(unnecessaryRange, sourceText, document.FilePath), + properties = (dict [SimplifyNameDiagnosticAnalyzer.LongIdentPropertyKey, relativeName]).ToImmutableDictionary())) - let diagnostics = result.ToImmutableArray() - cache.Remove(key) |> ignore - let data = { Hash = textVersionHash; Diagnostics=diagnostics } - let cacheItem = CacheItem(key, data) - let policy = CacheItemPolicy(SlidingExpiration=DefaultTuning.PerDocumentSavedDataSlidingWindow) - cache.Set(cacheItem, policy) - return diagnostics - finally guard.Release() |> ignore - } - |> Async.map (Option.defaultValue ImmutableArray.Empty) - |> RoslynHelpers.StartAsyncAsTask cancellationToken - - interface IBuiltInAnalyzer with - member __.OpenFileOnly _ = true - member __.GetAnalyzerCategory() = DiagnosticAnalyzerCategory.SemanticDocumentAnalysis \ No newline at end of file + let diagnostics = result.ToImmutableArray() + cache.Remove(key) |> ignore + let data = { Hash = textVersionHash; Diagnostics=diagnostics } + let cacheItem = CacheItem(key, data) + let policy = CacheItemPolicy(SlidingExpiration=DefaultTuning.PerDocumentSavedDataSlidingWindow) + cache.Set(cacheItem, policy) + return diagnostics + finally guard.Release() |> ignore + } + |> Async.map (Option.defaultValue ImmutableArray.Empty) + |> RoslynHelpers.StartAsyncAsTask cancellationToken diff --git a/vsintegration/src/FSharp.Editor/Diagnostics/UnusedDeclarationsAnalyzer.fs b/vsintegration/src/FSharp.Editor/Diagnostics/UnusedDeclarationsAnalyzer.fs index 58b1b139ff0..ff7c43839d0 100644 --- a/vsintegration/src/FSharp.Editor/Diagnostics/UnusedDeclarationsAnalyzer.fs +++ b/vsintegration/src/FSharp.Editor/Diagnostics/UnusedDeclarationsAnalyzer.fs @@ -3,6 +3,7 @@ namespace rec Microsoft.VisualStudio.FSharp.Editor open System +open System.Composition open System.Collections.Generic open System.Collections.Immutable open System.Diagnostics @@ -10,27 +11,16 @@ open System.Threading.Tasks open Microsoft.CodeAnalysis open Microsoft.CodeAnalysis.Diagnostics +open Microsoft.CodeAnalysis.Host.Mef open FSharp.Compiler.SourceCodeServices open Microsoft.CodeAnalysis.ExternalAccess.FSharp.Diagnostics -[] -type internal UnusedDeclarationsAnalyzer() = - inherit DocumentDiagnosticAnalyzer() +[)>] +type internal UnusedDeclarationsAnalyzer [] () = static let userOpName = "UnusedDeclarationsAnalyzer" let getProjectInfoManager (document: Document) = document.Project.Solution.Workspace.Services.GetService().FSharpProjectOptionsManager let getChecker (document: Document) = document.Project.Solution.Workspace.Services.GetService().Checker - let [] DescriptorId = "FS1182" - - let Descriptor = - DiagnosticDescriptor( - id = DescriptorId, - title = SR.TheValueIsUnused(), - messageFormat = SR.TheValueIsUnused(), - category = DiagnosticCategory.Style, - defaultSeverity = DiagnosticSeverity.Hidden, - isEnabledByDefault = true, - customTags = FSharpDiagnosticCustomTags.Unnecessary) let isPotentiallyUnusedDeclaration (symbol: FSharpSymbol) : bool = match symbol with @@ -95,33 +85,25 @@ type internal UnusedDeclarationsAnalyzer() = //#endif unusedRanges - override __.Priority = 80 // Default = 50 - - override __.SupportedDiagnostics = ImmutableArray.Create Descriptor - - override __.AnalyzeSyntaxAsync(_, _) = Task.FromResult ImmutableArray.Empty - - override __.AnalyzeSemanticsAsync(document, cancellationToken) = - asyncMaybe { - do! Option.guard document.FSharpOptions.CodeFixes.UnusedDeclarations + interface IFSharpUnusedDeclarationsDiagnosticAnalyzer with - do Trace.TraceInformation("{0:n3} (start) UnusedDeclarationsAnalyzer", DateTime.Now.TimeOfDay.TotalSeconds) - do! Async.Sleep DefaultTuning.UnusedDeclarationsAnalyzerInitialDelay |> liftAsync // be less intrusive, give other work priority most of the time - match! getProjectInfoManager(document).TryGetOptionsForEditingDocumentOrProject(document, cancellationToken) with - | (_parsingOptions, projectOptions) -> - let! sourceText = document.GetTextAsync() - let checker = getChecker document - let! _, _, checkResults = checker.ParseAndCheckDocument(document, projectOptions, sourceText = sourceText, userOpName = userOpName) - let! allSymbolUsesInFile = checkResults.GetAllUsesOfAllSymbolsInFile() |> liftAsync - let unusedRanges = getUnusedDeclarationRanges allSymbolUsesInFile (isScriptFile document.FilePath) - return - unusedRanges - |> Seq.map (fun m -> Diagnostic.Create(Descriptor, RoslynHelpers.RangeToLocation(m, sourceText, document.FilePath))) - |> Seq.toImmutableArray - } - |> Async.map (Option.defaultValue ImmutableArray.Empty) - |> RoslynHelpers.StartAsyncAsTask cancellationToken + member __.AnalyzeSemanticsAsync(descriptor, document, cancellationToken) = + asyncMaybe { + do! Option.guard document.FSharpOptions.CodeFixes.UnusedDeclarations - interface IBuiltInAnalyzer with - member __.OpenFileOnly _ = true - member __.GetAnalyzerCategory() = DiagnosticAnalyzerCategory.SemanticDocumentAnalysis \ No newline at end of file + do Trace.TraceInformation("{0:n3} (start) UnusedDeclarationsAnalyzer", DateTime.Now.TimeOfDay.TotalSeconds) + do! Async.Sleep DefaultTuning.UnusedDeclarationsAnalyzerInitialDelay |> liftAsync // be less intrusive, give other work priority most of the time + match! getProjectInfoManager(document).TryGetOptionsForEditingDocumentOrProject(document, cancellationToken) with + | (_parsingOptions, projectOptions) -> + let! sourceText = document.GetTextAsync() + let checker = getChecker document + let! _, _, checkResults = checker.ParseAndCheckDocument(document, projectOptions, sourceText = sourceText, userOpName = userOpName) + let! allSymbolUsesInFile = checkResults.GetAllUsesOfAllSymbolsInFile() |> liftAsync + let unusedRanges = getUnusedDeclarationRanges allSymbolUsesInFile (isScriptFile document.FilePath) + return + unusedRanges + |> Seq.map (fun m -> Diagnostic.Create(descriptor, RoslynHelpers.RangeToLocation(m, sourceText, document.FilePath))) + |> Seq.toImmutableArray + } + |> Async.map (Option.defaultValue ImmutableArray.Empty) + |> RoslynHelpers.StartAsyncAsTask cancellationToken diff --git a/vsintegration/src/FSharp.Editor/Diagnostics/UnusedOpensDiagnosticAnalyzer.fs b/vsintegration/src/FSharp.Editor/Diagnostics/UnusedOpensDiagnosticAnalyzer.fs index b94f0ca09a9..c79027b0dff 100644 --- a/vsintegration/src/FSharp.Editor/Diagnostics/UnusedOpensDiagnosticAnalyzer.fs +++ b/vsintegration/src/FSharp.Editor/Diagnostics/UnusedOpensDiagnosticAnalyzer.fs @@ -3,6 +3,7 @@ namespace Microsoft.VisualStudio.FSharp.Editor open System +open System.Composition open System.Collections.Immutable open System.Diagnostics open System.Threading @@ -16,29 +17,16 @@ open FSharp.Compiler.Ast open FSharp.Compiler.Range open FSharp.Compiler.SourceCodeServices open Microsoft.VisualStudio.FSharp.Editor.Symbols +open Microsoft.CodeAnalysis.Host.Mef open Microsoft.CodeAnalysis.ExternalAccess.FSharp.Diagnostics -[] -type internal UnusedOpensDiagnosticAnalyzer() = - inherit DocumentDiagnosticAnalyzer() - +[)>] +type internal UnusedOpensDiagnosticAnalyzer [] () = + let getProjectInfoManager (document: Document) = document.Project.Solution.Workspace.Services.GetService().FSharpProjectOptionsManager let getChecker (document: Document) = document.Project.Solution.Workspace.Services.GetService().Checker static let userOpName = "UnusedOpensAnalyzer" - static let Descriptor = - DiagnosticDescriptor( - id = IDEDiagnosticIds.RemoveUnnecessaryImportsDiagnosticId, - title = SR.RemoveUnusedOpens(), - messageFormat = SR.UnusedOpens(), - category = DiagnosticCategory.Style, - defaultSeverity = DiagnosticSeverity.Hidden, - isEnabledByDefault = true, - customTags = FSharpDiagnosticCustomTags.Unnecessary) - - override __.Priority = 90 // Default = 50 - override __.SupportedDiagnostics = ImmutableArray.Create Descriptor - override this.AnalyzeSyntaxAsync(_, _) = Task.FromResult ImmutableArray.Empty static member GetUnusedOpenRanges(document: Document, options, checker: FSharpChecker) : Async> = asyncMaybe { @@ -55,26 +43,24 @@ type internal UnusedOpensDiagnosticAnalyzer() = return unusedOpens } - override this.AnalyzeSemanticsAsync(document: Document, cancellationToken: CancellationToken) = - asyncMaybe { - do Trace.TraceInformation("{0:n3} (start) UnusedOpensAnalyzer", DateTime.Now.TimeOfDay.TotalSeconds) - do! Async.Sleep DefaultTuning.UnusedOpensAnalyzerInitialDelay |> liftAsync // be less intrusive, give other work priority most of the time - let! _parsingOptions, projectOptions = getProjectInfoManager(document).TryGetOptionsForEditingDocumentOrProject(document, cancellationToken) - let! sourceText = document.GetTextAsync() - let checker = getChecker document - let! unusedOpens = UnusedOpensDiagnosticAnalyzer.GetUnusedOpenRanges(document, projectOptions, checker) - - return - unusedOpens - |> List.map (fun range -> - Diagnostic.Create( - Descriptor, - RoslynHelpers.RangeToLocation(range, sourceText, document.FilePath))) - |> Seq.toImmutableArray - } - |> Async.map (Option.defaultValue ImmutableArray.Empty) - |> RoslynHelpers.StartAsyncAsTask cancellationToken + interface IFSharpUnusedOpensDiagnosticAnalyzer with - interface IBuiltInAnalyzer with - member __.OpenFileOnly _ = true - member __.GetAnalyzerCategory() = DiagnosticAnalyzerCategory.SemanticDocumentAnalysis \ No newline at end of file + member this.AnalyzeSemanticsAsync(descriptor, document: Document, cancellationToken: CancellationToken) = + asyncMaybe { + do Trace.TraceInformation("{0:n3} (start) UnusedOpensAnalyzer", DateTime.Now.TimeOfDay.TotalSeconds) + do! Async.Sleep DefaultTuning.UnusedOpensAnalyzerInitialDelay |> liftAsync // be less intrusive, give other work priority most of the time + let! _parsingOptions, projectOptions = getProjectInfoManager(document).TryGetOptionsForEditingDocumentOrProject(document, cancellationToken) + let! sourceText = document.GetTextAsync() + let checker = getChecker document + let! unusedOpens = UnusedOpensDiagnosticAnalyzer.GetUnusedOpenRanges(document, projectOptions, checker) + + return + unusedOpens + |> List.map (fun range -> + Diagnostic.Create( + descriptor, + RoslynHelpers.RangeToLocation(range, sourceText, document.FilePath))) + |> Seq.toImmutableArray + } + |> Async.map (Option.defaultValue ImmutableArray.Empty) + |> RoslynHelpers.StartAsyncAsTask cancellationToken diff --git a/vsintegration/src/FSharp.Editor/DocumentHighlights/DocumentHighlightsService.fs b/vsintegration/src/FSharp.Editor/DocumentHighlights/DocumentHighlightsService.fs index 923b5372c67..10ee6533790 100644 --- a/vsintegration/src/FSharp.Editor/DocumentHighlights/DocumentHighlightsService.fs +++ b/vsintegration/src/FSharp.Editor/DocumentHighlights/DocumentHighlightsService.fs @@ -11,6 +11,7 @@ open Microsoft.CodeAnalysis open Microsoft.CodeAnalysis.DocumentHighlighting open Microsoft.CodeAnalysis.Host.Mef open Microsoft.CodeAnalysis.Text +open Microsoft.CodeAnalysis.ExternalAccess.FSharp.DocumentHighlighting open FSharp.Compiler.SourceCodeServices open FSharp.Compiler.Range @@ -20,8 +21,7 @@ type internal FSharpHighlightSpan = TextSpan: TextSpan } override this.ToString() = sprintf "%+A" this -[] -[, FSharpConstants.FSharpLanguageName)>] +[)>] type internal FSharpDocumentHighlightsService [] (checkerProvider: FSharpCheckerProvider, projectInfoManager: FSharpProjectOptionsManager) = static let userOpName = "DocumentHighlights" @@ -72,8 +72,8 @@ type internal FSharpDocumentHighlightsService [] (checkerP |> fixInvalidSymbolSpans sourceText symbol.Ident.idText } - interface IDocumentHighlightsService with - member __.GetDocumentHighlightsAsync(document, position, _documentsToSearch, cancellationToken) : Task> = + interface IFSharpDocumentHighlightsService with + member __.GetDocumentHighlightsAsync(document, position, _documentsToSearch, cancellationToken) : Task> = asyncMaybe { let! parsingOptions, projectOptions = projectInfoManager.TryGetOptionsForEditingDocumentOrProject(document, cancellationToken) let! sourceText = document.GetTextAsync(cancellationToken) @@ -85,11 +85,11 @@ type internal FSharpDocumentHighlightsService [] (checkerP let highlightSpans = spans |> Array.map (fun span -> - let kind = if span.IsDefinition then HighlightSpanKind.Definition else HighlightSpanKind.Reference - HighlightSpan(span.TextSpan, kind)) + let kind = if span.IsDefinition then FSharpHighlightSpanKind.Definition else FSharpHighlightSpanKind.Reference + FSharpHighlightSpan(span.TextSpan, kind)) |> Seq.toImmutableArray - return ImmutableArray.Create(DocumentHighlights(document, highlightSpans)) + return ImmutableArray.Create(FSharpDocumentHighlights(document, highlightSpans)) } - |> Async.map (Option.defaultValue ImmutableArray.Empty) + |> Async.map (Option.defaultValue ImmutableArray.Empty) |> RoslynHelpers.StartAsyncAsTask(cancellationToken) diff --git a/vsintegration/src/FSharp.Editor/FSharp.Editor.fsproj b/vsintegration/src/FSharp.Editor/FSharp.Editor.fsproj index 8b99167f24e..77add187654 100644 --- a/vsintegration/src/FSharp.Editor/FSharp.Editor.fsproj +++ b/vsintegration/src/FSharp.Editor/FSharp.Editor.fsproj @@ -34,7 +34,6 @@ - Common\LspExternalAccess.fs @@ -94,7 +93,6 @@ - @@ -173,6 +171,7 @@ + diff --git a/vsintegration/src/FSharp.Editor/InlineRename/InlineRenameService.fs b/vsintegration/src/FSharp.Editor/InlineRename/InlineRenameService.fs index 82cccffbf1a..8791c558896 100644 --- a/vsintegration/src/FSharp.Editor/InlineRename/InlineRenameService.fs +++ b/vsintegration/src/FSharp.Editor/InlineRename/InlineRenameService.fs @@ -12,6 +12,8 @@ open Microsoft.CodeAnalysis open Microsoft.CodeAnalysis.Editor open Microsoft.CodeAnalysis.Host.Mef open Microsoft.CodeAnalysis.Text +open Microsoft.CodeAnalysis.ExternalAccess.FSharp +open Microsoft.CodeAnalysis.ExternalAccess.FSharp.Editor open FSharp.Compiler open FSharp.Compiler.Range @@ -19,9 +21,9 @@ open FSharp.Compiler.SourceCodeServices open Symbols type internal FailureInlineRenameInfo private () = - interface IInlineRenameInfo with + interface IFSharpInlineRenameInfo with member __.CanRename = false - member __.LocalizedErrorMessage = EditorFeaturesResources.You_cannot_rename_this_element + member __.LocalizedErrorMessage = FSharpEditorFeaturesResources.You_cannot_rename_this_element member __.TriggerSpan = Unchecked.defaultof<_> member __.HasOverloads = false member __.ForceRenameOverloads = true @@ -31,17 +33,17 @@ type internal FailureInlineRenameInfo private () = member __.GetFinalSymbolName _ = "" member __.GetReferenceEditSpan(_, _) = Unchecked.defaultof<_> member __.GetConflictEditSpan(_, _, _) = Nullable() - member __.FindRenameLocationsAsync(_, _) = Task.FromResult null + member __.FindRenameLocationsAsync(_, _) = Task.FromResult null member __.TryOnBeforeGlobalSymbolRenamed(_, _, _) = false member __.TryOnAfterGlobalSymbolRenamed(_, _, _) = false - static member Instance = FailureInlineRenameInfo() :> IInlineRenameInfo + static member Instance = FailureInlineRenameInfo() :> IFSharpInlineRenameInfo -type internal InlineRenameLocationSet(locations: InlineRenameLocation [], originalSolution: Solution, symbolKind: LexerSymbolKind, symbol: FSharpSymbol) = - interface IInlineRenameLocationSet with +type internal InlineRenameLocationSet(locations: FSharpInlineRenameLocation [], originalSolution: Solution, symbolKind: LexerSymbolKind, symbol: FSharpSymbol) = + interface IFSharpInlineRenameLocationSet with member __.Locations = upcast locations.ToList() - member __.GetReplacementsAsync(replacementText, _optionSet, cancellationToken) : Task = - let rec applyChanges (solution: Solution) (locationsByDocument: (Document * InlineRenameLocation list) list) = + member __.GetReplacementsAsync(replacementText, _optionSet, cancellationToken) : Task = + let rec applyChanges (solution: Solution) (locationsByDocument: (Document * FSharpInlineRenameLocation list) list) = async { match locationsByDocument with | [] -> return solution @@ -59,7 +61,7 @@ type internal InlineRenameLocationSet(locations: InlineRenameLocation [], origin | LexerSymbolKind.StaticallyResolvedTypeParameter -> replacementText | _ -> Keywords.NormalizeIdentifierBackticks replacementText return - { new IInlineRenameReplacementInfo with + { new IFSharpInlineRenameReplacementInfo with member __.NewSolution = newSolution member __.ReplacementTextValid = Tokenizer.isValidNameForSymbol(symbolKind, symbol, replacementText) member __.DocumentIds = locations |> Seq.map (fun doc -> doc.Document.Id) |> Seq.distinct @@ -90,7 +92,7 @@ type internal InlineRenameInfo SymbolHelpers.getSymbolUsesInSolution(symbolUse.Symbol, declLoc, checkFileResults, projectInfoManager, checker, document.Project.Solution, userOpName) |> Async.cache - interface IInlineRenameInfo with + interface IFSharpInlineRenameInfo with member __.CanRename = true member __.LocalizedErrorMessage = null member __.TriggerSpan = triggerSpan @@ -126,19 +128,19 @@ type internal InlineRenameInfo match RoslynHelpers.TryFSharpRangeToTextSpan(sourceText, symbolUse.RangeAlternate) with | Some span -> let textSpan = Tokenizer.fixupSpan(sourceText, span) - yield InlineRenameLocation(document, textSpan) + yield FSharpInlineRenameLocation(document, textSpan) | None -> () |] }) |> Async.Parallel |> Async.map Array.concat - return InlineRenameLocationSet(locations, document.Project.Solution, lexerSymbol.Kind, symbolUse.Symbol) :> IInlineRenameLocationSet + return InlineRenameLocationSet(locations, document.Project.Solution, lexerSymbol.Kind, symbolUse.Symbol) :> IFSharpInlineRenameLocationSet } |> RoslynHelpers.StartAsyncAsTask(cancellationToken) member __.TryOnBeforeGlobalSymbolRenamed(_workspace, _changedDocumentIDs, _replacementText) = true member __.TryOnAfterGlobalSymbolRenamed(_workspace, _changedDocumentIDs, _replacementText) = true -[, FSharpConstants.FSharpLanguageName); Shared>] +[); Shared>] type internal InlineRenameService [] ( @@ -148,7 +150,7 @@ type internal InlineRenameService static let userOpName = "InlineRename" static member GetInlineRenameInfo(checker: FSharpChecker, projectInfoManager: FSharpProjectOptionsManager, document: Document, sourceText: SourceText, position: int, - defines: string list, options: FSharpProjectOptions) : Async = + defines: string list, options: FSharpProjectOptions) : Async = asyncMaybe { let textLine = sourceText.Lines.GetLineFromPosition(position) let textLinePos = sourceText.Lines.GetLinePosition(position) @@ -161,11 +163,11 @@ type internal InlineRenameService let! span = RoslynHelpers.TryFSharpRangeToTextSpan(sourceText, symbolUse.RangeAlternate) let triggerSpan = Tokenizer.fixupSpan(sourceText, span) - return InlineRenameInfo(checker, projectInfoManager, document, triggerSpan, symbol, symbolUse, declLoc, checkFileResults) :> IInlineRenameInfo + return InlineRenameInfo(checker, projectInfoManager, document, triggerSpan, symbol, symbolUse, declLoc, checkFileResults) :> IFSharpInlineRenameInfo } - interface IEditorInlineRenameService with - member __.GetRenameInfoAsync(document: Document, position: int, cancellationToken: CancellationToken) : Task = + interface IFSharpEditorInlineRenameService with + member __.GetRenameInfoAsync(document: Document, position: int, cancellationToken: CancellationToken) : Task = asyncMaybe { let! parsingOptions, projectOptions = projectInfoManager.TryGetOptionsForEditingDocumentOrProject(document, cancellationToken) let! sourceText = document.GetTextAsync(cancellationToken) diff --git a/vsintegration/src/FSharp.Editor/LanguageService/LanguageService.fs b/vsintegration/src/FSharp.Editor/LanguageService/LanguageService.fs index a3b7b6f7586..f02f4e344b4 100644 --- a/vsintegration/src/FSharp.Editor/LanguageService/LanguageService.fs +++ b/vsintegration/src/FSharp.Editor/LanguageService/LanguageService.fs @@ -221,7 +221,7 @@ type internal FSharpLanguageService(package : FSharpPackage) = base.Initialize() this.Workspace.Options <- this.Workspace.Options.WithChangedOption(Completion.FSharpCompletionOptions.BlockForCompletionItems, FSharpConstants.FSharpLanguageName, false) - this.Workspace.Options <- this.Workspace.Options.WithChangedOption(Shared.Options.ServiceFeatureOnOffOptions.ClosedFileDiagnostic, FSharpConstants.FSharpLanguageName, Nullable false) + this.Workspace.Options <- this.Workspace.Options.WithChangedOption(Shared.Options.FSharpServiceFeatureOnOffOptions.ClosedFileDiagnostic, FSharpConstants.FSharpLanguageName, Nullable false) let theme = package.ComponentModel.DefaultExportProvider.GetExport().Value theme.SetColors() diff --git a/vsintegration/src/FSharp.Editor/Navigation/FindUsagesService.fs b/vsintegration/src/FSharp.Editor/Navigation/FindUsagesService.fs index 2286cd06445..f33d23b3291 100644 --- a/vsintegration/src/FSharp.Editor/Navigation/FindUsagesService.fs +++ b/vsintegration/src/FSharp.Editor/Navigation/FindUsagesService.fs @@ -59,7 +59,7 @@ type internal FSharpFindUsagesService let! symbol = Tokenizer.getSymbolAtPosition(document.Id, sourceText, position, document.FilePath, defines, SymbolLookupKind.Greedy, false) let! symbolUse = checkFileResults.GetSymbolUseAtLocation(lineNumber, symbol.Ident.idRange.EndColumn, textLine, symbol.FullIsland, userOpName=userOpName) let! declaration = checkFileResults.GetDeclarationLocation (lineNumber, symbol.Ident.idRange.EndColumn, textLine, symbol.FullIsland, false, userOpName=userOpName) |> liftAsync - let tags = GlyphTags.GetTags(Microsoft.CodeAnalysis.ExternalAccess.FSharp.FSharpGlyphHelpersObsolete.Convert(Tokenizer.GetGlyphForSymbol (symbolUse.Symbol, symbol.Kind))) + let tags = FSharpGlyphTags.GetTags(Tokenizer.GetGlyphForSymbol (symbolUse.Symbol, symbol.Kind)) let declarationRange = match declaration with diff --git a/vsintegration/src/FSharp.Editor/Navigation/GoToDefinition.fs b/vsintegration/src/FSharp.Editor/Navigation/GoToDefinition.fs index 5ba172edc4b..a607442e462 100644 --- a/vsintegration/src/FSharp.Editor/Navigation/GoToDefinition.fs +++ b/vsintegration/src/FSharp.Editor/Navigation/GoToDefinition.fs @@ -14,6 +14,7 @@ open Microsoft.CodeAnalysis open Microsoft.CodeAnalysis.FindSymbols open Microsoft.CodeAnalysis.Text open Microsoft.CodeAnalysis.Navigation +open Microsoft.CodeAnalysis.ExternalAccess.FSharp.Navigation open Microsoft.VisualStudio.Shell.Interop @@ -105,16 +106,6 @@ module private ExternalSymbol = | _ -> [] -type internal FSharpNavigableItem(document: Document, textSpan: TextSpan) = - interface INavigableItem with - member __.Glyph = Glyph.BasicFile - member __.DisplayFileLocation = true - member __.IsImplicitlyDeclared = false - member __.Document = document - member __.SourceSpan = textSpan - member __.DisplayTaggedParts = ImmutableArray.Empty - member __.ChildItems = ImmutableArray.Empty - // TODO: Uncomment code when VS has a fix for updating the status bar. type internal StatusBar(statusBar: IVsStatusbar) = let mutable _searchIcon = int16 Microsoft.VisualStudio.Shell.Interop.Constants.SBAI_Find :> obj @@ -151,6 +142,9 @@ type internal StatusBar(statusBar: IVsStatusbar) = { new IDisposable with member __.Dispose() = () } //statusBar.Animation(0, &searchIcon) |> ignore } +type internal FSharpGoToDefinitionNavigableItem(document, sourceSpan) = + inherit FSharpNavigableItem(Glyph.BasicFile, ImmutableArray.Empty, document, sourceSpan) + type internal GoToDefinition(checker: FSharpChecker, projectInfoManager: FSharpProjectOptionsManager) = let userOpName = "GoToDefinition" @@ -167,7 +161,7 @@ type internal GoToDefinition(checker: FSharpChecker, projectInfoManager: FSharpP let! refSourceText = refDocument.GetTextAsync(cancellationToken) |> Async.AwaitTask match RoslynHelpers.TryFSharpRangeToTextSpan (refSourceText, range) with | None -> return None - | Some refTextSpan -> return Some (FSharpNavigableItem (refDocument, refTextSpan)) + | Some refTextSpan -> return Some (FSharpGoToDefinitionNavigableItem (refDocument, refTextSpan)) else return None } @@ -201,7 +195,7 @@ type internal GoToDefinition(checker: FSharpChecker, projectInfoManager: FSharpP let! symbolUses = checkFileResults.GetUsesOfSymbolInFile symbol |> liftAsync let! implSymbol = symbolUses |> Array.tryHead let! implTextSpan = RoslynHelpers.TryFSharpRangeToTextSpan (implSourceText, implSymbol.RangeAlternate) - return FSharpNavigableItem (implDoc, implTextSpan) + return FSharpGoToDefinitionNavigableItem (implDoc, implTextSpan) else let! targetDocument = originDocument.Project.Solution.TryGetDocumentFromFSharpRange fsSymbolUse.RangeAlternate return! rangeToNavigableItem (fsSymbolUse.RangeAlternate, targetDocument) @@ -262,7 +256,7 @@ type internal GoToDefinition(checker: FSharpChecker, projectInfoManager: FSharpP ) let! location = symbol.Locations |> Seq.tryHead - return (FSharpNavigableItem(project.GetDocument(location.SourceTree), location.SourceSpan), idRange) + return (FSharpGoToDefinitionNavigableItem(project.GetDocument(location.SourceTree), location.SourceSpan), idRange) | FSharpFindDeclResult.DeclFound targetRange -> // if goto definition is called at we are alread at the declaration location of a symbol in @@ -279,7 +273,7 @@ type internal GoToDefinition(checker: FSharpChecker, projectInfoManager: FSharpP let! targetRange = this.FindSymbolDeclarationInFile(targetSymbolUse, implFilePath, implSourceText, projectOptions, implVersion.GetHashCode()) let! implTextSpan = RoslynHelpers.TryFSharpRangeToTextSpan (implSourceText, targetRange) - let navItem = FSharpNavigableItem (implDocument, implTextSpan) + let navItem = FSharpGoToDefinitionNavigableItem (implDocument, implTextSpan) return (navItem, idRange) else // jump from implementation to the corresponding signature let! declarations = checkFileResults.GetDeclarationLocation (fcsTextLineNumber, lexerSymbol.Ident.idRange.EndColumn, textLine.ToString(), lexerSymbol.FullIsland, true, userOpName=userOpName) |> liftAsync @@ -288,7 +282,7 @@ type internal GoToDefinition(checker: FSharpChecker, projectInfoManager: FSharpP let! sigDocument = originDocument.Project.Solution.TryGetDocumentFromPath targetRange.FileName let! sigSourceText = sigDocument.GetTextAsync () |> liftTaskAsync let! sigTextSpan = RoslynHelpers.TryFSharpRangeToTextSpan (sigSourceText, targetRange) - let navItem = FSharpNavigableItem (sigDocument, sigTextSpan) + let navItem = FSharpGoToDefinitionNavigableItem (sigDocument, sigTextSpan) return (navItem, idRange) | _ -> return! None @@ -301,7 +295,7 @@ type internal GoToDefinition(checker: FSharpChecker, projectInfoManager: FSharpP let! sigTextSpan = RoslynHelpers.TryFSharpRangeToTextSpan (sigSourceText, targetRange) // if the gotodef call originated from a signature and the returned target is a signature, navigate there if isSignatureFile targetRange.FileName && preferSignature then - let navItem = FSharpNavigableItem (sigDocument, sigTextSpan) + let navItem = FSharpGoToDefinitionNavigableItem (sigDocument, sigTextSpan) return (navItem, idRange) else // we need to get an FSharpSymbol from the targetRange found in the signature // that symbol will be used to find the destination in the corresponding implementation file @@ -318,7 +312,7 @@ type internal GoToDefinition(checker: FSharpChecker, projectInfoManager: FSharpP let! targetRange = this.FindSymbolDeclarationInFile(targetSymbolUse, implFilePath, implSourceText, projectOptions, implVersion.GetHashCode()) let! implTextSpan = RoslynHelpers.TryFSharpRangeToTextSpan (implSourceText, targetRange) - let navItem = FSharpNavigableItem (implDocument, implTextSpan) + let navItem = FSharpGoToDefinitionNavigableItem (implDocument, implTextSpan) return (navItem, idRange) | _ -> return! None @@ -335,7 +329,7 @@ type internal GoToDefinition(checker: FSharpChecker, projectInfoManager: FSharpP member this.FindDefinitionsForPeekTask(originDocument: Document, position: int, cancellationToken: CancellationToken) = this.FindDefinitionAtPosition(originDocument, position) |> Async.map ( - Option.map (fun (navItem, _) -> (navItem :> INavigableItem)) + Option.map (fun (navItem, _) -> navItem :> FSharpNavigableItem) >> Option.toArray >> Array.toSeq) |> RoslynHelpers.StartAsyncAsTask cancellationToken @@ -344,31 +338,30 @@ type internal GoToDefinition(checker: FSharpChecker, projectInfoManager: FSharpP /// at the provided position in the document. member this.FindDefinitionTask(originDocument: Document, position: int, cancellationToken: CancellationToken) = this.FindDefinitionAtPosition(originDocument, position) - |> Async.map (Option.map (fun (navItem, range) -> (navItem :> INavigableItem, range))) |> RoslynHelpers.StartAsyncAsTask cancellationToken /// Navigate to the positon of the textSpan in the provided document /// used by quickinfo link navigation when the tooltip contains the correct destination range. member __.TryNavigateToTextSpan(document: Document, textSpan: TextSpan, statusBar: StatusBar) = - let navigableItem = FSharpNavigableItem(document, textSpan) :> INavigableItem + let navigableItem = FSharpGoToDefinitionNavigableItem(document, textSpan) let workspace = document.Project.Solution.Workspace - let navigationService = workspace.Services.GetService() - let options = workspace.Options.WithChangedOption(NavigationOptions.PreferProvisionalTab, true) + let navigationService = workspace.Services.GetService() + let options = workspace.Options.WithChangedOption(FSharpNavigationOptions.PreferProvisionalTab, true) let navigationSucceeded = navigationService.TryNavigateToSpan(workspace, navigableItem.Document.Id, navigableItem.SourceSpan, options) if not navigationSucceeded then statusBar.TempMessage (SR.CannotNavigateUnknown()) - member __.NavigateToItem(navigableItem: #INavigableItem, statusBar: StatusBar) = + member __.NavigateToItem(navigableItem: FSharpNavigableItem, statusBar: StatusBar) = use __ = statusBar.Animate() statusBar.Message (SR.NavigatingTo()) let workspace = navigableItem.Document.Project.Solution.Workspace - let navigationService = workspace.Services.GetService() + let navigationService = workspace.Services.GetService() // Prefer open documents in the preview tab. - let options = workspace.Options.WithChangedOption(NavigationOptions.PreferProvisionalTab, true) + let options = workspace.Options.WithChangedOption(FSharpNavigationOptions.PreferProvisionalTab, true) let result = navigationService.TryNavigateToSpan(workspace, navigableItem.Document.Id, navigableItem.SourceSpan, options) if result then diff --git a/vsintegration/src/FSharp.Editor/Navigation/GoToDefinitionService.fs b/vsintegration/src/FSharp.Editor/Navigation/GoToDefinitionService.fs index d2bcd9dd4f5..1a5b1e611ec 100644 --- a/vsintegration/src/FSharp.Editor/Navigation/GoToDefinitionService.fs +++ b/vsintegration/src/FSharp.Editor/Navigation/GoToDefinitionService.fs @@ -9,12 +9,13 @@ open System.Threading.Tasks open Microsoft.CodeAnalysis open Microsoft.CodeAnalysis.Editor open Microsoft.CodeAnalysis.Host.Mef +open Microsoft.CodeAnalysis.ExternalAccess.FSharp.Editor open Microsoft.VisualStudio.Shell open Microsoft.VisualStudio.Shell.Interop open System -[, FSharpConstants.FSharpLanguageName)>] +[)>] [)>] type internal FSharpGoToDefinitionService [] @@ -26,7 +27,7 @@ type internal FSharpGoToDefinitionService let gtd = GoToDefinition(checkerProvider.Checker, projectInfoManager) let statusBar = StatusBar(ServiceProvider.GlobalProvider.GetService()) - interface IGoToDefinitionService with + interface IFSharpGoToDefinitionService with /// Invoked with Peek Definition. member __.FindDefinitionsAsync (document: Document, position: int, cancellationToken: CancellationToken) = gtd.FindDefinitionsForPeekTask(document, position, cancellationToken) diff --git a/vsintegration/src/FSharp.Editor/Navigation/NavigableSymbolsService.fs b/vsintegration/src/FSharp.Editor/Navigation/NavigableSymbolsService.fs index e433733f4d0..a1022788ab6 100644 --- a/vsintegration/src/FSharp.Editor/Navigation/NavigableSymbolsService.fs +++ b/vsintegration/src/FSharp.Editor/Navigation/NavigableSymbolsService.fs @@ -9,6 +9,7 @@ open System.ComponentModel.Composition open Microsoft.CodeAnalysis.Text open Microsoft.CodeAnalysis.Navigation +open Microsoft.CodeAnalysis.ExternalAccess.FSharp.Navigation open Microsoft.VisualStudio.Language.Intellisense open Microsoft.VisualStudio.Text @@ -18,7 +19,7 @@ open Microsoft.VisualStudio.Utilities open Microsoft.VisualStudio.Shell [] -type internal FSharpNavigableSymbol(item: INavigableItem, span: SnapshotSpan, gtd: GoToDefinition, statusBar: StatusBar) = +type internal FSharpNavigableSymbol(item: FSharpNavigableItem, span: SnapshotSpan, gtd: GoToDefinition, statusBar: StatusBar) = interface INavigableSymbol with member __.Navigate(_: INavigableRelationship) = gtd.NavigateToItem(item, statusBar) diff --git a/vsintegration/src/FSharp.Editor/Navigation/NavigateToSearchService.fs b/vsintegration/src/FSharp.Editor/Navigation/NavigateToSearchService.fs index 25f33dbb75c..428ca48ef62 100644 --- a/vsintegration/src/FSharp.Editor/Navigation/NavigateToSearchService.fs +++ b/vsintegration/src/FSharp.Editor/Navigation/NavigateToSearchService.fs @@ -19,39 +19,21 @@ open Microsoft.CodeAnalysis.Text open Microsoft.CodeAnalysis.NavigateTo open Microsoft.CodeAnalysis.Navigation open Microsoft.CodeAnalysis.PatternMatching +open Microsoft.CodeAnalysis.ExternalAccess.FSharp.Navigation +open Microsoft.CodeAnalysis.ExternalAccess.FSharp.NavigateTo open FSharp.Compiler open FSharp.Compiler.SourceCodeServices type internal NavigableItem(document: Document, sourceSpan: TextSpan, glyph: Glyph, name: string, kind: string, additionalInfo: string) = - interface INavigableItem with - member __.Glyph = glyph - /// The tagged parts to display for this item. If default, the line of text from is used. - member __.DisplayTaggedParts = ImmutableArray.Create (TaggedText(TextTags.Text, name)) - /// Return true to display the file path of and the span of when displaying this item. - member __.DisplayFileLocation = true - /// This is intended for symbols that are ordinary symbols in the language sense, and may be used by code, but that are simply declared - /// implicitly rather than with explicit language syntax. For example, a default synthesized constructor in C# when the class contains no - /// explicit constructors. - member __.IsImplicitlyDeclared = false - member __.Document = document - member __.SourceSpan = sourceSpan - member __.ChildItems = ImmutableArray.Empty + inherit FSharpNavigableItem(glyph, ImmutableArray.Create (TaggedText(TextTags.Text, name)), document, sourceSpan) + member __.Name = name member __.Kind = kind member __.AdditionalInfo = additionalInfo -type internal NavigateToSearchResult(item: NavigableItem, matchKind: NavigateToMatchKind) = - interface INavigateToSearchResult with - member __.AdditionalInformation = item.AdditionalInfo - member __.Kind = item.Kind - member __.MatchKind = matchKind - member __.IsCaseSensitive = false - member __.Name = item.Name - member __.NameMatchSpans = ImmutableArray<_>.Empty - member __.SecondarySort = null - member __.Summary = null - member __.NavigableItem = upcast item +type internal NavigateToSearchResult(item: NavigableItem, matchKind: FSharpNavigateToMatchKind) = + inherit FSharpNavigateToSearchResult(item.AdditionalInfo, item.Kind, matchKind, item.Name, item) module private Index = [] @@ -73,18 +55,18 @@ module private Index = if res = 0 then a.Offset.CompareTo(b.Offset) else res } type IIndexedNavigableItems = - abstract Find: searchValue: string -> INavigateToSearchResult [] + abstract Find: searchValue: string -> FSharpNavigateToSearchResult [] abstract AllItems: NavigableItem [] let private navigateToSearchResultComparer = - { new IEqualityComparer with - member __.Equals(x: INavigateToSearchResult, y: INavigateToSearchResult) = + { new IEqualityComparer with + member __.Equals(x: FSharpNavigateToSearchResult, y: FSharpNavigateToSearchResult) = match x, y with | null, _ | _, null -> false | _ -> x.NavigableItem.Document.Id = y.NavigableItem.Document.Id && x.NavigableItem.SourceSpan = y.NavigableItem.SourceSpan - member __.GetHashCode(x: INavigateToSearchResult) = + member __.GetHashCode(x: FSharpNavigateToSearchResult) = if isNull x then 0 else 23 * (17 * 23 + x.NavigableItem.Document.Id.GetHashCode()) + x.NavigableItem.SourceSpan.GetHashCode() } @@ -115,11 +97,11 @@ module private Index = let entry = entries.[index] let matchKind = if entry.Offset = 0 then - if entry.Length = searchValue.Length then NavigateToMatchKind.Exact - else NavigateToMatchKind.Prefix - else NavigateToMatchKind.Substring + if entry.Length = searchValue.Length then FSharpNavigateToMatchKind.Exact + else FSharpNavigateToMatchKind.Prefix + else FSharpNavigateToMatchKind.Substring let item = entry.Item - result.Add (NavigateToSearchResult(item, matchKind) :> INavigateToSearchResult) |> ignore + result.Add (NavigateToSearchResult(item, matchKind) :> FSharpNavigateToSearchResult) |> ignore // in case if there are multiple matching items binary search might return not the first one. // in this case we'll walk backwards searching for the applicable answers @@ -140,17 +122,17 @@ module private Index = module private Utils = let navigateToItemKindToRoslynKind = function - | NavigateTo.NavigableItemKind.Module -> NavigateToItemKind.Module - | NavigateTo.NavigableItemKind.ModuleAbbreviation -> NavigateToItemKind.Module - | NavigateTo.NavigableItemKind.Exception -> NavigateToItemKind.Class - | NavigateTo.NavigableItemKind.Type -> NavigateToItemKind.Class - | NavigateTo.NavigableItemKind.ModuleValue -> NavigateToItemKind.Field - | NavigateTo.NavigableItemKind.Field -> NavigateToItemKind.Field - | NavigateTo.NavigableItemKind.Property -> NavigateToItemKind.Property - | NavigateTo.NavigableItemKind.Constructor -> NavigateToItemKind.Method - | NavigateTo.NavigableItemKind.Member -> NavigateToItemKind.Method - | NavigateTo.NavigableItemKind.EnumCase -> NavigateToItemKind.EnumItem - | NavigateTo.NavigableItemKind.UnionCase -> NavigateToItemKind.EnumItem + | NavigateTo.NavigableItemKind.Module -> FSharpNavigateToItemKind.Module + | NavigateTo.NavigableItemKind.ModuleAbbreviation -> FSharpNavigateToItemKind.Module + | NavigateTo.NavigableItemKind.Exception -> FSharpNavigateToItemKind.Class + | NavigateTo.NavigableItemKind.Type -> FSharpNavigateToItemKind.Class + | NavigateTo.NavigableItemKind.ModuleValue -> FSharpNavigateToItemKind.Field + | NavigateTo.NavigableItemKind.Field -> FSharpNavigateToItemKind.Field + | NavigateTo.NavigableItemKind.Property -> FSharpNavigateToItemKind.Property + | NavigateTo.NavigableItemKind.Constructor -> FSharpNavigateToItemKind.Method + | NavigateTo.NavigableItemKind.Member -> FSharpNavigateToItemKind.Method + | NavigateTo.NavigableItemKind.EnumCase -> FSharpNavigateToItemKind.EnumItem + | NavigateTo.NavigableItemKind.UnionCase -> FSharpNavigateToItemKind.EnumItem let navigateToItemKindToGlyph = function | NavigateTo.NavigableItemKind.Module -> Glyph.ModulePublic @@ -182,7 +164,7 @@ module private Utils = type PerDocumentSavedData = { Hash: int; Items: Index.IIndexedNavigableItems } -[, FSharpConstants.FSharpLanguageName); Shared>] +[)>] type internal FSharpNavigateToSearchService [] ( @@ -190,7 +172,7 @@ type internal FSharpNavigateToSearchService projectInfoManager: FSharpProjectOptionsManager ) = - let kindsProvided = ImmutableHashSet.Create(NavigateToItemKind.Module, NavigateToItemKind.Class, NavigateToItemKind.Field, NavigateToItemKind.Property, NavigateToItemKind.Method, NavigateToItemKind.Enum, NavigateToItemKind.EnumItem) :> IImmutableSet + let kindsProvided = ImmutableHashSet.Create(FSharpNavigateToItemKind.Module, FSharpNavigateToItemKind.Class, FSharpNavigateToItemKind.Field, FSharpNavigateToItemKind.Property, FSharpNavigateToItemKind.Method, FSharpNavigateToItemKind.Enum, FSharpNavigateToItemKind.EnumItem) :> IImmutableSet // Save the backing navigation data in a memory cache held in a sliding window let itemsByDocumentId = new MemoryCache("FSharp.Editor.FSharpNavigateToSearchService") @@ -237,15 +219,15 @@ type internal FSharpNavigateToSearchService return indexedItems } let patternMatchKindToNavigateToMatchKind = function - | PatternMatchKind.Exact -> NavigateToMatchKind.Exact - | PatternMatchKind.Prefix -> NavigateToMatchKind.Prefix - | PatternMatchKind.Substring -> NavigateToMatchKind.Substring - | PatternMatchKind.CamelCase -> NavigateToMatchKind.Regular - | PatternMatchKind.Fuzzy -> NavigateToMatchKind.Regular - | _ -> NavigateToMatchKind.Regular - - interface INavigateToSearchService_RemoveInterfaceAboveAndRenameThisAfterInternalsVisibleToUsersUpdate with - member __.SearchProjectAsync(project, _priorityDocuments, searchPattern, kinds, cancellationToken) : Task> = + | PatternMatchKind.Exact -> FSharpNavigateToMatchKind.Exact + | PatternMatchKind.Prefix -> FSharpNavigateToMatchKind.Prefix + | PatternMatchKind.Substring -> FSharpNavigateToMatchKind.Substring + | PatternMatchKind.CamelCase -> FSharpNavigateToMatchKind.Regular + | PatternMatchKind.Fuzzy -> FSharpNavigateToMatchKind.Regular + | _ -> FSharpNavigateToMatchKind.Regular + + interface IFSharpNavigateToSearchService with + member __.SearchProjectAsync(project, _priorityDocuments, searchPattern, kinds, cancellationToken) : Task> = asyncMaybe { let! parsingOptions, _options = projectInfoManager.TryGetOptionsByProject(project, cancellationToken) let! items = @@ -268,7 +250,7 @@ type internal FSharpNavigateToSearchService |> Array.Parallel.collect (fun x -> patternMatcher.GetMatches(x.Name) |> Seq.map (fun pm -> - NavigateToSearchResult(x, patternMatchKindToNavigateToMatchKind pm.Kind) :> INavigateToSearchResult) + NavigateToSearchResult(x, patternMatchKindToNavigateToMatchKind pm.Kind) :> FSharpNavigateToSearchResult) |> Seq.toArray) |] return items |> Array.distinctBy (fun x -> x.NavigableItem.Document.Id, x.NavigableItem.SourceSpan) @@ -277,7 +259,7 @@ type internal FSharpNavigateToSearchService |> Async.map Seq.toImmutableArray |> RoslynHelpers.StartAsyncAsTask(cancellationToken) - member __.SearchDocumentAsync(document, searchPattern, kinds, cancellationToken) : Task> = + member __.SearchDocumentAsync(document, searchPattern, kinds, cancellationToken) : Task> = asyncMaybe { let! parsingOptions, _, _ = projectInfoManager.TryGetOptionsForDocumentOrProject(document, cancellationToken) let! items = getCachedIndexedNavigableItems(document, parsingOptions, kinds) |> liftAsync diff --git a/vsintegration/src/FSharp.Editor/Navigation/NavigationBarItemService.fs b/vsintegration/src/FSharp.Editor/Navigation/NavigationBarItemService.fs index 18115fa62fd..d8edebd3ac1 100644 --- a/vsintegration/src/FSharp.Editor/Navigation/NavigationBarItemService.fs +++ b/vsintegration/src/FSharp.Editor/Navigation/NavigationBarItemService.fs @@ -10,13 +10,15 @@ open Microsoft.CodeAnalysis.Editor open Microsoft.CodeAnalysis.Navigation open Microsoft.CodeAnalysis.Host.Mef open Microsoft.CodeAnalysis.Notification +open Microsoft.CodeAnalysis.ExternalAccess.FSharp.Editor +open Microsoft.CodeAnalysis.ExternalAccess.FSharp.Navigation open FSharp.Compiler.SourceCodeServices type internal NavigationBarSymbolItem(text, glyph, spans, childItems) = - inherit NavigationBarItem(text, glyph, spans, childItems) + inherit FSharpNavigationBarItem(text, glyph, spans, childItems) -[, FSharpConstants.FSharpLanguageName); Shared>] +[)>] type internal FSharpNavigationBarItemService [] ( @@ -25,10 +27,10 @@ type internal FSharpNavigationBarItemService ) = static let userOpName = "NavigationBarItem" - static let emptyResult: IList = upcast [||] + static let emptyResult: IList = upcast [||] - interface INavigationBarItemService with - member __.GetItemsAsync(document, cancellationToken) : Task> = + interface IFSharpNavigationBarItemService with + member __.GetItemsAsync(document, cancellationToken) : Task> = asyncMaybe { let! parsingOptions, _options = projectInfoManager.TryGetOptionsForEditingDocumentOrProject(document, cancellationToken) let! sourceText = document.GetTextAsync(cancellationToken) @@ -45,25 +47,10 @@ type internal FSharpNavigationBarItemService |> Array.choose (fun decl -> rangeToTextSpan(decl.Range) |> Option.map(fun textSpan -> - NavigationBarSymbolItem(decl.Name, Microsoft.CodeAnalysis.ExternalAccess.FSharp.FSharpGlyphHelpersObsolete.Convert(decl.RoslynGlyph), [| textSpan |], null) :> NavigationBarItem)) + NavigationBarSymbolItem(decl.Name, decl.RoslynGlyph, [| textSpan |], null) :> FSharpNavigationBarItem)) - NavigationBarSymbolItem(topLevelDecl.Declaration.Name, Microsoft.CodeAnalysis.ExternalAccess.FSharp.FSharpGlyphHelpersObsolete.Convert(topLevelDecl.Declaration.RoslynGlyph), [| topLevelTextSpan |], childItems) - :> NavigationBarItem)) :> IList<_> + NavigationBarSymbolItem(topLevelDecl.Declaration.Name, topLevelDecl.Declaration.RoslynGlyph, [| topLevelTextSpan |], childItems) + :> FSharpNavigationBarItem)) :> IList<_> } |> Async.map (Option.defaultValue emptyResult) |> RoslynHelpers.StartAsyncAsTask(cancellationToken) - - member __.ShowItemGrayedIfNear (_item) : bool = false - - member __.NavigateToItem(document, item, _view, _cancellationToken) = - match item.Spans |> Seq.tryHead with - | Some span -> - let workspace = document.Project.Solution.Workspace - let navigationService = workspace.Services.GetService() - - if navigationService.CanNavigateToPosition(workspace, document.Id, span.Start) then - navigationService.TryNavigateToPosition(workspace, document.Id, span.Start) |> ignore - else - let notificationService = workspace.Services.GetService() - notificationService.SendNotification(EditorFeaturesResources.The_definition_of_the_object_is_hidden, severity = NotificationSeverity.Error) - | None -> () \ No newline at end of file diff --git a/vsintegration/src/FSharp.Editor/Structure/BlockStructureService.fs b/vsintegration/src/FSharp.Editor/Structure/BlockStructureService.fs index ab2c04ddca2..996845ed516 100644 --- a/vsintegration/src/FSharp.Editor/Structure/BlockStructureService.fs +++ b/vsintegration/src/FSharp.Editor/Structure/BlockStructureService.fs @@ -10,6 +10,7 @@ open Microsoft.CodeAnalysis open Microsoft.CodeAnalysis.Host.Mef open Microsoft.CodeAnalysis.Text open Microsoft.CodeAnalysis.Structure +open Microsoft.CodeAnalysis.ExternalAccess.FSharp.Structure open FSharp.Compiler open FSharp.Compiler.SourceCodeServices @@ -17,9 +18,9 @@ open FSharp.Compiler.SourceCodeServices.Structure module internal BlockStructure = let scopeToBlockType = function - | Scope.Open -> BlockTypes.Imports + | Scope.Open -> FSharpBlockTypes.Imports | Scope.Namespace - | Scope.Module -> BlockTypes.Namespace + | Scope.Module -> FSharpBlockTypes.Namespace | Scope.Record | Scope.Interface | Scope.TypeExtension @@ -28,10 +29,10 @@ module internal BlockStructure = | Scope.ObjExpr | Scope.UnionDefn | Scope.Attribute - | Scope.Type -> BlockTypes.Type + | Scope.Type -> FSharpBlockTypes.Type | Scope.New | Scope.RecordField - | Scope.Member -> BlockTypes.Member + | Scope.Member -> FSharpBlockTypes.Member | Scope.LetOrUse | Scope.Match | Scope.MatchBang @@ -47,7 +48,7 @@ module internal BlockStructure = | Scope.TryFinally | Scope.TryInTryFinally | Scope.FinallyInTryFinally - | Scope.IfThenElse-> BlockTypes.Conditional + | Scope.IfThenElse-> FSharpBlockTypes.Conditional | Scope.Tuple | Scope.ArrayOrList | Scope.CompExprInternal @@ -58,13 +59,13 @@ module internal BlockStructure = | Scope.Val | Scope.YieldOrReturn | Scope.YieldOrReturnBang - | Scope.TryWith -> BlockTypes.Expression - | Scope.Do -> BlockTypes.Statement + | Scope.TryWith -> FSharpBlockTypes.Expression + | Scope.Do -> FSharpBlockTypes.Statement | Scope.While - | Scope.For -> BlockTypes.Loop - | Scope.HashDirective -> BlockTypes.PreprocessorRegion + | Scope.For -> FSharpBlockTypes.Loop + | Scope.HashDirective -> FSharpBlockTypes.PreprocessorRegion | Scope.Comment - | Scope.XmlDocComment -> BlockTypes.Comment + | Scope.XmlDocComment -> FSharpBlockTypes.Comment let isAutoCollapsible = function | Scope.New @@ -134,33 +135,27 @@ module internal BlockStructure = match Option.ofNullable (line.Span.Intersection textSpan) with | Some span -> sourceText.GetSubText(span).ToString()+"..." | None -> "..." - let blockType = if isBlockStructureEnabled then scopeToBlockType scopeRange.Scope else BlockTypes.Nonstructural - Some (BlockSpan(blockType, true, textSpan, hintSpan, bannerText, autoCollapse = isAutoCollapsible scopeRange.Scope)) + let blockType = if isBlockStructureEnabled then scopeToBlockType scopeRange.Scope else FSharpBlockTypes.Nonstructural + Some (FSharpBlockSpan(blockType, true, textSpan, hintSpan, bannerText, autoCollapse = isAutoCollapsible scopeRange.Scope)) | _, _ -> None ) open BlockStructure -type internal FSharpBlockStructureService(checker: FSharpChecker, projectInfoManager: FSharpProjectOptionsManager) = - inherit BlockStructureService() +[)>] +type internal FSharpBlockStructureService [] (checkerProvider: FSharpCheckerProvider, projectInfoManager: FSharpProjectOptionsManager) = - static let userOpName = "BlockStructure" + static let userOpName = "FSharpBlockStructure" - override __.Language = FSharpConstants.FSharpLanguageName + interface IFSharpBlockStructureService with - override __.GetBlockStructureAsync(document, cancellationToken) : Task = - asyncMaybe { - let! parsingOptions, _options = projectInfoManager.TryGetOptionsForEditingDocumentOrProject(document, cancellationToken) - let! sourceText = document.GetTextAsync(cancellationToken) - let! parsedInput = checker.ParseDocument(document, parsingOptions, sourceText, userOpName) - return createBlockSpans document.FSharpOptions.Advanced.IsBlockStructureEnabled sourceText parsedInput |> Seq.toImmutableArray - } - |> Async.map (Option.defaultValue ImmutableArray<_>.Empty) - |> Async.map BlockStructure - |> RoslynHelpers.StartAsyncAsTask(cancellationToken) - -[, FSharpConstants.FSharpLanguageName); Shared>] -type internal FSharpBlockStructureServiceFactory [](checkerProvider: FSharpCheckerProvider, projectInfoManager: FSharpProjectOptionsManager) = - interface ILanguageServiceFactory with - member __.CreateLanguageService(_languageServices) = - upcast FSharpBlockStructureService(checkerProvider.Checker, projectInfoManager) \ No newline at end of file + member __.GetBlockStructureAsync(document, cancellationToken) : Task = + asyncMaybe { + let! parsingOptions, _options = projectInfoManager.TryGetOptionsForEditingDocumentOrProject(document, cancellationToken) + let! sourceText = document.GetTextAsync(cancellationToken) + let! parsedInput = checkerProvider.Checker.ParseDocument(document, parsingOptions, sourceText, userOpName) + return createBlockSpans document.FSharpOptions.Advanced.IsBlockStructureEnabled sourceText parsedInput |> Seq.toImmutableArray + } + |> Async.map (Option.defaultValue ImmutableArray<_>.Empty) + |> Async.map FSharpBlockStructure + |> RoslynHelpers.StartAsyncAsTask(cancellationToken) diff --git a/vsintegration/src/FSharp.LanguageService/FSharp.LanguageService.fsproj b/vsintegration/src/FSharp.LanguageService/FSharp.LanguageService.fsproj index cf72f552163..7692f24fcb1 100644 --- a/vsintegration/src/FSharp.LanguageService/FSharp.LanguageService.fsproj +++ b/vsintegration/src/FSharp.LanguageService/FSharp.LanguageService.fsproj @@ -81,6 +81,7 @@ + diff --git a/vsintegration/tests/GetTypesVS.UnitTests/GetTypesVS.UnitTests.fsproj b/vsintegration/tests/GetTypesVS.UnitTests/GetTypesVS.UnitTests.fsproj index d44b41fab37..8c70a8c5e0a 100644 --- a/vsintegration/tests/GetTypesVS.UnitTests/GetTypesVS.UnitTests.fsproj +++ b/vsintegration/tests/GetTypesVS.UnitTests/GetTypesVS.UnitTests.fsproj @@ -1,4 +1,4 @@ - + @@ -24,6 +24,7 @@ + diff --git a/vsintegration/tests/UnitTests/VisualFSharp.UnitTests.fsproj b/vsintegration/tests/UnitTests/VisualFSharp.UnitTests.fsproj index 7b11fb96c6c..7a0bea77017 100644 --- a/vsintegration/tests/UnitTests/VisualFSharp.UnitTests.fsproj +++ b/vsintegration/tests/UnitTests/VisualFSharp.UnitTests.fsproj @@ -253,6 +253,7 @@ + From a24d94ecf97d0d69d4fbe6b8b10cd1f97737fff4 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Zbyn=C4=9Bk=20Sailer?= Date: Thu, 20 Jun 2019 18:21:11 +0200 Subject: [PATCH 7/7] LOC CHECKIN | Microsoft/visualfsharp release/dev16.2 | 20190620 (#7022) --- src/fsharp/FSharp.Build/xlf/FSBuild.txt.cs.xlf | 2 +- src/fsharp/FSharp.Build/xlf/FSBuild.txt.de.xlf | 2 +- src/fsharp/FSharp.Build/xlf/FSBuild.txt.es.xlf | 2 +- src/fsharp/FSharp.Build/xlf/FSBuild.txt.fr.xlf | 2 +- src/fsharp/FSharp.Build/xlf/FSBuild.txt.it.xlf | 2 +- src/fsharp/FSharp.Build/xlf/FSBuild.txt.ja.xlf | 2 +- src/fsharp/FSharp.Build/xlf/FSBuild.txt.ko.xlf | 2 +- src/fsharp/FSharp.Build/xlf/FSBuild.txt.pl.xlf | 2 +- src/fsharp/FSharp.Build/xlf/FSBuild.txt.pt-BR.xlf | 2 +- src/fsharp/FSharp.Build/xlf/FSBuild.txt.ru.xlf | 2 +- src/fsharp/FSharp.Build/xlf/FSBuild.txt.tr.xlf | 2 +- .../FSharp.Build/xlf/FSBuild.txt.zh-Hans.xlf | 2 +- .../FSharp.Build/xlf/FSBuild.txt.zh-Hant.xlf | 2 +- src/fsharp/xlf/FSComp.txt.cs.xlf | 12 ++++++------ src/fsharp/xlf/FSComp.txt.de.xlf | 12 ++++++------ src/fsharp/xlf/FSComp.txt.es.xlf | 14 +++++++------- src/fsharp/xlf/FSComp.txt.fr.xlf | 12 ++++++------ src/fsharp/xlf/FSComp.txt.it.xlf | 12 ++++++------ src/fsharp/xlf/FSComp.txt.ja.xlf | 12 ++++++------ src/fsharp/xlf/FSComp.txt.ko.xlf | 12 ++++++------ src/fsharp/xlf/FSComp.txt.pl.xlf | 12 ++++++------ src/fsharp/xlf/FSComp.txt.pt-BR.xlf | 12 ++++++------ src/fsharp/xlf/FSComp.txt.ru.xlf | 12 ++++++------ src/fsharp/xlf/FSComp.txt.tr.xlf | 12 ++++++------ src/fsharp/xlf/FSComp.txt.zh-Hans.xlf | 12 ++++++------ src/fsharp/xlf/FSComp.txt.zh-Hant.xlf | 12 ++++++------ .../Microsoft.VisualStudio.Editors.Designer.cs.xlf | 3 +-- .../Microsoft.VisualStudio.Editors.Designer.de.xlf | 3 +-- .../Microsoft.VisualStudio.Editors.Designer.es.xlf | 3 +-- .../Microsoft.VisualStudio.Editors.Designer.fr.xlf | 3 +-- .../Microsoft.VisualStudio.Editors.Designer.it.xlf | 3 +-- .../Microsoft.VisualStudio.Editors.Designer.ja.xlf | 3 +-- .../Microsoft.VisualStudio.Editors.Designer.ko.xlf | 3 +-- .../Microsoft.VisualStudio.Editors.Designer.pl.xlf | 3 +-- ...crosoft.VisualStudio.Editors.Designer.pt-BR.xlf | 3 +-- .../Microsoft.VisualStudio.Editors.Designer.ru.xlf | 3 +-- .../Microsoft.VisualStudio.Editors.Designer.tr.xlf | 3 +-- ...osoft.VisualStudio.Editors.Designer.zh-Hans.xlf | 3 +-- ...osoft.VisualStudio.Editors.Designer.zh-Hant.xlf | 3 +-- .../src/FSharp.UIResources/xlf/Strings.cs.xlf | 4 ++-- .../src/FSharp.UIResources/xlf/Strings.de.xlf | 4 ++-- .../src/FSharp.UIResources/xlf/Strings.es.xlf | 4 ++-- .../src/FSharp.UIResources/xlf/Strings.fr.xlf | 4 ++-- .../src/FSharp.UIResources/xlf/Strings.it.xlf | 4 ++-- .../src/FSharp.UIResources/xlf/Strings.ja.xlf | 4 ++-- .../src/FSharp.UIResources/xlf/Strings.ko.xlf | 4 ++-- .../src/FSharp.UIResources/xlf/Strings.pl.xlf | 4 ++-- .../src/FSharp.UIResources/xlf/Strings.pt-BR.xlf | 4 ++-- .../src/FSharp.UIResources/xlf/Strings.ru.xlf | 4 ++-- .../src/FSharp.UIResources/xlf/Strings.tr.xlf | 4 ++-- .../src/FSharp.UIResources/xlf/Strings.zh-Hans.xlf | 4 ++-- .../src/FSharp.UIResources/xlf/Strings.zh-Hant.xlf | 4 ++-- 52 files changed, 131 insertions(+), 144 deletions(-) diff --git a/src/fsharp/FSharp.Build/xlf/FSBuild.txt.cs.xlf b/src/fsharp/FSharp.Build/xlf/FSBuild.txt.cs.xlf index 64e44dc099e..e34a840079e 100644 --- a/src/fsharp/FSharp.Build/xlf/FSBuild.txt.cs.xlf +++ b/src/fsharp/FSharp.Build/xlf/FSBuild.txt.cs.xlf @@ -4,7 +4,7 @@ {0} for F# {1} - {0} for F# {1} + {0} pro F# {1} diff --git a/src/fsharp/FSharp.Build/xlf/FSBuild.txt.de.xlf b/src/fsharp/FSharp.Build/xlf/FSBuild.txt.de.xlf index 1865fb58fea..8014aa45590 100644 --- a/src/fsharp/FSharp.Build/xlf/FSBuild.txt.de.xlf +++ b/src/fsharp/FSharp.Build/xlf/FSBuild.txt.de.xlf @@ -4,7 +4,7 @@ {0} for F# {1} - {0} for F# {1} + {0} für F# {1} diff --git a/src/fsharp/FSharp.Build/xlf/FSBuild.txt.es.xlf b/src/fsharp/FSharp.Build/xlf/FSBuild.txt.es.xlf index 05929de6032..e70e526aa75 100644 --- a/src/fsharp/FSharp.Build/xlf/FSBuild.txt.es.xlf +++ b/src/fsharp/FSharp.Build/xlf/FSBuild.txt.es.xlf @@ -4,7 +4,7 @@ {0} for F# {1} - {0} for F# {1} + {0} para F# {1} diff --git a/src/fsharp/FSharp.Build/xlf/FSBuild.txt.fr.xlf b/src/fsharp/FSharp.Build/xlf/FSBuild.txt.fr.xlf index 22d534392f1..967ceecc6e4 100644 --- a/src/fsharp/FSharp.Build/xlf/FSBuild.txt.fr.xlf +++ b/src/fsharp/FSharp.Build/xlf/FSBuild.txt.fr.xlf @@ -4,7 +4,7 @@ {0} for F# {1} - {0} for F# {1} + {0} pour F# {1} diff --git a/src/fsharp/FSharp.Build/xlf/FSBuild.txt.it.xlf b/src/fsharp/FSharp.Build/xlf/FSBuild.txt.it.xlf index 2e707f25086..a0c02bd7658 100644 --- a/src/fsharp/FSharp.Build/xlf/FSBuild.txt.it.xlf +++ b/src/fsharp/FSharp.Build/xlf/FSBuild.txt.it.xlf @@ -4,7 +4,7 @@ {0} for F# {1} - {0} for F# {1} + {0} per F# {1} diff --git a/src/fsharp/FSharp.Build/xlf/FSBuild.txt.ja.xlf b/src/fsharp/FSharp.Build/xlf/FSBuild.txt.ja.xlf index 627dc44db2d..2cbcdb1927b 100644 --- a/src/fsharp/FSharp.Build/xlf/FSBuild.txt.ja.xlf +++ b/src/fsharp/FSharp.Build/xlf/FSBuild.txt.ja.xlf @@ -4,7 +4,7 @@ {0} for F# {1} - {0} for F# {1} + F# {1} の {0} diff --git a/src/fsharp/FSharp.Build/xlf/FSBuild.txt.ko.xlf b/src/fsharp/FSharp.Build/xlf/FSBuild.txt.ko.xlf index f337b0ad289..d007db16c3c 100644 --- a/src/fsharp/FSharp.Build/xlf/FSBuild.txt.ko.xlf +++ b/src/fsharp/FSharp.Build/xlf/FSBuild.txt.ko.xlf @@ -4,7 +4,7 @@ {0} for F# {1} - {0} for F# {1} + F# {1}용 {0} diff --git a/src/fsharp/FSharp.Build/xlf/FSBuild.txt.pl.xlf b/src/fsharp/FSharp.Build/xlf/FSBuild.txt.pl.xlf index f88076689ac..565fdd2b8d2 100644 --- a/src/fsharp/FSharp.Build/xlf/FSBuild.txt.pl.xlf +++ b/src/fsharp/FSharp.Build/xlf/FSBuild.txt.pl.xlf @@ -4,7 +4,7 @@ {0} for F# {1} - {0} for F# {1} + {0} dla języka F# {1} diff --git a/src/fsharp/FSharp.Build/xlf/FSBuild.txt.pt-BR.xlf b/src/fsharp/FSharp.Build/xlf/FSBuild.txt.pt-BR.xlf index e6c5b3c6011..2d6ac4cf6ca 100644 --- a/src/fsharp/FSharp.Build/xlf/FSBuild.txt.pt-BR.xlf +++ b/src/fsharp/FSharp.Build/xlf/FSBuild.txt.pt-BR.xlf @@ -4,7 +4,7 @@ {0} for F# {1} - {0} for F# {1} + {0} para F# {1} diff --git a/src/fsharp/FSharp.Build/xlf/FSBuild.txt.ru.xlf b/src/fsharp/FSharp.Build/xlf/FSBuild.txt.ru.xlf index b84d44d49d4..23dc6215bd4 100644 --- a/src/fsharp/FSharp.Build/xlf/FSBuild.txt.ru.xlf +++ b/src/fsharp/FSharp.Build/xlf/FSBuild.txt.ru.xlf @@ -4,7 +4,7 @@ {0} for F# {1} - {0} for F# {1} + {0} для F# {1} diff --git a/src/fsharp/FSharp.Build/xlf/FSBuild.txt.tr.xlf b/src/fsharp/FSharp.Build/xlf/FSBuild.txt.tr.xlf index 02194a2720b..b56fc715900 100644 --- a/src/fsharp/FSharp.Build/xlf/FSBuild.txt.tr.xlf +++ b/src/fsharp/FSharp.Build/xlf/FSBuild.txt.tr.xlf @@ -4,7 +4,7 @@ {0} for F# {1} - {0} for F# {1} + F# {1} için {0} diff --git a/src/fsharp/FSharp.Build/xlf/FSBuild.txt.zh-Hans.xlf b/src/fsharp/FSharp.Build/xlf/FSBuild.txt.zh-Hans.xlf index 12ae0131cbd..f514600395d 100644 --- a/src/fsharp/FSharp.Build/xlf/FSBuild.txt.zh-Hans.xlf +++ b/src/fsharp/FSharp.Build/xlf/FSBuild.txt.zh-Hans.xlf @@ -4,7 +4,7 @@ {0} for F# {1} - {0} for F# {1} + F# {1} 的 {0} diff --git a/src/fsharp/FSharp.Build/xlf/FSBuild.txt.zh-Hant.xlf b/src/fsharp/FSharp.Build/xlf/FSBuild.txt.zh-Hant.xlf index c18392ba1dc..e3f63746fa4 100644 --- a/src/fsharp/FSharp.Build/xlf/FSBuild.txt.zh-Hant.xlf +++ b/src/fsharp/FSharp.Build/xlf/FSBuild.txt.zh-Hant.xlf @@ -4,7 +4,7 @@ {0} for F# {1} - {0} for F# {1} + F # {1} 的 {0} diff --git a/src/fsharp/xlf/FSComp.txt.cs.xlf b/src/fsharp/xlf/FSComp.txt.cs.xlf index 3354ee57b5f..4ca8437501f 100644 --- a/src/fsharp/xlf/FSComp.txt.cs.xlf +++ b/src/fsharp/xlf/FSComp.txt.cs.xlf @@ -4,7 +4,7 @@ {0} for F# {1} - {0} for F# {1} + {0} pro F# {1} @@ -144,7 +144,7 @@ Use reference assemblies for .NET framework references when available (Enabled by default). - Use reference assemblies for .NET framework references when available (Enabled by default). + Pro odkazy na rozhraní .NET používejte referenční sestavení, pokud jsou k dispozici (ve výchozím nastavení povolené). @@ -5549,7 +5549,7 @@ Deterministic builds only support portable PDBs (--debug:portable or --debug:embedded) - Deterministická sestavení podporují jenom soubory PDB typu Portable (--debug:portable nebo --debug:embedded). + Deterministické buildy podporují jenom přenositelné soubory PDB (--debug:portable nebo --debug:embedded) @@ -7164,17 +7164,17 @@ Maps physical paths to source path names output by the compiler - Maps physical paths to source path names output by the compiler + Mapuje fyzické cesty na názvy zdrojových cest z výstupu kompilátoru. --pathmap can only be used with portable PDBs (--debug:portable or --debug:embedded) - --pathmap can only be used with portable PDBs (--debug:portable or --debug:embedded) + Parametr --pathmap se může používat jenom s přenositelnými soubory PDB (--debug:portable nebo --debug:embedded) Invalid path map. Mappings must be comma separated and of the format 'path=sourcePath' - Invalid path map. Mappings must be comma separated and of the format 'path=sourcePath' + Neplatná mapa cest. Mapování musí být oddělená čárkami a používat formát cesta=zdrojováCesta. diff --git a/src/fsharp/xlf/FSComp.txt.de.xlf b/src/fsharp/xlf/FSComp.txt.de.xlf index 320acf4e03d..1f0aa761532 100644 --- a/src/fsharp/xlf/FSComp.txt.de.xlf +++ b/src/fsharp/xlf/FSComp.txt.de.xlf @@ -4,7 +4,7 @@ {0} for F# {1} - {0} for F# {1} + {0} für F# {1} @@ -144,7 +144,7 @@ Use reference assemblies for .NET framework references when available (Enabled by default). - Use reference assemblies for .NET framework references when available (Enabled by default). + Verweisassemblys für .NET Framework-Verweise verwenden, wenn verfügbar (standardmäßig aktiviert). @@ -5549,7 +5549,7 @@ Deterministic builds only support portable PDBs (--debug:portable or --debug:embedded) - Deterministische Builds unterstützen nur portierbare PDbs ("--debug:portable" oder "--debug:embedded"). + Deterministische Builds unterstützen nur portable PDB-Dateien (--debug:portable oder --debug:embedded) @@ -7164,17 +7164,17 @@ Maps physical paths to source path names output by the compiler - Maps physical paths to source path names output by the compiler + Ordnet der Ausgabe von Quellpfadnamen des Compilers physische Pfade zu --pathmap can only be used with portable PDBs (--debug:portable or --debug:embedded) - --pathmap can only be used with portable PDBs (--debug:portable or --debug:embedded) + --pathmap kann nur mit portablen PDB-Dateien verwendet werden (--debug:portable oder --debug:embedded) Invalid path map. Mappings must be comma separated and of the format 'path=sourcePath' - Invalid path map. Mappings must be comma separated and of the format 'path=sourcePath' + Ungültige Pfadzuordnung. Zuordnungen müssen durch Kommas getrennt werden und das Format 'path=sourcePath' aufweisen diff --git a/src/fsharp/xlf/FSComp.txt.es.xlf b/src/fsharp/xlf/FSComp.txt.es.xlf index b08960e4861..1ac646d5892 100644 --- a/src/fsharp/xlf/FSComp.txt.es.xlf +++ b/src/fsharp/xlf/FSComp.txt.es.xlf @@ -4,7 +4,7 @@ {0} for F# {1} - {0} for F# {1} + {0} para F# {1} @@ -114,7 +114,7 @@ All branches of a pattern match expression must return values of the same type as the first branch, which here is '{0}'. This branch returns a value of type '{1}'. - All branches of a pattern match expression must return values of the same type as the first branch, which here is '{0}'. This branch returns a value of type '{1}'. + Todas las ramas de una expresión de coincidencia de patrón deben devolver valores del mismo tipo. La primera rama devolvió un valor de tipo "{0}", pero esta rama devolvió un valor de tipo "\{1 \}". @@ -144,7 +144,7 @@ Use reference assemblies for .NET framework references when available (Enabled by default). - Use reference assemblies for .NET framework references when available (Enabled by default). + Use ensamblados de referencia para las referencias de .NET Framework cuando estén disponibles (habilitado de forma predeterminada). @@ -5549,7 +5549,7 @@ Deterministic builds only support portable PDBs (--debug:portable or --debug:embedded) - Las compilaciones deterministas solo admiten PDB portátiles (--debug:portable o --debug:embedded) + Las compilaciones deterministas solo admiten PDB portátiles (--Debug: portable o--Debug: embedded) @@ -7164,17 +7164,17 @@ Maps physical paths to source path names output by the compiler - Maps physical paths to source path names output by the compiler + Asigna rutas físicas de acceso a nombres de ruta de origen resultantes del compilador --pathmap can only be used with portable PDBs (--debug:portable or --debug:embedded) - --pathmap can only be used with portable PDBs (--debug:portable or --debug:embedded) + --pathmap solo se puede utilizar con PDB portátiles (--Debug:portable o --Debug:embedded) Invalid path map. Mappings must be comma separated and of the format 'path=sourcePath' - Invalid path map. Mappings must be comma separated and of the format 'path=sourcePath' + Mapa de ruta no válido. Las asignaciones deben estar separadas por comas y tener el formato "path=rutaOrigen" diff --git a/src/fsharp/xlf/FSComp.txt.fr.xlf b/src/fsharp/xlf/FSComp.txt.fr.xlf index f23037f6a88..f2cd73f377b 100644 --- a/src/fsharp/xlf/FSComp.txt.fr.xlf +++ b/src/fsharp/xlf/FSComp.txt.fr.xlf @@ -4,7 +4,7 @@ {0} for F# {1} - {0} for F# {1} + {0} pour F# {1} @@ -144,7 +144,7 @@ Use reference assemblies for .NET framework references when available (Enabled by default). - Use reference assemblies for .NET framework references when available (Enabled by default). + Utilisez des assemblys de référence pour les références .NET Framework quand ils sont disponibles (activé par défaut). @@ -5549,7 +5549,7 @@ Deterministic builds only support portable PDBs (--debug:portable or --debug:embedded) - Les builds déterministes ne prennent en charge que les fichiers PDB portables (--debug:portable ou --debug:embedded) + Les builds déterministes prennent seulement en charge les PDB portables (--debug:portable ou --debug:embedded) @@ -7164,17 +7164,17 @@ Maps physical paths to source path names output by the compiler - Maps physical paths to source path names output by the compiler + Mappe les chemins physiques aux noms de chemin source générés par le compilateur --pathmap can only be used with portable PDBs (--debug:portable or --debug:embedded) - --pathmap can only be used with portable PDBs (--debug:portable or --debug:embedded) + --pathmap peut seulement être utilisé avec des PBD portables (--debug:portable ou --debug:embedded) Invalid path map. Mappings must be comma separated and of the format 'path=sourcePath' - Invalid path map. Mappings must be comma separated and of the format 'path=sourcePath' + Mappage de chemin non valide. Les mappages doivent être séparés par des virgules et au format 'path=sourcePath' diff --git a/src/fsharp/xlf/FSComp.txt.it.xlf b/src/fsharp/xlf/FSComp.txt.it.xlf index 32637f988da..5bf595dea57 100644 --- a/src/fsharp/xlf/FSComp.txt.it.xlf +++ b/src/fsharp/xlf/FSComp.txt.it.xlf @@ -4,7 +4,7 @@ {0} for F# {1} - {0} for F# {1} + {0} per F# {1} @@ -144,7 +144,7 @@ Use reference assemblies for .NET framework references when available (Enabled by default). - Use reference assemblies for .NET framework references when available (Enabled by default). + Usa gli assembly di riferimento per i riferimenti a .NET Framework quando disponibili (abilitato per impostazione predefinita). @@ -5549,7 +5549,7 @@ Deterministic builds only support portable PDBs (--debug:portable or --debug:embedded) - Le compilazioni deterministiche supportano solo file PDB portatili (--debug:portable o --debug:embedded) + Le compilazioni deterministiche supportano solo file PDB portatili (--debug:portable o --debug:embedded) @@ -7164,17 +7164,17 @@ Maps physical paths to source path names output by the compiler - Maps physical paths to source path names output by the compiler + Esegue il mapping dei percorsi fisici ai nomi di percorso di origine restituiti dal compilatore --pathmap can only be used with portable PDBs (--debug:portable or --debug:embedded) - --pathmap can only be used with portable PDBs (--debug:portable or --debug:embedded) + --pathmap può essere usato solo con file PDB portatili (--debug:portable o --debug:embedded) Invalid path map. Mappings must be comma separated and of the format 'path=sourcePath' - Invalid path map. Mappings must be comma separated and of the format 'path=sourcePath' + Mapping di percorso non valido. I mapping devono essere delimitati da virgole e specificati in formato 'percorso=percorsoOrigine' diff --git a/src/fsharp/xlf/FSComp.txt.ja.xlf b/src/fsharp/xlf/FSComp.txt.ja.xlf index 8157060c9d8..bcbf7c58ed0 100644 --- a/src/fsharp/xlf/FSComp.txt.ja.xlf +++ b/src/fsharp/xlf/FSComp.txt.ja.xlf @@ -4,7 +4,7 @@ {0} for F# {1} - {0} for F# {1} + F# {1} の {0} @@ -144,7 +144,7 @@ Use reference assemblies for .NET framework references when available (Enabled by default). - Use reference assemblies for .NET framework references when available (Enabled by default). + 使用可能な場合は、.NET Framework リファレンスの参照アセンブリを使用します (既定で有効)。 @@ -5551,7 +5551,7 @@ Deterministic builds only support portable PDBs (--debug:portable or --debug:embedded) - 決定論的ビルドはポータブル PDB のみをサポートします (--debug:portable または --debug:embedded) + 決定論的ビルドは、ポータブル PDB のみをサポートします (--debug:portable または --debug:embedded) @@ -7166,17 +7166,17 @@ Maps physical paths to source path names output by the compiler - Maps physical paths to source path names output by the compiler + 物理パスをコンパイラ出力のソース パス名にマップします --pathmap can only be used with portable PDBs (--debug:portable or --debug:embedded) - --pathmap can only be used with portable PDBs (--debug:portable or --debug:embedded) + --pathmap は、ポータブル PDB でのみ使用できます (--debug:portable または --debug:embedded) Invalid path map. Mappings must be comma separated and of the format 'path=sourcePath' - Invalid path map. Mappings must be comma separated and of the format 'path=sourcePath' + 無効なパス マップです。マッピングはコンマ区切りの 'path=sourcePath' 形式である必要があります diff --git a/src/fsharp/xlf/FSComp.txt.ko.xlf b/src/fsharp/xlf/FSComp.txt.ko.xlf index f642d6b444d..18a45877719 100644 --- a/src/fsharp/xlf/FSComp.txt.ko.xlf +++ b/src/fsharp/xlf/FSComp.txt.ko.xlf @@ -4,7 +4,7 @@ {0} for F# {1} - {0} for F# {1} + F# {1}용 {0} @@ -144,7 +144,7 @@ Use reference assemblies for .NET framework references when available (Enabled by default). - Use reference assemblies for .NET framework references when available (Enabled by default). + 기본적으로 활성화되는 참조 어셈블리를 .NET Framework 참조에 사용합니다(사용 가능한 경우). @@ -5549,7 +5549,7 @@ Deterministic builds only support portable PDBs (--debug:portable or --debug:embedded) - 결정적 빌드는 이식 가능한 PDB만 지원합니다(--debug:portable 또는 --debug:embedded). + 결정적 빌드는 이식 가능한 PDB만 지원합니다(--debug:portable 또는 --debug:embedded). @@ -7164,17 +7164,17 @@ Maps physical paths to source path names output by the compiler - Maps physical paths to source path names output by the compiler + 컴파일러에서 실제 경로를 소스 경로 이름 출력에 매핑합니다. --pathmap can only be used with portable PDBs (--debug:portable or --debug:embedded) - --pathmap can only be used with portable PDBs (--debug:portable or --debug:embedded) + --pathmap은 이식 가능한 PDB에만 사용할 수 있습니다(--debug:portable 또는 --debug:embedded). Invalid path map. Mappings must be comma separated and of the format 'path=sourcePath' - Invalid path map. Mappings must be comma separated and of the format 'path=sourcePath' + 잘못된 경로 맵입니다. 매핑은 쉼표로 구분되어야 하며 'path=sourcePath' 형식이어야 합니다. diff --git a/src/fsharp/xlf/FSComp.txt.pl.xlf b/src/fsharp/xlf/FSComp.txt.pl.xlf index b9749bedda5..69935ec9433 100644 --- a/src/fsharp/xlf/FSComp.txt.pl.xlf +++ b/src/fsharp/xlf/FSComp.txt.pl.xlf @@ -4,7 +4,7 @@ {0} for F# {1} - {0} for F# {1} + {0} dla języka F# {1} @@ -144,7 +144,7 @@ Use reference assemblies for .NET framework references when available (Enabled by default). - Use reference assemblies for .NET framework references when available (Enabled by default). + Użyj zestawów odwołań dla odwołań do programu .NET Framework, gdy są dostępne (domyślnie włączone). @@ -5549,7 +5549,7 @@ Deterministic builds only support portable PDBs (--debug:portable or --debug:embedded) - Kompilacje deterministyczne obsługują tylko przenośne pliki PDB (--debug:portable lub --debug:embedded) + Deterministyczne kompilacje obsługują tylko przenośne pliki PDB (--debug:portable lub --debug:embedded) @@ -7164,17 +7164,17 @@ Maps physical paths to source path names output by the compiler - Maps physical paths to source path names output by the compiler + Mapuje ścieżki fizyczne na wyjściowe nazwy ścieżek źródłowych z kompilatora --pathmap can only be used with portable PDBs (--debug:portable or --debug:embedded) - --pathmap can only be used with portable PDBs (--debug:portable or --debug:embedded) + Argumentu --pathmap można używać tylko z przenośnymi plikami PDB (--debug:portable lub --debug:embedded) Invalid path map. Mappings must be comma separated and of the format 'path=sourcePath' - Invalid path map. Mappings must be comma separated and of the format 'path=sourcePath' + Nieprawidłowe mapowanie ścieżek. Mapowania muszą być rozdzielone przecinkami i mieć format „path=sourcePath” diff --git a/src/fsharp/xlf/FSComp.txt.pt-BR.xlf b/src/fsharp/xlf/FSComp.txt.pt-BR.xlf index 39537bc8cde..52c5bab6c96 100644 --- a/src/fsharp/xlf/FSComp.txt.pt-BR.xlf +++ b/src/fsharp/xlf/FSComp.txt.pt-BR.xlf @@ -4,7 +4,7 @@ {0} for F# {1} - {0} for F# {1} + {0} para F# {1} @@ -144,7 +144,7 @@ Use reference assemblies for .NET framework references when available (Enabled by default). - Use reference assemblies for .NET framework references when available (Enabled by default). + Use assemblies de referência para referências do .NET Framework quando disponível (habilitado por padrão). @@ -5549,7 +5549,7 @@ Deterministic builds only support portable PDBs (--debug:portable or --debug:embedded) - Compilações determinísticas dão suporte somente a PDBs portáteis (--debug:portable ou --debug:embedded) + Os builds determinísticos oferecem suporte apenas para PDBs portáteis (--debug:portable ou --debug:embedded) @@ -7164,17 +7164,17 @@ Maps physical paths to source path names output by the compiler - Maps physical paths to source path names output by the compiler + Mapeia caminhos físicos para nomes de caminho de origem gerados pelo compilador --pathmap can only be used with portable PDBs (--debug:portable or --debug:embedded) - --pathmap can only be used with portable PDBs (--debug:portable or --debug:embedded) + --pathmap só pode ser usado com PDBs portáteis (--debug:portable ou --debug:embedded) Invalid path map. Mappings must be comma separated and of the format 'path=sourcePath' - Invalid path map. Mappings must be comma separated and of the format 'path=sourcePath' + Mapa de caminho inválido. Os mapeamentos devem ser separados por vírgulas e do formato 'path=sourcePath' diff --git a/src/fsharp/xlf/FSComp.txt.ru.xlf b/src/fsharp/xlf/FSComp.txt.ru.xlf index fcd4c723f70..a6a4d1171d7 100644 --- a/src/fsharp/xlf/FSComp.txt.ru.xlf +++ b/src/fsharp/xlf/FSComp.txt.ru.xlf @@ -4,7 +4,7 @@ {0} for F# {1} - {0} for F# {1} + {0} для F# {1} @@ -144,7 +144,7 @@ Use reference assemblies for .NET framework references when available (Enabled by default). - Use reference assemblies for .NET framework references when available (Enabled by default). + Использовать базовые сборки для ссылок на платформу .NET, если базовые сборки доступны (включено по умолчанию). @@ -5549,7 +5549,7 @@ Deterministic builds only support portable PDBs (--debug:portable or --debug:embedded) - Детерминированные сборки поддерживают только переносимые PDB-файлы (--debug:portable или --debug:embedded) + Детерминированные сборки поддерживают только переносимые PDB-файлы (--debug:portable или --debug:embedded) @@ -7164,17 +7164,17 @@ Maps physical paths to source path names output by the compiler - Maps physical paths to source path names output by the compiler + Сопоставляет физические пути с исходными путями в выходных данных компилятора --pathmap can only be used with portable PDBs (--debug:portable or --debug:embedded) - --pathmap can only be used with portable PDBs (--debug:portable or --debug:embedded) + Параметр --pathmap может использоваться только с переносимыми PDB-файлами (--debug:portable или --debug:embedded) Invalid path map. Mappings must be comma separated and of the format 'path=sourcePath' - Invalid path map. Mappings must be comma separated and of the format 'path=sourcePath' + Недействительная карта путей. Сопоставления должны быть разделены запятыми и должны иметь формат "path=исходный_путь" diff --git a/src/fsharp/xlf/FSComp.txt.tr.xlf b/src/fsharp/xlf/FSComp.txt.tr.xlf index 80929708832..ceb68b2207b 100644 --- a/src/fsharp/xlf/FSComp.txt.tr.xlf +++ b/src/fsharp/xlf/FSComp.txt.tr.xlf @@ -4,7 +4,7 @@ {0} for F# {1} - {0} for F# {1} + F# {1} için {0} @@ -144,7 +144,7 @@ Use reference assemblies for .NET framework references when available (Enabled by default). - Use reference assemblies for .NET framework references when available (Enabled by default). + Kullanılabilir olduğunda, .NET Framework başvuruları için başvuru bütünleştirilmiş kodlarını kullanın (Varsayılan olarak etkindir). @@ -5549,7 +5549,7 @@ Deterministic builds only support portable PDBs (--debug:portable or --debug:embedded) - Belirleyici derlemeler yalnızca taşınabilir PDB'leri (--debug:portable veya --debug:embedded) destekler + Belirlenimci derlemeler yalnızca taşınabilir PDB'leri (--debug:portable veya --debug:embedded) destekler @@ -7164,17 +7164,17 @@ Maps physical paths to source path names output by the compiler - Maps physical paths to source path names output by the compiler + Fiziksel yolları derleyiciye göre kaynak yol adları çıkışıyla eşler --pathmap can only be used with portable PDBs (--debug:portable or --debug:embedded) - --pathmap can only be used with portable PDBs (--debug:portable or --debug:embedded) + --pathmap yalnızca taşınabilir PDB'ler (--debug:portable veya --debug:embedded) ile kullanılabilir Invalid path map. Mappings must be comma separated and of the format 'path=sourcePath' - Invalid path map. Mappings must be comma separated and of the format 'path=sourcePath' + Geçersiz yol eşlemesi. Eşlemeler virgülle ayrılmış ve 'path=sourcePath' biçiminde olmalıdır diff --git a/src/fsharp/xlf/FSComp.txt.zh-Hans.xlf b/src/fsharp/xlf/FSComp.txt.zh-Hans.xlf index 1a7945d7124..a1a162e0a1a 100644 --- a/src/fsharp/xlf/FSComp.txt.zh-Hans.xlf +++ b/src/fsharp/xlf/FSComp.txt.zh-Hans.xlf @@ -4,7 +4,7 @@ {0} for F# {1} - {0} for F# {1} + F# {1} 的 {0} @@ -144,7 +144,7 @@ Use reference assemblies for .NET framework references when available (Enabled by default). - Use reference assemblies for .NET framework references when available (Enabled by default). + 如果可用,请对 .NET Framework 引用使用引用程序集(默认启用)。 @@ -5549,7 +5549,7 @@ Deterministic builds only support portable PDBs (--debug:portable or --debug:embedded) - 确定性的生成仅支持可移植 PDB (--debug:portable 或 --debug:embedded) + 决定性生成仅支持可移植的 PDB (--debug:portable 或 --debug:embedded) @@ -7164,17 +7164,17 @@ Maps physical paths to source path names output by the compiler - Maps physical paths to source path names output by the compiler + 将物理路径映射到编译器输出的源路径名 --pathmap can only be used with portable PDBs (--debug:portable or --debug:embedded) - --pathmap can only be used with portable PDBs (--debug:portable or --debug:embedded) + --pathmap 只能与可移植的 PDB 一起使用(--debug:portable 或 --debug:embedded) Invalid path map. Mappings must be comma separated and of the format 'path=sourcePath' - Invalid path map. Mappings must be comma separated and of the format 'path=sourcePath' + 路径映射无效。映射必须以逗号分隔,且采用 "path=sourcePath" 格式 diff --git a/src/fsharp/xlf/FSComp.txt.zh-Hant.xlf b/src/fsharp/xlf/FSComp.txt.zh-Hant.xlf index 0f67d46dbc2..e2c21c864b5 100644 --- a/src/fsharp/xlf/FSComp.txt.zh-Hant.xlf +++ b/src/fsharp/xlf/FSComp.txt.zh-Hant.xlf @@ -4,7 +4,7 @@ {0} for F# {1} - {0} for F# {1} + F # {1} 的 {0} @@ -144,7 +144,7 @@ Use reference assemblies for .NET framework references when available (Enabled by default). - Use reference assemblies for .NET framework references when available (Enabled by default). + 請在可行的情況下使用適用於 .NET 架構參考的參考組件 (預設會啟用)。 @@ -5549,7 +5549,7 @@ Deterministic builds only support portable PDBs (--debug:portable or --debug:embedded) - 確定性組建僅支援可攜式 PDB (--debug:portable 或 --debug:embedded) + 確定性組建僅支援可攜式 PDB (--debug:portable 或 --debug:embedded) @@ -7164,17 +7164,17 @@ Maps physical paths to source path names output by the compiler - Maps physical paths to source path names output by the compiler + 將實體路徑對應至來源路徑名稱,由編譯器輸出 --pathmap can only be used with portable PDBs (--debug:portable or --debug:embedded) - --pathmap can only be used with portable PDBs (--debug:portable or --debug:embedded) + --pathmap 只能搭配可攜式 PDB 使用 (--debug:portable 或 --debug:embedded) Invalid path map. Mappings must be comma separated and of the format 'path=sourcePath' - Invalid path map. Mappings must be comma separated and of the format 'path=sourcePath' + 路徑對應無效。對應必須以逗號分隔,且格式應為 'path=sourcePath' diff --git a/vsintegration/src/FSharp.ProjectSystem.PropertyPages/Resources/xlf/Microsoft.VisualStudio.Editors.Designer.cs.xlf b/vsintegration/src/FSharp.ProjectSystem.PropertyPages/Resources/xlf/Microsoft.VisualStudio.Editors.Designer.cs.xlf index 860555f3440..a678a4bcfeb 100644 --- a/vsintegration/src/FSharp.ProjectSystem.PropertyPages/Resources/xlf/Microsoft.VisualStudio.Editors.Designer.cs.xlf +++ b/vsintegration/src/FSharp.ProjectSystem.PropertyPages/Resources/xlf/Microsoft.VisualStudio.Editors.Designer.cs.xlf @@ -1828,9 +1828,8 @@ CONSIDER: get this from CodeDom {0} x {1} - {0} x {1} + {0} x {1} Format string for showing a graphic's size - # {0} = width (as an integer) # {1} = height (as an integer) #Example, for a bitmap of width=123, height = 456, the English version of this string would be "123x456" diff --git a/vsintegration/src/FSharp.ProjectSystem.PropertyPages/Resources/xlf/Microsoft.VisualStudio.Editors.Designer.de.xlf b/vsintegration/src/FSharp.ProjectSystem.PropertyPages/Resources/xlf/Microsoft.VisualStudio.Editors.Designer.de.xlf index 65b4328fdc2..662133483e3 100644 --- a/vsintegration/src/FSharp.ProjectSystem.PropertyPages/Resources/xlf/Microsoft.VisualStudio.Editors.Designer.de.xlf +++ b/vsintegration/src/FSharp.ProjectSystem.PropertyPages/Resources/xlf/Microsoft.VisualStudio.Editors.Designer.de.xlf @@ -1828,9 +1828,8 @@ CONSIDER: get this from CodeDom {0} x {1} - {0} x {1} + {0} x {1} Format string for showing a graphic's size - # {0} = width (as an integer) # {1} = height (as an integer) #Example, for a bitmap of width=123, height = 456, the English version of this string would be "123x456" diff --git a/vsintegration/src/FSharp.ProjectSystem.PropertyPages/Resources/xlf/Microsoft.VisualStudio.Editors.Designer.es.xlf b/vsintegration/src/FSharp.ProjectSystem.PropertyPages/Resources/xlf/Microsoft.VisualStudio.Editors.Designer.es.xlf index 1153755c3dd..41dbc88f0bd 100644 --- a/vsintegration/src/FSharp.ProjectSystem.PropertyPages/Resources/xlf/Microsoft.VisualStudio.Editors.Designer.es.xlf +++ b/vsintegration/src/FSharp.ProjectSystem.PropertyPages/Resources/xlf/Microsoft.VisualStudio.Editors.Designer.es.xlf @@ -1828,9 +1828,8 @@ CONSIDER: get this from CodeDom {0} x {1} - {0} x {1} + {0} x {1} Format string for showing a graphic's size - # {0} = width (as an integer) # {1} = height (as an integer) #Example, for a bitmap of width=123, height = 456, the English version of this string would be "123x456" diff --git a/vsintegration/src/FSharp.ProjectSystem.PropertyPages/Resources/xlf/Microsoft.VisualStudio.Editors.Designer.fr.xlf b/vsintegration/src/FSharp.ProjectSystem.PropertyPages/Resources/xlf/Microsoft.VisualStudio.Editors.Designer.fr.xlf index cd60e9f07e9..0f1e16e95f2 100644 --- a/vsintegration/src/FSharp.ProjectSystem.PropertyPages/Resources/xlf/Microsoft.VisualStudio.Editors.Designer.fr.xlf +++ b/vsintegration/src/FSharp.ProjectSystem.PropertyPages/Resources/xlf/Microsoft.VisualStudio.Editors.Designer.fr.xlf @@ -1828,9 +1828,8 @@ CONSIDER: get this from CodeDom {0} x {1} - {0} x {1} + {0} x {1} Format string for showing a graphic's size - # {0} = width (as an integer) # {1} = height (as an integer) #Example, for a bitmap of width=123, height = 456, the English version of this string would be "123x456" diff --git a/vsintegration/src/FSharp.ProjectSystem.PropertyPages/Resources/xlf/Microsoft.VisualStudio.Editors.Designer.it.xlf b/vsintegration/src/FSharp.ProjectSystem.PropertyPages/Resources/xlf/Microsoft.VisualStudio.Editors.Designer.it.xlf index dd58cb9a119..8902030751c 100644 --- a/vsintegration/src/FSharp.ProjectSystem.PropertyPages/Resources/xlf/Microsoft.VisualStudio.Editors.Designer.it.xlf +++ b/vsintegration/src/FSharp.ProjectSystem.PropertyPages/Resources/xlf/Microsoft.VisualStudio.Editors.Designer.it.xlf @@ -1828,9 +1828,8 @@ CONSIDER: get this from CodeDom {0} x {1} - {0} x {1} + {0} x {1} Format string for showing a graphic's size - # {0} = width (as an integer) # {1} = height (as an integer) #Example, for a bitmap of width=123, height = 456, the English version of this string would be "123x456" diff --git a/vsintegration/src/FSharp.ProjectSystem.PropertyPages/Resources/xlf/Microsoft.VisualStudio.Editors.Designer.ja.xlf b/vsintegration/src/FSharp.ProjectSystem.PropertyPages/Resources/xlf/Microsoft.VisualStudio.Editors.Designer.ja.xlf index bdb896a5c83..a39e49dfa0d 100644 --- a/vsintegration/src/FSharp.ProjectSystem.PropertyPages/Resources/xlf/Microsoft.VisualStudio.Editors.Designer.ja.xlf +++ b/vsintegration/src/FSharp.ProjectSystem.PropertyPages/Resources/xlf/Microsoft.VisualStudio.Editors.Designer.ja.xlf @@ -1828,9 +1828,8 @@ CONSIDER: get this from CodeDom {0} x {1} - {0} x {1} + {0} x {1} Format string for showing a graphic's size - # {0} = width (as an integer) # {1} = height (as an integer) #Example, for a bitmap of width=123, height = 456, the English version of this string would be "123x456" diff --git a/vsintegration/src/FSharp.ProjectSystem.PropertyPages/Resources/xlf/Microsoft.VisualStudio.Editors.Designer.ko.xlf b/vsintegration/src/FSharp.ProjectSystem.PropertyPages/Resources/xlf/Microsoft.VisualStudio.Editors.Designer.ko.xlf index 6f540b54250..e7191ac3c4a 100644 --- a/vsintegration/src/FSharp.ProjectSystem.PropertyPages/Resources/xlf/Microsoft.VisualStudio.Editors.Designer.ko.xlf +++ b/vsintegration/src/FSharp.ProjectSystem.PropertyPages/Resources/xlf/Microsoft.VisualStudio.Editors.Designer.ko.xlf @@ -1828,9 +1828,8 @@ CONSIDER: get this from CodeDom {0} x {1} - {0} x {1} + {0} x {1} Format string for showing a graphic's size - # {0} = width (as an integer) # {1} = height (as an integer) #Example, for a bitmap of width=123, height = 456, the English version of this string would be "123x456" diff --git a/vsintegration/src/FSharp.ProjectSystem.PropertyPages/Resources/xlf/Microsoft.VisualStudio.Editors.Designer.pl.xlf b/vsintegration/src/FSharp.ProjectSystem.PropertyPages/Resources/xlf/Microsoft.VisualStudio.Editors.Designer.pl.xlf index 73bef853b9f..d0675bd2fcb 100644 --- a/vsintegration/src/FSharp.ProjectSystem.PropertyPages/Resources/xlf/Microsoft.VisualStudio.Editors.Designer.pl.xlf +++ b/vsintegration/src/FSharp.ProjectSystem.PropertyPages/Resources/xlf/Microsoft.VisualStudio.Editors.Designer.pl.xlf @@ -1828,9 +1828,8 @@ CONSIDER: get this from CodeDom {0} x {1} - {0} x {1} + {0} x {1} Format string for showing a graphic's size - # {0} = width (as an integer) # {1} = height (as an integer) #Example, for a bitmap of width=123, height = 456, the English version of this string would be "123x456" diff --git a/vsintegration/src/FSharp.ProjectSystem.PropertyPages/Resources/xlf/Microsoft.VisualStudio.Editors.Designer.pt-BR.xlf b/vsintegration/src/FSharp.ProjectSystem.PropertyPages/Resources/xlf/Microsoft.VisualStudio.Editors.Designer.pt-BR.xlf index 3e8a1693485..acfade88845 100644 --- a/vsintegration/src/FSharp.ProjectSystem.PropertyPages/Resources/xlf/Microsoft.VisualStudio.Editors.Designer.pt-BR.xlf +++ b/vsintegration/src/FSharp.ProjectSystem.PropertyPages/Resources/xlf/Microsoft.VisualStudio.Editors.Designer.pt-BR.xlf @@ -1828,9 +1828,8 @@ CONSIDER: get this from CodeDom {0} x {1} - {0} x {1} + {0} x {1} Format string for showing a graphic's size - # {0} = width (as an integer) # {1} = height (as an integer) #Example, for a bitmap of width=123, height = 456, the English version of this string would be "123x456" diff --git a/vsintegration/src/FSharp.ProjectSystem.PropertyPages/Resources/xlf/Microsoft.VisualStudio.Editors.Designer.ru.xlf b/vsintegration/src/FSharp.ProjectSystem.PropertyPages/Resources/xlf/Microsoft.VisualStudio.Editors.Designer.ru.xlf index 2b5303d91de..355d363084e 100644 --- a/vsintegration/src/FSharp.ProjectSystem.PropertyPages/Resources/xlf/Microsoft.VisualStudio.Editors.Designer.ru.xlf +++ b/vsintegration/src/FSharp.ProjectSystem.PropertyPages/Resources/xlf/Microsoft.VisualStudio.Editors.Designer.ru.xlf @@ -1828,9 +1828,8 @@ CONSIDER: get this from CodeDom {0} x {1} - {0} x {1} + {0} x {1} Format string for showing a graphic's size - # {0} = width (as an integer) # {1} = height (as an integer) #Example, for a bitmap of width=123, height = 456, the English version of this string would be "123x456" diff --git a/vsintegration/src/FSharp.ProjectSystem.PropertyPages/Resources/xlf/Microsoft.VisualStudio.Editors.Designer.tr.xlf b/vsintegration/src/FSharp.ProjectSystem.PropertyPages/Resources/xlf/Microsoft.VisualStudio.Editors.Designer.tr.xlf index 73a72b806a2..86ac32f4b37 100644 --- a/vsintegration/src/FSharp.ProjectSystem.PropertyPages/Resources/xlf/Microsoft.VisualStudio.Editors.Designer.tr.xlf +++ b/vsintegration/src/FSharp.ProjectSystem.PropertyPages/Resources/xlf/Microsoft.VisualStudio.Editors.Designer.tr.xlf @@ -1828,9 +1828,8 @@ CONSIDER: get this from CodeDom {0} x {1} - {0} x {1} + {0} x {1} Format string for showing a graphic's size - # {0} = width (as an integer) # {1} = height (as an integer) #Example, for a bitmap of width=123, height = 456, the English version of this string would be "123x456" diff --git a/vsintegration/src/FSharp.ProjectSystem.PropertyPages/Resources/xlf/Microsoft.VisualStudio.Editors.Designer.zh-Hans.xlf b/vsintegration/src/FSharp.ProjectSystem.PropertyPages/Resources/xlf/Microsoft.VisualStudio.Editors.Designer.zh-Hans.xlf index 474f99a3dcd..0537632d5fc 100644 --- a/vsintegration/src/FSharp.ProjectSystem.PropertyPages/Resources/xlf/Microsoft.VisualStudio.Editors.Designer.zh-Hans.xlf +++ b/vsintegration/src/FSharp.ProjectSystem.PropertyPages/Resources/xlf/Microsoft.VisualStudio.Editors.Designer.zh-Hans.xlf @@ -1828,9 +1828,8 @@ CONSIDER: get this from CodeDom {0} x {1} - {0} x {1} + {0} x {1} Format string for showing a graphic's size - # {0} = width (as an integer) # {1} = height (as an integer) #Example, for a bitmap of width=123, height = 456, the English version of this string would be "123x456" diff --git a/vsintegration/src/FSharp.ProjectSystem.PropertyPages/Resources/xlf/Microsoft.VisualStudio.Editors.Designer.zh-Hant.xlf b/vsintegration/src/FSharp.ProjectSystem.PropertyPages/Resources/xlf/Microsoft.VisualStudio.Editors.Designer.zh-Hant.xlf index 16b7339b2a4..17c64ffefb9 100644 --- a/vsintegration/src/FSharp.ProjectSystem.PropertyPages/Resources/xlf/Microsoft.VisualStudio.Editors.Designer.zh-Hant.xlf +++ b/vsintegration/src/FSharp.ProjectSystem.PropertyPages/Resources/xlf/Microsoft.VisualStudio.Editors.Designer.zh-Hant.xlf @@ -1828,9 +1828,8 @@ CONSIDER: get this from CodeDom {0} x {1} - {0} x {1} + {0} x {1} Format string for showing a graphic's size - # {0} = width (as an integer) # {1} = height (as an integer) #Example, for a bitmap of width=123, height = 456, the English version of this string would be "123x456" diff --git a/vsintegration/src/FSharp.UIResources/xlf/Strings.cs.xlf b/vsintegration/src/FSharp.UIResources/xlf/Strings.cs.xlf index 9da4f3c87aa..973cdbd6e91 100644 --- a/vsintegration/src/FSharp.UIResources/xlf/Strings.cs.xlf +++ b/vsintegration/src/FSharp.UIResources/xlf/Strings.cs.xlf @@ -104,7 +104,7 @@ Text hover - Text hover + Přechod myší nad textem @@ -199,7 +199,7 @@ (Preview) Use out of process language server - (Preview) Use out of process language server + (Preview) Použít mimoprocesový jazykový server diff --git a/vsintegration/src/FSharp.UIResources/xlf/Strings.de.xlf b/vsintegration/src/FSharp.UIResources/xlf/Strings.de.xlf index 594bdd6a66d..c2defd7c40c 100644 --- a/vsintegration/src/FSharp.UIResources/xlf/Strings.de.xlf +++ b/vsintegration/src/FSharp.UIResources/xlf/Strings.de.xlf @@ -104,7 +104,7 @@ Text hover - Text hover + Texthover @@ -199,7 +199,7 @@ (Preview) Use out of process language server - (Preview) Use out of process language server + (Vorschauversion) Prozessexternen Sprachserver verwenden diff --git a/vsintegration/src/FSharp.UIResources/xlf/Strings.es.xlf b/vsintegration/src/FSharp.UIResources/xlf/Strings.es.xlf index 0dd79115a6d..2b0507a438e 100644 --- a/vsintegration/src/FSharp.UIResources/xlf/Strings.es.xlf +++ b/vsintegration/src/FSharp.UIResources/xlf/Strings.es.xlf @@ -104,7 +104,7 @@ Text hover - Text hover + Texto al pasar el puntero @@ -199,7 +199,7 @@ (Preview) Use out of process language server - (Preview) Use out of process language server + (Versión preliminar) Usar el servidor de lenguaje fuera del proceso diff --git a/vsintegration/src/FSharp.UIResources/xlf/Strings.fr.xlf b/vsintegration/src/FSharp.UIResources/xlf/Strings.fr.xlf index 6cd63471707..423d9c97c81 100644 --- a/vsintegration/src/FSharp.UIResources/xlf/Strings.fr.xlf +++ b/vsintegration/src/FSharp.UIResources/xlf/Strings.fr.xlf @@ -104,7 +104,7 @@ Text hover - Text hover + Survol du texte @@ -199,7 +199,7 @@ (Preview) Use out of process language server - (Preview) Use out of process language server + (Préversion) Utiliser un serveur de langage hors processus diff --git a/vsintegration/src/FSharp.UIResources/xlf/Strings.it.xlf b/vsintegration/src/FSharp.UIResources/xlf/Strings.it.xlf index a053b865918..a577a1e315c 100644 --- a/vsintegration/src/FSharp.UIResources/xlf/Strings.it.xlf +++ b/vsintegration/src/FSharp.UIResources/xlf/Strings.it.xlf @@ -104,7 +104,7 @@ Text hover - Text hover + Passaggio del puntatore sul testo @@ -199,7 +199,7 @@ (Preview) Use out of process language server - (Preview) Use out of process language server + (Anteprima) Usa server di linguaggio out-of-process diff --git a/vsintegration/src/FSharp.UIResources/xlf/Strings.ja.xlf b/vsintegration/src/FSharp.UIResources/xlf/Strings.ja.xlf index 444ceb8b6da..de08a58854b 100644 --- a/vsintegration/src/FSharp.UIResources/xlf/Strings.ja.xlf +++ b/vsintegration/src/FSharp.UIResources/xlf/Strings.ja.xlf @@ -104,7 +104,7 @@ Text hover - Text hover + テキスト ホバー @@ -199,7 +199,7 @@ (Preview) Use out of process language server - (Preview) Use out of process language server + (プレビュー) プロセス外言語サーバーの使用 diff --git a/vsintegration/src/FSharp.UIResources/xlf/Strings.ko.xlf b/vsintegration/src/FSharp.UIResources/xlf/Strings.ko.xlf index b8b14271ac4..0651ce96fa7 100644 --- a/vsintegration/src/FSharp.UIResources/xlf/Strings.ko.xlf +++ b/vsintegration/src/FSharp.UIResources/xlf/Strings.ko.xlf @@ -104,7 +104,7 @@ Text hover - Text hover + 텍스트 호버 @@ -199,7 +199,7 @@ (Preview) Use out of process language server - (Preview) Use out of process language server + (미리 보기) Out of Process 언어 서버 사용 diff --git a/vsintegration/src/FSharp.UIResources/xlf/Strings.pl.xlf b/vsintegration/src/FSharp.UIResources/xlf/Strings.pl.xlf index e0f43b53d9f..1c6085f8566 100644 --- a/vsintegration/src/FSharp.UIResources/xlf/Strings.pl.xlf +++ b/vsintegration/src/FSharp.UIResources/xlf/Strings.pl.xlf @@ -104,7 +104,7 @@ Text hover - Text hover + Najechanie kursorem na tekst @@ -199,7 +199,7 @@ (Preview) Use out of process language server - (Preview) Use out of process language server + (Wersja zapoznawcza) Korzystanie z serwera języka poza procesem diff --git a/vsintegration/src/FSharp.UIResources/xlf/Strings.pt-BR.xlf b/vsintegration/src/FSharp.UIResources/xlf/Strings.pt-BR.xlf index a23bcaf79d0..2fca2b08f6b 100644 --- a/vsintegration/src/FSharp.UIResources/xlf/Strings.pt-BR.xlf +++ b/vsintegration/src/FSharp.UIResources/xlf/Strings.pt-BR.xlf @@ -104,7 +104,7 @@ Text hover - Text hover + Foco do texto @@ -199,7 +199,7 @@ (Preview) Use out of process language server - (Preview) Use out of process language server + (Versão Prévia) Usar um servidor de idioma fora do processo diff --git a/vsintegration/src/FSharp.UIResources/xlf/Strings.ru.xlf b/vsintegration/src/FSharp.UIResources/xlf/Strings.ru.xlf index 8a8a30892ff..de853464359 100644 --- a/vsintegration/src/FSharp.UIResources/xlf/Strings.ru.xlf +++ b/vsintegration/src/FSharp.UIResources/xlf/Strings.ru.xlf @@ -104,7 +104,7 @@ Text hover - Text hover + Текст, отображаемый при наведении @@ -199,7 +199,7 @@ (Preview) Use out of process language server - (Preview) Use out of process language server + (Предварительная версия) Использование сервера языка процессов diff --git a/vsintegration/src/FSharp.UIResources/xlf/Strings.tr.xlf b/vsintegration/src/FSharp.UIResources/xlf/Strings.tr.xlf index 228bd69b6c7..dd44a1a1b41 100644 --- a/vsintegration/src/FSharp.UIResources/xlf/Strings.tr.xlf +++ b/vsintegration/src/FSharp.UIResources/xlf/Strings.tr.xlf @@ -104,7 +104,7 @@ Text hover - Text hover + Metni vurgulama @@ -199,7 +199,7 @@ (Preview) Use out of process language server - (Preview) Use out of process language server + (Önizleme) İşlem dışı dil sunucusunu kullanma diff --git a/vsintegration/src/FSharp.UIResources/xlf/Strings.zh-Hans.xlf b/vsintegration/src/FSharp.UIResources/xlf/Strings.zh-Hans.xlf index 0db63d7df1f..ba5c37bf74b 100644 --- a/vsintegration/src/FSharp.UIResources/xlf/Strings.zh-Hans.xlf +++ b/vsintegration/src/FSharp.UIResources/xlf/Strings.zh-Hans.xlf @@ -104,7 +104,7 @@ Text hover - Text hover + 文本悬停 @@ -199,7 +199,7 @@ (Preview) Use out of process language server - (Preview) Use out of process language server + (预览)使用进程外语言服务器 diff --git a/vsintegration/src/FSharp.UIResources/xlf/Strings.zh-Hant.xlf b/vsintegration/src/FSharp.UIResources/xlf/Strings.zh-Hant.xlf index ea7c015a9d8..db714fc7bc2 100644 --- a/vsintegration/src/FSharp.UIResources/xlf/Strings.zh-Hant.xlf +++ b/vsintegration/src/FSharp.UIResources/xlf/Strings.zh-Hant.xlf @@ -104,7 +104,7 @@ Text hover - Text hover + 文字暫留 @@ -199,7 +199,7 @@ (Preview) Use out of process language server - (Preview) Use out of process language server + (預覽) 使用處理序語言伺服器