Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 10 additions & 2 deletions vsintegration/src/FSharp.Editor/LanguageService/LanguageService.fs
Original file line number Diff line number Diff line change
Expand Up @@ -226,13 +226,21 @@ type internal FSharpProjectOptionsManager

[<Export>]
/// This handles commandline change notifications from the Dotnet Project-system
/// Prior to VS 15.7 path contained path to project file, post 15.7 contains target binpath
/// binpath is more accurate because a project file can have multiple in memory projects based on configuration
member this.HandleCommandLineChanges(path:string, sources:ImmutableArray<CommandLineSourceFile>, references:ImmutableArray<CommandLineReference>, options:ImmutableArray<string>) =
let projectId =
match workspace.ProjectTracker.TryGetProjectByBinPath(path) with
| true, project -> project.Id
| false, _ -> workspace.ProjectTracker.GetOrCreateProjectIdForPath(path, projectDisplayNameOf path)
let project = workspace.ProjectTracker.GetProject(projectId)
let path = project.ProjectFilePath
let fullPath p =
if Path.IsPathRooted(p) then p
if Path.IsPathRooted(p) || path = null then p
else Path.Combine(Path.GetDirectoryName(path), p)
let sourcePaths = sources |> Seq.map(fun s -> fullPath s.Path) |> Seq.toArray
let referencePaths = references |> Seq.map(fun r -> fullPath r.Reference) |> Seq.toArray
let projectId = workspace.ProjectTracker.GetOrCreateProjectIdForPath(path, projectDisplayNameOf path)

projectOptionsTable.SetOptionsWithProjectId(projectId, sourcePaths, referencePaths, options.ToArray())
this.UpdateProjectInfoWithProjectId(projectId, "HandleCommandLineChanges", invalidateConfig=true)

Expand Down