Bug 55881 - Missing top level completions in Android template
Summary: Missing top level completions in Android template
Status: RESOLVED FIXED
Alias: None
Product: Xamarin Studio
Classification: Desktop
Component: F# Add-in (show other bugs)
Version: 7.0 (VSforMac)
Hardware: PC Mac OS
: High normal
Target Milestone: 15.6
Assignee: Jason Imison
URL:
Depends on:
Blocks:
 
Reported: 2017-05-02 10:51 UTC by Jason Imison
Modified: 2017-10-15 12:42 UTC (History)
4 users (show)

See Also:
Tags:
Is this bug a regression?: ---
Last known good build:


Attachments

Description Jason Imison 2017-05-02 10:51:45 UTC
When using the Android templates, top level completions aren't returned, but 'dot' completions are, e.g it isn't possible to complete 'button' after `let button = this.FindViewById<Button>(Resources.Id.myButton)`

I notice this in the log 

```
DEBUG [2017-05-02 11:48:28Z]: Error at: GetSymbolUseAtLocation}
Microsoft.FSharp.Compiler.ErrorLogger+ReportedError: A reference to the type 'andif.Resource' in assembly 'ProvidedTypesc494afa0-413b-4a19-b6ef-beb98f3ea38c' was found, but the type could not be found in that assembly
  at Microsoft.FSharp.Compiler.ErrorLogger+ErrorLoggerExtensions.ErrorLogger.Error[b] (Microsoft.FSharp.Compiler.ErrorLogger+ErrorLogger x, System.Exception exn) [0x00014] in <58dbcdd5ddab8ea7a7450383d5cddb58>:0
  at Microsoft.FSharp.Compiler.Import.ImportTypeRefData (Microsoft.FSharp.Compiler.Import+ImportMap env, Microsoft.FSharp.Compiler.Range+range m, Microsoft.FSharp.Compiler.AbstractIL.IL+ILScopeRef scoref, System.String[] path, System.String typeName) [0x00129] in <58dbcdd5ddab8ea7a7450383d5cddb58>:0
  at Microsoft.FSharp.Compiler.Import.ImportILTypeRefUncached (Microsoft.FSharp.Compiler.Import+ImportMap env, Microsoft.FSharp.Compiler.Range+range m, Microsoft.FSharp.Compiler.AbstractIL.IL+ILTypeRef tref) [0x00083] in <58dbcdd5ddab8ea7a7450383d5cddb58>:0
  at Microsoft.FSharp.Compiler.Import.ImportILTypeRef (Microsoft.FSharp.Compiler.Import+ImportMap env, Microsoft.FSharp.Compiler.Range+range m, Microsoft.FSharp.Compiler.AbstractIL.IL+ILTypeRef tref) [0x0001e] in <58dbcdd5ddab8ea7a7450383d5cddb58>:0
  at Microsoft.FSharp.Compiler.Import.ImportProvidedType (Microsoft.FSharp.Compiler.Import+ImportMap env, Microsoft.FSharp.Compiler.Range+range m, Microsoft.FSharp.Compiler.Tainted`1[T] st) [0x00138] in <58dbcdd5ddab8ea7a7450383d5cddb58>:0
  at Microsoft.FSharp.Compiler.Infos+MethInfo.get_EnclosingType () [0x00074] in <58dbcdd5ddab8ea7a7450383d5cddb58>:0
  at Microsoft.FSharp.Compiler.AccessibilityLogic.IsTypeAndMethInfoAccessible (Microsoft.FSharp.Compiler.Import+ImportMap amap, Microsoft.FSharp.Compiler.Range+range m, Microsoft.FSharp.Compiler.AccessibilityLogic+AccessorDomain adTyp, Microsoft.FSharp.Compiler.AccessibilityLogic+AccessorDomain ad, Microsoft.FSharp.Compiler.Infos+MethInfo _arg1) [0x000ad] in <58dbcdd5ddab8ea7a7450383d5cddb58>:0
  at Microsoft.FSharp.Compiler.NameResolution+ctorInfos@1773.Invoke (Microsoft.FSharp.Compiler.Infos+MethInfo minfo) [0x00001] in <58dbcdd5ddab8ea7a7450383d5cddb58>:0
  at Microsoft.FSharp.Primitives.Basics.List.filter[T] (Microsoft.FSharp.Core.FSharpFunc`2[T,TResult] predicate, Microsoft.FSharp.Collections.FSharpList`1[T] l) [0x00000] in /private/tmp/source-mono-2017-02/bockbuild-2017-02/profiles/mono-mac-xamarin/build-root/fsharp-fsharp-991186f/src/fsharp/FSharp.Core/local.fs:495
  at Microsoft.FSharp.Collections.ListModule.Filter[T] (Microsoft.FSharp.Core.FSharpFunc`2[T,TResult] predicate, Microsoft.FSharp.Collections.FSharpList`1[T] list) [0x00000] in /private/tmp/source-mono-2017-02/bockbuild-2017-02/profiles/mono-mac-xamarin/build-root/fsharp-fsharp-991186f/src/fsharp/FSharp.Core/list.fs:411
  at Microsoft.FSharp.Compiler.NameResolution.ResolveObjectConstructorPrim[a] (Microsoft.FSharp.Compiler.NameResolution+NameResolver ncenv, Microsoft.FSharp.Compiler.Tastops+DisplayEnv edenv, a resInfo, Microsoft.FSharp.Compiler.Range+range m, Microsoft.FSharp.Compiler.AccessibilityLogic+AccessorDomain ad, Microsoft.FSharp.Compiler.Tast+TType typ) [0x00126] in <58dbcdd5ddab8ea7a7450383d5cddb58>:0
  at Microsoft.FSharp.Compiler.NameResolution.ResolveObjectConstructor (Microsoft.FSharp.Compiler.NameResolution+NameResolver ncenv, Microsoft.FSharp.Compiler.Tastops+DisplayEnv edenv, Microsoft.FSharp.Compiler.Range+range m, Microsoft.FSharp.Compiler.AccessibilityLogic+AccessorDomain ad, Microsoft.FSharp.Compiler.Tast+TType typ) [0x00008] in <58dbcdd5ddab8ea7a7450383d5cddb58>:0
  at Microsoft.FSharp.Compiler.NameResolution.InfosForTyconConstructors (Microsoft.FSharp.Compiler.NameResolution+NameResolver ncenv, Microsoft.FSharp.Compiler.Range+range m, Microsoft.FSharp.Compiler.AccessibilityLogic+AccessorDomain ad, Microsoft.FSharp.Compiler.Tast+EntityRef tcref) [0x0002d] in <58dbcdd5ddab8ea7a7450383d5cddb58>:0
  at Microsoft.FSharp.Compiler.NameResolution+constructors@3758.Invoke (Microsoft.FSharp.Compiler.Tast+EntityRef tcref) [0x00001] in <58dbcdd5ddab8ea7a7450383d5cddb58>:0
  at Microsoft.FSharp.Primitives.Basics.List.collectToFreshConsTail[T,TResult] (Microsoft.FSharp.Core.FSharpFunc`2[T,TResult] f, Microsoft.FSharp.Collections.FSharpList`1[T] list, Microsoft.FSharp.Collections.FSharpList`1[T] cons) [0x00000] in /private/tmp/source-mono-2017-02/bockbuild-2017-02/profiles/mono-mac-xamarin/build-root/fsharp-fsharp-991186f/src/fsharp/FSharp.Core/local.fs:443
  at Microsoft.FSharp.Primitives.Basics.List.collect[T,TResult] (Microsoft.FSharp.Core.FSharpFunc`2[T,TResult] f, Microsoft.FSharp.Collections.FSharpList`1[T] list) [0x00039] in /private/tmp/source-mono-2017-02/bockbuild-2017-02/profiles/mono-mac-xamarin/build-root/fsharp-fsharp-991186f/src/fsharp/FSharp.Core/local.fs:451
  at Microsoft.FSharp.Collections.ListModule.Collect[T,TResult] (Microsoft.FSharp.Core.FSharpFunc`2[T,TResult] mapping, Microsoft.FSharp.Collections.FSharpList`1[T] list) [0x00000] in /private/tmp/source-mono-2017-02/bockbuild-2017-02/profiles/mono-mac-xamarin/build-root/fsharp-fsharp-991186f/src/fsharp/FSharp.Core/list.fs:641
  at Microsoft.FSharp.Compiler.NameResolution.ResolvePartialLongIdentPrim (Microsoft.FSharp.Compiler.NameResolution+NameResolver ncenv, Microsoft.FSharp.Compiler.NameResolution+NameResolutionEnv nenv, Microsoft.FSharp.Compiler.NameResolution+ResolveCompletionTargets isApplicableMeth, Microsoft.FSharp.Compiler.NameResolution+FullyQualifiedFlag fullyQualified, Microsoft.FSharp.Compiler.Range+range m, Microsoft.FSharp.Compiler.AccessibilityLogic+AccessorDomain ad, Microsoft.FSharp.Collections.FSharpList`1[T] plid, System.Boolean allowObsolete) [0x00339] in <58dbcdd5ddab8ea7a7450383d5cddb58>:0
  at Microsoft.FSharp.Compiler.NameResolution.ResolvePartialLongIdent (Microsoft.FSharp.Compiler.NameResolution+NameResolver ncenv, Microsoft.FSharp.Compiler.NameResolution+NameResolutionEnv nenv, Microsoft.FSharp.Core.FSharpFunc`2[T,TResult] isApplicableMeth, Microsoft.FSharp.Compiler.Range+range m, Microsoft.FSharp.Compiler.AccessibilityLogic+AccessorDomain ad, Microsoft.FSharp.Collections.FSharpList`1[T] plid, System.Boolean allowObsolete) [0x0000e] in <58dbcdd5ddab8ea7a7450383d5cddb58>:0
  at Microsoft.FSharp.Compiler.SourceCodeServices.TypeCheckInfo.GetEnvironmentLookupResolutions (Microsoft.FSharp.Compiler.Range+pos cursorPos, Microsoft.FSharp.Collections.FSharpList`1[T] plid, Microsoft.FSharp.Compiler.NameResolution+TypeNameResolutionFlag filterCtors, System.Boolean showObsolete) [0x00049] in <58dbcdd5ddab8ea7a7450383d5cddb58>:0
  at Microsoft.FSharp.Compiler.SourceCodeServices.TypeCheckInfo.GetDeclaredItems[a] (Microsoft.FSharp.Core.FSharpOption`1[T] parseResultsOpt, System.String lineStr, Microsoft.FSharp.Core.FSharpOption`1[T] origLongIdentOpt, System.Int32 colAtEndOfNamesAndResidue, Microsoft.FSharp.Core.FSharpOption`1[T] residueOpt, System.Int32 line, System.Int32 loc, Microsoft.FSharp.Compiler.NameResolution+TypeNameResolutionFlag filterCtors, Microsoft.FSharp.Compiler.SourceCodeServices.ResolveOverloads resolveOverloads, Microsoft.FSharp.Core.FSharpFunc`2[T,TResult] hasTextChangedSinceLastTypecheck, System.Boolean isInRangeOperator) [0x002c5] in <58dbcdd5ddab8ea7a7450383d5cddb58>:0
  at Microsoft.FSharp.Compiler.SourceCodeServices.TypeCheckInfo.GetDeclItemsForNamesAtPosition (Microsoft.FSharp.Compiler.AbstractIL.Internal.Library+CompilationThreadToken ctok, Microsoft.FSharp.Core.FSharpOption`1[T] parseResultsOpt, Microsoft.FSharp.Core.FSharpOption`1[T] origLongIdentOpt, Microsoft.FSharp.Core.FSharpOption`1[T] residueOpt, System.Int32 line, System.String lineStr, System.Int32 colAtEndOfNamesAndResidue, Microsoft.FSharp.Compiler.NameResolution+TypeNameResolutionFlag filterCtors, Microsoft.FSharp.Compiler.SourceCodeServices.ResolveOverloads resolveOverloads, Microsoft.FSharp.Core.FSharpFunc`2[T,TResult] hasTextChangedSinceLastTypecheck) [0x00098] in <58dbcdd5ddab8ea7a7450383d5cddb58>:0
  at Microsoft.FSharp.Compiler.SourceCodeServices.TypeCheckInfo.GetSymbolUseAtLocation (Microsoft.FSharp.Compiler.AbstractIL.Internal.Library+CompilationThreadToken ctok, System.Int32 line, System.String lineStr, System.Int32 colAtEndOfNames, Microsoft.FSharp.Collections.FSharpList`1[T] names) [0x00022] in <58dbcdd5ddab8ea7a7450383d5cddb58>:0
  at <StartupCode$FSharp-Compiler-Service>.$Service+GetSymbolUseAtLocation@2100-1.Invoke (Microsoft.FSharp.Compiler.AbstractIL.Internal.Library+CompilationThreadToken ctok, Microsoft.FSharp.Compiler.SourceCodeServices.TypeCheckInfo scope) [0x00007] in <58dbcdd5ddab8ea7a7450383d5cddb58>:0
  at Microsoft.FSharp.Core.FSharpFunc`2[T,TResult].InvokeFast[V] (Microsoft.FSharp.Core.FSharpFunc`2[T,TResult] func, T arg1, TResult arg2) [0x0000d] in <58fa8914dff9fae1a74503831489fa58>:0
  at <StartupCode$FSharp-Compiler-Service>.$Service+clo@2037-215[a].Invoke (Microsoft.FSharp.Compiler.AbstractIL.Internal.Library+CompilationThreadToken ctok, System.Threading.CancellationToken _ct) [0x00001] in <58dbcdd5ddab8ea7a7450383d5cddb58>:0
  at Microsoft.FSharp.Core.FSharpFunc`2[T,TResult].InvokeFast[V] (Microsoft.FSharp.Core.FSharpFunc`2[T,TResult] func, T arg1, TResult arg2) [0x0000d] in <58fa8914dff9fae1a74503831489fa58>:0
  at <StartupCode$FSharp-Compiler-Service>.$Reactor+EnqueueAndAwaitOpAsync@146-2[T].Invoke (Microsoft.FSharp.Compiler.AbstractIL.Internal.Library+CompilationThreadToken ctok) [0x00008] in <58dbcdd5ddab8ea7a7450383d5cddb58>:0
