Skip to content

Commit 3cdc94f

Browse files
authored
Use GetFullPath when determining the full path in handling command line options (#7376)
1 parent 0353825 commit 3cdc94f

File tree

1 file changed

+9
-5
lines changed

1 file changed

+9
-5
lines changed

vsintegration/src/FSharp.Editor/LanguageService/FSharpProjectOptionsManager.fs

+9-5
Original file line numberDiff line numberDiff line change
@@ -378,11 +378,15 @@ type internal FSharpProjectOptionsManager
378378
match Microsoft.CodeAnalysis.ExternalAccess.FSharp.LanguageServices.FSharpVisualStudioWorkspaceExtensions.TryGetProjectIdByBinPath(workspace, path) with
379379
| true, projectId -> projectId
380380
| false, _ -> Microsoft.CodeAnalysis.ExternalAccess.FSharp.LanguageServices.FSharpVisualStudioWorkspaceExtensions.GetOrCreateProjectIdForPath(workspace, path, projectDisplayNameOf path)
381-
let path = Microsoft.CodeAnalysis.ExternalAccess.FSharp.LanguageServices.FSharpVisualStudioWorkspaceExtensions.GetProjectFilePath(workspace, projectId);
382-
let fullPath p =
383-
if Path.IsPathRooted(p) || path = null then p
384-
else Path.Combine(Path.GetDirectoryName(path), p)
385-
let sourcePaths = sources |> Seq.map(fun s -> fullPath s.Path) |> Seq.toArray
381+
let path = Microsoft.CodeAnalysis.ExternalAccess.FSharp.LanguageServices.FSharpVisualStudioWorkspaceExtensions.GetProjectFilePath(workspace, projectId)
382+
383+
let getFullPath p =
384+
let p' =
385+
if Path.IsPathRooted(p) || path = null then p
386+
else Path.Combine(Path.GetDirectoryName(path), p)
387+
Path.GetFullPathSafe(p')
388+
389+
let sourcePaths = sources |> Seq.map(fun s -> getFullPath s.Path) |> Seq.toArray
386390

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

0 commit comments

Comments
 (0)