Skip to content

Commit

Permalink
better support for loading csharp dlls (we need IsFSharp to be true t…
Browse files Browse the repository at this point in the history
…o get all methods in "MembersFunctionsAndValues"). This will be used by FSharp.Formatting for example.
  • Loading branch information
matthid committed Sep 28, 2014
1 parent 2b4beaf commit c5dfd4d
Showing 1 changed file with 11 additions and 6 deletions.
17 changes: 11 additions & 6 deletions src/fsharp/vs/Symbols.fs
Original file line number Diff line number Diff line change
Expand Up @@ -81,6 +81,11 @@ module Impl =
cpaths2 |> List.exists (canAccessFromCrossProject taccess1)
| _ -> true // otherwise use the normal check

let getItem (ent:EntityRef) =
checkEntityIsResolved(ent)
if ent.IsModule then Item.ModuleOrNamespaces [ent]
else Item.UnqualifiedType [ent]

let getXmlDocSigForEntity g (tcImports:TcImports) (ent:EntityRef)=
let amap = tcImports.GetImportMap()
let infoReader = InfoReader(g, amap)
Expand Down Expand Up @@ -122,10 +127,7 @@ type FSharpSymbol(g:TcGlobals, thisCcu, tcImports, item: (unit -> Item), access:

and FSharpEntity(g:TcGlobals, thisCcu, tcImports: TcImports, entity:EntityRef) =
inherit FSharpSymbol(g, thisCcu, tcImports,
(fun () ->
checkEntityIsResolved(entity);
if entity.IsModule then Item.ModuleOrNamespaces [entity]
else Item.UnqualifiedType [entity]),
(fun () -> getItem(entity)),
(fun _this thisCcu2 ad ->
checkForCrossProjectAccessibility (thisCcu2, ad) (thisCcu, entity.Accessibility))
// && AccessibilityLogic.IsEntityAccessible (tcImports.GetImportMap()) range0 ad entity)
Expand All @@ -137,7 +139,9 @@ and FSharpEntity(g:TcGlobals, thisCcu, tcImports: TcImports, entity:EntityRef) =
let isResolvedAndFSharp() =
match entity with
| ERefNonLocal(NonLocalEntityRef(ccu, _)) -> not ccu.IsUnresolvedReference && ccu.IsFSharp
| _ -> true
| _ ->
let ccu = defaultArg (ItemDescriptionsImpl.ccuOfItem g (getItem entity)) thisCcu
ccu.IsFSharp

let isUnresolved() = entityIsUnresolved entity
let isResolved() = not (isUnresolved())
Expand Down Expand Up @@ -1661,7 +1665,8 @@ and FSharpAssembly internal (g: TcGlobals, thisCcu, tcImports, ccu: CcuThunk) =
member __.FileName = ccu.FileName
member __.SimpleName = ccu.AssemblyName
member __.IsProviderGenerated = ccu.IsProviderGenerated
member __.Contents = FSharpAssemblySignature(g, thisCcu, tcImports, ccu.Contents.ModuleOrNamespaceType)
member __.Contents =
FSharpAssemblySignature(g, (if ccu.IsUnresolvedReference then thisCcu else ccu), tcImports, ccu.Contents.ModuleOrNamespaceType)


override x.ToString() = x.QualifiedName
Expand Down

0 comments on commit c5dfd4d

Please sign in to comment.