Skip to content

Commit

Permalink
Fix unused open type declaration detection
Browse files Browse the repository at this point in the history
  • Loading branch information
aslupik committed Nov 19, 2020
1 parent 7036c05 commit b49db71
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions src/fsharp/service/ServiceAnalysis.fs
Original file line number Diff line number Diff line change
Expand Up @@ -67,9 +67,9 @@ module UnusedOpens =
yield! getModuleAndItsAutoOpens true ent |]
{ OpenedModules = getModuleAndItsAutoOpens false modul }

/// Represents single open statement.
/// Represents a single open statement
type OpenStatement =
{ /// All namespaces and modules which this open declaration effectively opens, including the AutoOpen ones
{ /// All namespaces, modules and types which this open declaration effectively opens, including the AutoOpen ones
OpenedGroups: OpenedModuleGroup list

/// The range of open statement itself
Expand All @@ -90,7 +90,8 @@ module UnusedOpens =
if firstId.idText = MangledGlobalName then
None
else
Some { OpenedGroups = openDecl.Modules |> List.map OpenedModuleGroup.Create
let openedModulesAndTypes = List.concat [openDecl.Modules; openDecl.Types |> List.map(fun ty -> ty.TypeDefinition)]
Some { OpenedGroups = openedModulesAndTypes |> List.map OpenedModuleGroup.Create
Range = range
AppliedScope = openDecl.AppliedScope }
| _ -> None)
Expand Down

0 comments on commit b49db71

Please sign in to comment.