Skip to content

Commit

Permalink
Use GetFullPath when determining the full path in handling command li…
Browse files Browse the repository at this point in the history
…ne options (#7376)
  • Loading branch information
cartermp authored Aug 9, 2019
1 parent 0353825 commit 3cdc94f
Showing 1 changed file with 9 additions and 5 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -378,11 +378,15 @@ type internal FSharpProjectOptionsManager
match Microsoft.CodeAnalysis.ExternalAccess.FSharp.LanguageServices.FSharpVisualStudioWorkspaceExtensions.TryGetProjectIdByBinPath(workspace, path) with
| true, projectId -> projectId
| false, _ -> Microsoft.CodeAnalysis.ExternalAccess.FSharp.LanguageServices.FSharpVisualStudioWorkspaceExtensions.GetOrCreateProjectIdForPath(workspace, path, projectDisplayNameOf path)
let path = Microsoft.CodeAnalysis.ExternalAccess.FSharp.LanguageServices.FSharpVisualStudioWorkspaceExtensions.GetProjectFilePath(workspace, projectId);
let fullPath 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 path = Microsoft.CodeAnalysis.ExternalAccess.FSharp.LanguageServices.FSharpVisualStudioWorkspaceExtensions.GetProjectFilePath(workspace, projectId)

let getFullPath p =
let p' =
if Path.IsPathRooted(p) || path = null then p
else Path.Combine(Path.GetDirectoryName(path), p)
Path.GetFullPathSafe(p')

let sourcePaths = sources |> Seq.map(fun s -> getFullPath s.Path) |> Seq.toArray

reactor.SetCpsCommandLineOptions(projectId, sourcePaths, options.ToArray())

Expand Down

0 comments on commit 3cdc94f

Please sign in to comment.