You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
FSharp.Compiler.Interactive.Settings seemingly not part of script references #7950
@kevmal on the F# foundation slack shared an image of a typecheck error he had in a fsx script. He's on 2019 16.4, and after looking at the DotNetFrameworkDependencies.fs file I think I see what the problem is.
I believe the issue comes from here, where the string "FSharp.Compiler.Interactive.Settings" is passed as one of the dependencies to be resolved by getDependenciesOf. getDependenciesOf has some handling for 'simple names', that is assembly names that are not full file paths: it prepends the framework directory to the simple name and attempts to resolve that reference.
In this case I think this logic is incorrect, because the "FSharp.Compiler.Interactive.Settings" reference is colocated with the compiler, not with the rest of the framework references. I think that in this case, the assembly should be manually resolved by joining the simple name with the already-defined getFSharpCompilerLocation path, which should be correct.
Repro steps
Create an fsx script in VS 2019 16.4
use any member of the fsi binding.
Expected behavior
The fsi binding's members are available in-editor.
Actual behavior
The fsi binding's members are not available.
Known workarounds
The user can always provide an explicit #r reference to the dll, but this is non-portable.
Script files are now missing implicit references to FSharp.Compiler.Interactive.Settings.dll when editing. It also seems impossible to workaround this by adding #r “FSharp.Compiler.Interactive.Settings”
This means simple code like the following now shows red squigglies when editing:
The good thing about this workaround is that it doesn't affect the execution of scripts, though the hard coded path is obviously problematic for editing across teams and for cross-platform scripts.
Activity
dsyme commentedon Dec 13, 2019
As far as I can tell this is a regression in Visual Studio 16.4.1
dsyme commentedon Dec 13, 2019
Script files are now missing implicit references to
FSharp.Compiler.Interactive.Settings.dllwhen editing. It also seems impossible to workaround this by adding#r “FSharp.Compiler.Interactive.Settings”This means simple code like the following now shows red squigglies when editing:
dsyme commentedon Dec 13, 2019
so this is definitely covered by the language service testing, what's happened....
fsharp/vsintegration/tests/UnitTests/LegacyLanguageService/Tests.LanguageService.Script.fs
Line 1162 in 4363f4c
fsharp/vsintegration/tests/UnitTests/LegacyLanguageService/Tests.LanguageService.Script.fs
Line 1179 in 4363f4c
fsharp/vsintegration/tests/UnitTests/LegacyLanguageService/Tests.LanguageService.Script.fs
Line 1203 in 4363f4c
I checked those tests are reported as running and passing:
√ Fsx.Bug2530FsiObject [241ms]
https://dev.azure.com/dnceng/public/_build/results?buildId=455447
So I suppose there's a difference between the setup/references when testing and the actual deployed setup.....
dsyme commentedon Dec 13, 2019
You can workaround this to some extent by the following (adjust the path as necessary)
The good thing about this workaround is that it doesn't affect the execution of scripts, though the hard coded path is obviously problematic for editing across teams and for cross-platform scripts.