From 216dca99b1f9bba533f9e1f79891ef6c850672bb Mon Sep 17 00:00:00 2001 From: Kevin Ransom Date: Wed, 27 Sep 2017 01:17:09 -0700 Subject: [PATCH] Comment out project updated and removed events because of AVs --- the AVs will need fixing --- .../LanguageService/LanguageService.fs | 35 ++++++++++--------- .../ProjectSitesAndFiles.fs | 2 +- 2 files changed, 20 insertions(+), 17 deletions(-) diff --git a/vsintegration/src/FSharp.Editor/LanguageService/LanguageService.fs b/vsintegration/src/FSharp.Editor/LanguageService/LanguageService.fs index 5087264c92b..c79245b1185 100644 --- a/vsintegration/src/FSharp.Editor/LanguageService/LanguageService.fs +++ b/vsintegration/src/FSharp.Editor/LanguageService/LanguageService.fs @@ -183,18 +183,21 @@ type internal FSharpProjectOptionsManager match projectTable.TryGetValue(projectId) with | true, ((_referencedProjects, options), _) -> let (sourcePaths,_,otherOptions) = this.CommandLineOptions.GetOptionsWithProjectId(projectId) - Some { ProjectFileName = options.ProjectFileName - SourceFiles = if sourcePaths.Length = 0 then options.SourceFiles else sourcePaths - OtherOptions = if otherOptions.Length = 0 then options.OtherOptions else otherOptions - ReferencedProjects = options.ReferencedProjects - IsIncompleteTypeCheckEnvironment = options.IsIncompleteTypeCheckEnvironment - UseScriptResolutionRules = options.UseScriptResolutionRules - LoadTime = options.LoadTime - UnresolvedReferences = options.UnresolvedReferences - OriginalLoadReferences = options.OriginalLoadReferences - ExtraProjectInfo = options.ExtraProjectInfo - Stamp = options.Stamp - } + if sourcePaths.Length = 0 || otherOptions.Length = 0 then + Some options + else + Some { ProjectFileName = options.ProjectFileName + SourceFiles = if sourcePaths.Length = 0 then options.SourceFiles else sourcePaths + OtherOptions = if otherOptions.Length = 0 then options.OtherOptions else otherOptions + ReferencedProjects = options.ReferencedProjects + IsIncompleteTypeCheckEnvironment = options.IsIncompleteTypeCheckEnvironment + UseScriptResolutionRules = options.UseScriptResolutionRules + LoadTime = options.LoadTime + UnresolvedReferences = options.UnresolvedReferences + OriginalLoadReferences = options.OriginalLoadReferences + ExtraProjectInfo = options.ExtraProjectInfo + Stamp = options.Stamp + } | _ -> None /// Get the exact options for a document or project @@ -374,10 +377,10 @@ type let workspaceChanged (args:WorkspaceChangeEventArgs) = match args.Kind with - | WorkspaceChangeKind.ProjectAdded -> this.OnProjectAdded(args.ProjectId, args.NewSolution) - | WorkspaceChangeKind.ProjectChanged -> this.OnProjectChanged(args.ProjectId, args.NewSolution) - | WorkspaceChangeKind.ProjectReloaded -> this.OnProjectReloaded(args.ProjectId, args.NewSolution) - | WorkspaceChangeKind.ProjectRemoved -> this.OnProjectRemoved(args.ProjectId, args.NewSolution) + | WorkspaceChangeKind.ProjectAdded -> this.OnProjectAdded(args.ProjectId, args.NewSolution) + | WorkspaceChangeKind.ProjectChanged -> this.OnProjectChanged(args.ProjectId, args.NewSolution) + | WorkspaceChangeKind.ProjectReloaded -> this.OnProjectReloaded(args.ProjectId, args.NewSolution) +// | WorkspaceChangeKind.ProjectRemoved -> this.OnProjectRemoved(args.ProjectId, args.NewSolution) | _ -> () this.Workspace.Options <- this.Workspace.Options.WithChangedOption(Completion.CompletionOptions.BlockForCompletionItems, FSharpConstants.FSharpLanguageName, false) diff --git a/vsintegration/src/FSharp.LanguageService/ProjectSitesAndFiles.fs b/vsintegration/src/FSharp.LanguageService/ProjectSitesAndFiles.fs index 3c84eaecaaa..0c4e0cf5088 100644 --- a/vsintegration/src/FSharp.LanguageService/ProjectSitesAndFiles.fs +++ b/vsintegration/src/FSharp.LanguageService/ProjectSitesAndFiles.fs @@ -123,7 +123,7 @@ type CommandLineOptions (isEmpty:bool) = | _ -> [||], [||], [||] member this.SetOptionsWithProjectId(projectId:ProjectId, sourcePaths:string[], referencePaths:string[], options:string[]) = - if isEmpty then commandLineOptions.[projectId] <- (sourcePaths, referencePaths, options) + if not isEmpty then commandLineOptions.[projectId] <- (sourcePaths, referencePaths, options) static member Empty with get () = emptyCommandLineOptions.Value