```
Comment 1 Jason Imison 2017-05-11 12:06:47 UTC
This is also happening in the Android project within the Xamarin Forms template (which doesn't contain the type provider)
Comment 2 Jason Imison 2017-05-25 12:26:28 UTC
Looking at this again and Xamarin Forms template does reference the type provider even though it's not used. If I remove the type provider reference from the project then intellisense at the top level starts to work again.
Comment 3 Jason Imison 2017-05-25 13:26:24 UTC
Looks to be the same issue as https://github.com/Microsoft/visualfsharp/issues/2747
Comment 4 iain 2017-08-02 17:49:21 UTC
Seems to still be happening with master
Comment 5 Jason Imison 2017-09-28 16:05:23 UTC
Created an issue here with some more information https://github.com/fsharp/FSharp.Compiler.Service/issues/809
Comment 6 Jason Imison 2017-10-13 20:10:25 UTC
This was caused by a bug in the type provider https://github.com/xamarin/Xamarin.Android.FSharp.ResourceProvider/commit/a304eaee0e8c8a8bd0ed1e496e11198b1e077be8

Just need to update the templates.
Comment 7 xamarin-release-manager 2017-10-15 12:42:34 UTC
Fixed in version 7.4.0.336 (master)

Author: nosami
Commit: bc6f23ff81cb033e0842a562ada9c4ec695d1229 (xamarin/md-addins)
Included in Commit: dd29179a4db2040d47c6f930e2dc1772e06225cb (mono/monodevelop)

Note You need to log in before you can comment on or make changes to this bug.