From e695f6fc1d5011080c574f5435c71f4b1b1fd312 Mon Sep 17 00:00:00 2001 From: Jimmy Byrd Date: Sat, 20 Aug 2022 07:07:13 -0400 Subject: [PATCH] FIX: Moves NonExistentFile to all project types For some reason in 6.0.400, CoreCompile was not getting executed and therfore we couldn't read the FscCommandLineArgs. Hopefully addresses https://github.com/ionide/ionide-vscode-fsharp/issues/1748 --- global.json | 2 +- src/Ionide.ProjInfo/Library.fs | 4 +--- test/Ionide.ProjInfo.Tests/Tests.fs | 5 +++-- 3 files changed, 5 insertions(+), 6 deletions(-) diff --git a/global.json b/global.json index 807ee97e..07b9742b 100644 --- a/global.json +++ b/global.json @@ -1,6 +1,6 @@ { "sdk": { - "version": "6.0.201", + "version": "6.0.400", "rollForward": "minor" } } \ No newline at end of file diff --git a/src/Ionide.ProjInfo/Library.fs b/src/Ionide.ProjInfo/Library.fs index 87300dca..2742addf 100644 --- a/src/Ionide.ProjInfo/Library.fs +++ b/src/Ionide.ProjInfo/Library.fs @@ -352,14 +352,12 @@ module ProjectLoader = "DefineExplicitDefaults", "true" "BuildProjectReferences", "false" "UseCommonOutputDirectory", "false" + "NonExistentFile", Path.Combine("__NonExistentSubDir__", "__NonExistentFile__") // Required by the Clean Target if tfm.IsSome then "TargetFramework", tfm.Value - if path.EndsWith ".csproj" then - "NonExistentFile", Path.Combine("__NonExistentSubDir__", "__NonExistentFile__") "DotnetProjInfo", "true" yield! globalProperties ] - /// /// These are a list of build targets that are run during a design-time build (mostly). /// The list comes partially from the msbuild docs diff --git a/test/Ionide.ProjInfo.Tests/Tests.fs b/test/Ionide.ProjInfo.Tests/Tests.fs index 8bc2f83e..5e6558ba 100644 --- a/test/Ionide.ProjInfo.Tests/Tests.fs +++ b/test/Ionide.ProjInfo.Tests/Tests.fs @@ -597,7 +597,8 @@ let testRender3 toolsPath workspaceLoader (workspaceFactory: ToolsPath -> IWorks let loader = workspaceFactory toolsPath - let parsed = loader.LoadProjects [ projPath ] |> Seq.toList + let projDir = Path.GetDirectoryName projPath + let parsed = loader.LoadProjects([ projPath ], [], BinaryLogGeneration.Within(DirectoryInfo projDir)) |> Seq.toList let l1Parsed = parsed |> expectFind l1 "the C# lib" @@ -1397,4 +1398,4 @@ let tests toolsPath = testProjectLoadBadData expensiveTests toolsPath WorkspaceLoader.Create csharpLibTest toolsPath WorkspaceLoader.Create - ] + ] \ No newline at end of file