fsprojects / zarchive-sublime-fsharp-package

F# development tools for SublimeText 3
32 stars 7 forks source link

Typecheck does not add project references #78

Open alex-netkachov opened 9 years ago

alex-netkachov commented 9 years ago

I have the Visual Studio F# project that works quite well. So I've tried it with the package and got a few issues:

  1. The typecheck cannot start as the FSharp.Core.dll could not be found in one of ..., "c:\Program Files (x86)\Microsoft SDKs\F#\3.1\Framework\v4.0\". Fixed by copying all files from "c:\Program Files (x86)\Reference Assemblies\Microsoft\FSharp.NETFramework\v4.0\4.3.1.0" to that folder.
  2. Then typecheck complains about unknown namespaces:

    ERROR|TYPECHECK|...File.fs|4|13|The namespace 'ComponentModel' is not defined
    ERROR|TYPECHECK|...File.fs|5|13|The namespace 'Linq' is not defined
    ERROR|TYPECHECK|...File.fs|7|13|The namespace 'Reactive' is not defined

    They are referenced from fsproj file, of course and VS is able to find them well.

  3. The build system seems to be missing - it does not build on F7.
rneatherway commented 9 years ago

Please could you post the .fsproj file that you're having trouble with? In particular I am interested in all the parts that contribute to the FSharp.Core reference, but it is easiest if you can just post the whole thing.

alex-netkachov commented 9 years ago

It looks like the project does not have reference to FSharp.Core. But it is in GAC so maybe that's why VS compiles it well.

fsproj file: http://pastebin.com/pzsaVa7r

alex-netkachov commented 9 years ago

BTW, if I have several subfolders with different F# project, how the plugin selects the correct one to process the file? Or should the project always contains one fsproj file in the root folder?

rneatherway commented 9 years ago

The reference to FSharp.Core is:

    <TargetFSharpCoreVersion>4.3.1.0</TargetFSharpCoreVersion>
    <Reference Include="FSharp.Core, Version=$(TargetFSharpCoreVersion), Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a">
      <Private>True</Private>
    </Reference>

Which should be fine. To give some context, I am the maintainer of the background process that this plugin uses. A few more questions:

I don't know the answers to your other questions, they are up to the maintainers of this plugin.

alex-netkachov commented 9 years ago

Can you get access to the exact error message returned by the background process, and post it here?

ERROR|TYPECHECK|startup|1|1|internal error: BuildFrameworkTcImports: no resolution of 'FSharp.Core.dll'
ERROR|TYPECHECK|unknown|1|1|Unable to find the file 'FSharp.Core.dll' in any of
 C:\Program Files (x86)\Reference Assemblies\Microsoft\Framework\.NETFramework\v4.0
 C:\Projects\papers-win\Source\Papers.Services.FSharp
 C:\Program Files (x86)\Microsoft SDKs\F#\3.1\Framework\v4.0\

Which versions of Visual Studio do you have installed?

  • Visual Studio Professional 2013, version 12.0.31101.00 Update 4
  • .NET Framework 4.5.51650

It would be interesting to know if installing the Visual F# 3.0 redist fixed this.

I downloaded and installed 3.1.2 from http://www.microsoft.com/en-us/download/details.aspx?id=44011 but it did not help.

Thank you for your help!

rneatherway commented 9 years ago

I see, this is deeper than FsAutoComplete, the error comes from FSharp.Compiler.Service. I need to see the full communication between sublime text and FsAutoComplete. @guillermooo or @rojepp should know how to obtain that.

guillermooo commented 9 years ago

I can't remember how detailed logging is now, but to enable it you should

  1. create a file named <Sublime Text Data>/Packages/.logs/FSharp
  2. add a single line to that file with the log level name, for example: debug
  3. restart ST

Log records will then be added to:

<Sublime Text Data>/Packages/.logs/FSharp.log