fsharp / zarchive-vim-fsharp

F# bindings for vim
MIT License
143 stars 34 forks source link

Not including all referenced assemblies #22

Closed scizo closed 8 years ago

scizo commented 9 years ago

This issue might actually not be a vim-fsharp problem, but be better addressed to the FSAutocomplete project (I'm not sure if I am refering to the project correctly).

Anyways, here is what I am experiencing.

I have a .fsproj file generated by Xamarin Studio. When I open one of the files in my project (a Xamarin Android project) it doesn't have references to the Mono.Android assemblies and thus marks all of the lines referencing classes from these assemblies as errors. When I turn on debugging, and look at the logs, the Mono.Android assemblies are not included in the references section although they are in the .fsproj file. I will include the contents of my *.fsproj and the log2.txt debugging output.

Is there something else that I need to do in order for the Mono.Android assembly to correctly be referenced or is this a bug when parsing the *.fsproj file?

Thanks for a great plugin! The intergration with fsi and everything else has been fantastic besides this little hiccup.

<?xml version="1.0" encoding="utf-8"?>
<Project DefaultTargets="Build" ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
  <PropertyGroup>
    <Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
    <Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform>
    <ProjectTypeGuids>{EFBA0AD7-5A72-4C68-AF49-83D382785DCF};{F2A71F9B-5D33-465A-A702-920D77279786}</ProjectTypeGuids>
    <ProjectGuid>{65105FBD-4138-4E51-B579-7E7327F1E80B}</ProjectGuid>
    <OutputType>Library</OutputType>
    <RootNamespace>Gravity</RootNamespace>
    <MonoAndroidAssetsPrefix>Assets</MonoAndroidAssetsPrefix>
    <MonoAndroidResourcePrefix>Resources</MonoAndroidResourcePrefix>
    <AndroidResgenClass>Resource</AndroidResgenClass>
    <AndroidResgenFile>Resources\Resource.designer.fs</AndroidResgenFile>
    <AndroidApplication>True</AndroidApplication>
    <AndroidUseLatestPlatformSdk>False</AndroidUseLatestPlatformSdk>
    <AssemblyName>Gravity</AssemblyName>
    <AndroidManifest>Properties\AndroidManifest.xml</AndroidManifest>
    <TargetFrameworkVersion>v4.4</TargetFrameworkVersion>
  </PropertyGroup>
  <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
    <DebugSymbols>true</DebugSymbols>
    <Optimize>false</Optimize>
    <OutputPath>bin\Debug</OutputPath>
    <DefineConstants>DEBUG</DefineConstants>
    <ErrorReport>prompt</ErrorReport>
    <AndroidLinkMode>None</AndroidLinkMode>
    <ConsolePause>false</ConsolePause>
    <PlatformTarget>
    </PlatformTarget>
  </PropertyGroup>
  <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' ">
    <DebugSymbols>false</DebugSymbols>
    <Optimize>true</Optimize>
    <OutputPath>bin\Release</OutputPath>
    <ErrorReport>prompt</ErrorReport>
    <GenerateTailCalls>true</GenerateTailCalls>
    <AndroidUseSharedRuntime>false</AndroidUseSharedRuntime>
    <ConsolePause>false</ConsolePause>
    <PlatformTarget>
    </PlatformTarget>
    <DefineConstants>
    </DefineConstants>
  </PropertyGroup>
  <ItemGroup>
    <Reference Include="System" />
    <Reference Include="System.Xml" />
    <Reference Include="System.Core" />
    <Reference Include="mscorlib" />
    <Reference Include="FSharp.Core" />
    <Reference Include="Mono.Android" />
  </ItemGroup>
  <ItemGroup>
    <Compile Include="Resources\Resource.designer.fs" />
    <Compile Include="Properties\AssemblyInfo.fs" />
    <Compile Include="SensorRecorderService.fs" />
    <Compile Include="AutoStart.fs" />
    <Compile Include="MainActivity.fs" />
  </ItemGroup>
  <ItemGroup>
    <None Include="Resources\AboutResources.txt" />
    <None Include="Properties\AndroidManifest.xml" />
  </ItemGroup>
  <ItemGroup>
    <AndroidResource Include="Resources\layout\Main.axml" />
    <AndroidResource Include="Resources\values\Strings.xml" />
    <AndroidResource Include="Resources\drawable\Icon.png" />
  </ItemGroup>
  <ItemGroup>
    <AndroidAsset Include="Assets\AboutAssets.txt" />
  </ItemGroup>
  <Import Project="$(MSBuildExtensionsPath)\Xamarin\Android\Xamarin.Android.FSharp.targets" />
</Project>
::work read: {"Kind":"error","Data":"Unknown command or wrong arguments"}
::work read: {"Kind":"project","Data":{"Project":"/Users/scott/rbl/Gravity/Gravity.fsproj","Files":["/Users/scott/rbl/Gravity/Resources/Resource.designer.fs","/Users/scott/rbl/Gravity/Properties/AssemblyInfo.fs","/Users/scott/rbl/Gravity/SensorRecorderService.fs","/Users/scott/rbl/Gravity/AutoStart.fs","/Users/scott/rbl/Gravity/MainActivity.fs"],"Output":"/Users/scott/rbl/Gravity/bin/Debug/Gravity.dll","References":["/Library/Frameworks/Mono.framework/Versions/4.0.4/lib/mono/4.5/FSharp.Core.dll"],"Framework":"v4.4"}}
::work read: {"Kind":"info","Data":"Background parsing started"}
::work read: {"Kind":"info","Data":"Background parsing started"}
::work read: {"Kind":"info","Data":"Background parsing started"}
::work read: {"Kind":"errors","Data":[{"FileName":"/Users/scott/rbl/Gravity/MainActivity.fs","StartLine":5,"EndLine":5,"StartColumn":6,"EndColumn":13,"Severity":"Error","Message":"The namespace or module 'Android' is not defined","Subcategory":"typecheck"},{"FileName":"/Users/scott/rbl/Gravity/MainActivity.fs","StartLine":6,"EndLine":6,"StartColumn":6,"EndColumn":13,"Severity":"Error","Message":"The namespace or module 'Android' is not defined","Subcategory":"typecheck"},{"FileName":"/Users/scott/rbl/Gravity/MainActivity.fs","StartLine":7,"EndLine":7,"StartColumn":6,"EndColumn":13,"Severity":"Error","Message":"The namespace or module 'Android' is not defined","Subcategory":"typecheck"},{"FileName":"/Users/scott/rbl/Gravity/MainActivity.fs","StartLine":8,"EndLine":8,"StartColumn":6,"EndColumn":13,"Severity":"Error","Message":"The namespace or module 'Android' is not defined","Subcategory":"typecheck"},{"FileName":"/Users/scott/rbl/Gravity/MainActivity.fs","StartLine":18,"EndLine":18,"StartColumn":15,"EndColumn":33,"Severity":"Error","Message":"The type 'IServiceConnection' is not defined","Subcategory":"typecheck"},{"FileName":"/Users/scott/rbl/Gravity/MainActivity.fs","StartLine":17,"EndLine":17,"StartColumn":13,"EndColumn":17,"Severity":"Error","Message":"The namespace or module 'Java' is not defined","Subcategory":"typecheck"},{"FileName":"/Users/scott/rbl/Gravity/MainActivity.fs","StartLine":18,"EndLine":18,"StartColumn":15,"EndColumn":33,"Severity":"Error","Message":"The type 'obj' is not an interface type","Subcategory":"typecheck"},{"FileName":"/Users/scott/rbl/Gravity/MainActivity.fs","StartLine":18,"EndLine":18,"StartColumn":15,"EndColumn":33,"Severity":"Error","Message":"The type 'IServiceConnection' is not defined","Subcategory":"typecheck"},{"FileName":"/Users/scott/rbl/Gravity/MainActivity.fs","StartLine":17,"EndLine":17,"StartColumn":13,"EndColumn":17,"Severity":"Error","Message":"The namespace or module 'Java' is not defined","Subcategory":"typecheck"},{"FileName":"/Users/scott/rbl/Gravity/MainActivity.fs","StartLine":18,"EndLine":18,"StartColumn":15,"EndColumn":33,"Severity":"Error","Message":"The type 'IServiceConnection' is not defined","Subcategory":"typecheck"},{"FileName":"/Users/scott/rbl/Gravity/MainActivity.fs","StartLine":18,"EndLine":18,"StartColumn":15,"EndColumn":33,"Severity":"Error","Message":"This type is not an interface type","Subcategory":"typecheck"},{"FileName":"/Users/scott/rbl/Gravity/MainActivity.fs","StartLine":19,"EndLine":19,"StartColumn":21,"EndColumn":39,"Severity":"Error","Message":"No abstract or interface member was found that corresponds to this override","Subcategory":"typecheck"},{"FileName":"/Users/scott/rbl/Gravity/MainActivity.fs","StartLine":19,"EndLine":19,"StartColumn":46,"EndColumn":59,"Severity":"Error","Message":"The type 'ComponentName' is not defined","Subcategory":"typecheck"},{"FileName":"/Users/scott/rbl/Gravity/MainActivity.fs","StartLine":19,"EndLine":19,"StartColumn":69,"EndColumn":76,"Severity":"Error","Message":"The type 'IBinder' is not defined","Subcategory":"typecheck"},{"FileName":"/Users/scott/rbl/Gravity/MainActivity.fs","StartLine":23,"EndLine":23,"StartColumn":21,"EndColumn":42,"Severity":"Error","Message":"No abstract or interface member was found that corresponds to this override","Subcategory":"typecheck"},{"FileName":"/Users/scott/rbl/Gravity/MainActivity.fs","StartLine":23,"EndLine":23,"StartColumn":49,"EndColumn":62,"Severity":"Error","Message":"The type 'ComponentName' is not defined","Subcategory":"typecheck"},{"FileName":"/Users/scott/rbl/Gravity/MainActivity.fs","StartLine":17,"EndLine":17,"StartColumn":13,"EndColumn":17,"Severity":"Error","Message":"The namespace or module 'Java' is not defined","Subcategory":"typecheck"},{"FileName":"/Users/scott/rbl/Gravity/MainActivity.fs","StartLine":27,"EndLine":27,"StartColumn":3,"EndColumn":11,"Severity":"Error","Message":"The type 'Activity' is not defined","Subcategory":"typecheck"},{"FileName":"/Users/scott/rbl/Gravity/MainActivity.fs","StartLine":29,"EndLine":29,"StartColumn":13,"EndColumn":21,"Severity":"Error","Message":"The type 'Activity' is not defined","Subcategory":"typecheck"},{"FileName":"/Users/scott/rbl/Gravity/MainActivity.fs","StartLine":29,"EndLine":29,"StartColumn":13,"EndColumn":21,"Severity":"Error","Message":"The type 'Activity' is not defined","Subcategory":"typecheck"},{"FileName":"/Users/scott/rbl/Gravity/MainActivity.fs","StartLine":37,"EndLine":37,"StartColumn":19,"EndColumn":27,"Severity":"Error","Message":"No abstract or interface member was found that corresponds to this override","Subcategory":"typecheck"},{"FileName":"/Users/scott/rbl/Gravity/MainActivity.fs","StartLine":29,"EndLine":29,"StartColumn":13,"EndColumn":21,"Severity":"Error","Message":"The type 'Activity' is not defined","Subcategory":"typecheck"}]}
::work read: {"Kind":"errors","Data":[{"FileName":"/Users/scott/rbl/Gravity/MainActivity.fs","StartLine":5,"EndLine":5,"StartColumn":6,"EndColumn":13,"Severity":"Error","Message":"The namespace or module 'Android' is not defined","Subcategory":"typecheck"},{"FileName":"/Users/scott/rbl/Gravity/MainActivity.fs","StartLine":6,"EndLine":6,"StartColumn":6,"EndColumn":13,"Severity":"Error","Message":"The namespace or module 'Android' is not defined","Subcategory":"typecheck"},{"FileName":"/Users/scott/rbl/Gravity/MainActivity.fs","StartLine":7,"EndLine":7,"StartColumn":6,"EndColumn":13,"Severity":"Error","Message":"The namespace or module 'Android' is not defined","Subcategory":"typecheck"},{"FileName":"/Users/scott/rbl/Gravity/MainActivity.fs","StartLine":8,"EndLine":8,"StartColumn":6,"EndColumn":13,"Severity":"Error","Message":"The namespace or module 'Android' is not defined","Subcategory":"typecheck"},{"FileName":"/Users/scott/rbl/Gravity/MainActivity.fs","StartLine":18,"EndLine":18,"StartColumn":15,"EndColumn":33,"Severity":"Error","Message":"The type 'IServiceConnection' is not defined","Subcategory":"typecheck"},{"FileName":"/Users/scott/rbl/Gravity/MainActivity.fs","StartLine":17,"EndLine":17,"StartColumn":13,"EndColumn":17,"Severity":"Error","Message":"The namespace or module 'Java' is not defined","Subcategory":"typecheck"},{"FileName":"/Users/scott/rbl/Gravity/MainActivity.fs","StartLine":18,"EndLine":18,"StartColumn":15,"EndColumn":33,"Severity":"Error","Message":"The type 'obj' is not an interface type","Subcategory":"typecheck"},{"FileName":"/Users/scott/rbl/Gravity/MainActivity.fs","StartLine":18,"EndLine":18,"StartColumn":15,"EndColumn":33,"Severity":"Error","Message":"The type 'IServiceConnection' is not defined","Subcategory":"typecheck"},{"FileName":"/Users/scott/rbl/Gravity/MainActivity.fs","StartLine":17,"EndLine":17,"StartColumn":13,"EndColumn":17,"Severity":"Error","Message":"The namespace or module 'Java' is not defined","Subcategory":"typecheck"},{"FileName":"/Users/scott/rbl/Gravity/MainActivity.fs","StartLine":18,"EndLine":18,"StartColumn":15,"EndColumn":33,"Severity":"Error","Message":"The type 'IServiceConnection' is not defined","Subcategory":"typecheck"},{"FileName":"/Users/scott/rbl/Gravity/MainActivity.fs","StartLine":18,"EndLine":18,"StartColumn":15,"EndColumn":33,"Severity":"Error","Message":"This type is not an interface type","Subcategory":"typecheck"},{"FileName":"/Users/scott/rbl/Gravity/MainActivity.fs","StartLine":19,"EndLine":19,"StartColumn":21,"EndColumn":39,"Severity":"Error","Message":"No abstract or interface member was found that corresponds to this override","Subcategory":"typecheck"},{"FileName":"/Users/scott/rbl/Gravity/MainActivity.fs","StartLine":19,"EndLine":19,"StartColumn":46,"EndColumn":59,"Severity":"Error","Message":"The type 'ComponentName' is not defined","Subcategory":"typecheck"},{"FileName":"/Users/scott/rbl/Gravity/MainActivity.fs","StartLine":19,"EndLine":19,"StartColumn":69,"EndColumn":76,"Severity":"Error","Message":"The type 'IBinder' is not defined","Subcategory":"typecheck"},{"FileName":"/Users/scott/rbl/Gravity/MainActivity.fs","StartLine":23,"EndLine":23,"StartColumn":21,"EndColumn":42,"Severity":"Error","Message":"No abstract or interface member was found that corresponds to this override","Subcategory":"typecheck"},{"FileName":"/Users/scott/rbl/Gravity/MainActivity.fs","StartLine":23,"EndLine":23,"StartColumn":49,"EndColumn":62,"Severity":"Error","Message":"The type 'ComponentName' is not defined","Subcategory":"typecheck"},{"FileName":"/Users/scott/rbl/Gravity/MainActivity.fs","StartLine":17,"EndLine":17,"StartColumn":13,"EndColumn":17,"Severity":"Error","Message":"The namespace or module 'Java' is not defined","Subcategory":"typecheck"},{"FileName":"/Users/scott/rbl/Gravity/MainActivity.fs","StartLine":27,"EndLine":27,"StartColumn":3,"EndColumn":11,"Severity":"Error","Message":"The type 'Activity' is not defined","Subcategory":"typecheck"},{"FileName":"/Users/scott/rbl/Gravity/MainActivity.fs","StartLine":29,"EndLine":29,"StartColumn":13,"EndColumn":21,"Severity":"Error","Message":"The type 'Activity' is not defined","Subcategory":"typecheck"},{"FileName":"/Users/scott/rbl/Gravity/MainActivity.fs","StartLine":29,"EndLine":29,"StartColumn":13,"EndColumn":21,"Severity":"Error","Message":"The type 'Activity' is not defined","Subcategory":"typecheck"},{"FileName":"/Users/scott/rbl/Gravity/MainActivity.fs","StartLine":37,"EndLine":37,"StartColumn":19,"EndColumn":27,"Severity":"Error","Message":"No abstract or interface member was found that corresponds to this override","Subcategory":"typecheck"},{"FileName":"/Users/scott/rbl/Gravity/MainActivity.fs","StartLine":29,"EndLine":29,"StartColumn":13,"EndColumn":21,"Severity":"Error","Message":"The type 'Activity' is not defined","Subcategory":"typecheck"}]}
::work read: {"Kind":"errors","Data":[{"FileName":"/Users/scott/rbl/Gravity/MainActivity.fs","StartLine":5,"EndLine":5,"StartColumn":6,"EndColumn":13,"Severity":"Error","Message":"The namespace or module 'Android' is not defined","Subcategory":"typecheck"},{"FileName":"/Users/scott/rbl/Gravity/MainActivity.fs","StartLine":6,"EndLine":6,"StartColumn":6,"EndColumn":13,"Severity":"Error","Message":"The namespace or module 'Android' is not defined","Subcategory":"typecheck"},{"FileName":"/Users/scott/rbl/Gravity/MainActivity.fs","StartLine":7,"EndLine":7,"StartColumn":6,"EndColumn":13,"Severity":"Error","Message":"The namespace or module 'Android' is not defined","Subcategory":"typecheck"},{"FileName":"/Users/scott/rbl/Gravity/MainActivity.fs","StartLine":8,"EndLine":8,"StartColumn":6,"EndColumn":13,"Severity":"Error","Message":"The namespace or module 'Android' is not defined","Subcategory":"typecheck"},{"FileName":"/Users/scott/rbl/Gravity/MainActivity.fs","StartLine":18,"EndLine":18,"StartColumn":15,"EndColumn":33,"Severity":"Error","Message":"The type 'IServiceConnection' is not defined","Subcategory":"typecheck"},{"FileName":"/Users/scott/rbl/Gravity/MainActivity.fs","StartLine":17,"EndLine":17,"StartColumn":13,"EndColumn":17,"Severity":"Error","Message":"The namespace or module 'Java' is not defined","Subcategory":"typecheck"},{"FileName":"/Users/scott/rbl/Gravity/MainActivity.fs","StartLine":18,"EndLine":18,"StartColumn":15,"EndColumn":33,"Severity":"Error","Message":"The type 'obj' is not an interface type","Subcategory":"typecheck"},{"FileName":"/Users/scott/rbl/Gravity/MainActivity.fs","StartLine":18,"EndLine":18,"StartColumn":15,"EndColumn":33,"Severity":"Error","Message":"The type 'IServiceConnection' is not defined","Subcategory":"typechec
rneatherway commented 9 years ago

Hi @scizo! Which version of fsautocomplete is bundled with vim-fsharp these days? fsautocomplete --version should tell you.

kjnilsson commented 9 years ago

Hi @rneatherway,

Currently we bundle version 0.23.0

https://github.com/fsharp/vim-fsharp/blob/master/Makefile#L11

rneatherway commented 9 years ago

Thanks, so Android should be supported, although I haven't tested it myself. @scizo, bearing in mind that I haven't used Mono.Android myself, what is the easiest way to reproduce? Do I need to install anything other than the standard Xamarin Mono installation, perhaps plus Xamarin Studio?

scizo commented 9 years ago

@rneatherway I am not sure if there is a more minimal way to reproduce it, but I installed all of the mono components through the Xamarin Studio installer (https://xamarin.com/download). Although I did avoid the registration by using homebrew on mac. After it was downloaded I used Xamarin Studio to generate the standard Android application as follows. File > New > Solution. I then selected the Android App option with the language set to F#.

screen shot 2015-09-21 at 1 33 44 pm

The next screen had three optional target platforms. I selected the top one, Modern Development, but I don't believe that would make a difference, but just in case.

After the project was created, open the MainActivity.fs file in vim should demonstrate the problem.

If that is too much, I can try and generate a standalone reproduction of the problem, but I hope that makes it possible for you to reproduce.

Thanks!

rneatherway commented 9 years ago

Can you explain a bit about what you mean when you say you skipped registration using Homebrew? Also, just to check, does autocomplete work in Xamarin Studio for this project?

scizo commented 9 years ago

When I say that I skipped registration using Homebrew I mean I was able to download the installer with out filling in the registration form on the download page by running brew cask install xamarin-studio from the command line. Once Xamarin Studio was installed though, I did register for an account so that I was able to browse the Xamarin Component Store though.

Autocomplete does work from Xamarin Studio for the project.

lulu-berlin commented 9 years ago

I don't know if I should mention my problem here or open a new issue. It seems that in a minimal project (created either in Visual Studio or in Projekt) some of the modules in System are not found by fsautocomplete (I tried System.Diagnostics.Process), and error messages are emitted in Vim with vim-fsharp. MSBuild and fsc, on the other hand, compile it just fine. I have reported this issue in fsautocomplete: https://github.com/fsharp/FsAutoComplete/issues/72.

rneatherway commented 9 years ago

@scizo: I'm sorry, I haven't had time to test this. If you have time, the easiest way to find out what the problem is as follows:

Let me know what the output is.

kjnilsson commented 8 years ago

fsac issue 72 referenced above has been closed. @yever do you need me to keep this issue open?

lulu-berlin commented 8 years ago

@kjnilsson, sorry for my disappearance.

This issue can be closed, as far as I'm concerned. I've just tested a project created in monodevelop and finally got autocompletion for System.Diagnostics.Process. If there still is a problem with project files created by Visual Studio, it should be treated in a separate issue.

kjnilsson commented 8 years ago

ok thanks - no worries. :)