提交 e0596f3a 编写于 作者: V Vasily Kirichenko 提交者: Kevin Ransom (msft)

fix error range of wrong namespace in open declaration (#3966)

上级 ae6f593d
...@@ -1767,11 +1767,11 @@ let rec ResolveLongIndentAsModuleOrNamespace atMostOne amap m fullyQualified (ne ...@@ -1767,11 +1767,11 @@ let rec ResolveLongIndentAsModuleOrNamespace atMostOne amap m fullyQualified (ne
UndefinedName(0,FSComp.SR.undefinedNameNamespaceOrModule,id,suggestModulesAndNamespaces)) UndefinedName(0,FSComp.SR.undefinedNameNamespaceOrModule,id,suggestModulesAndNamespaces))
let moduleNotFoundErrorCache = ref None let mutable moduleNotFoundErrorCache = None
let moduleNotFound (modref: ModuleOrNamespaceRef) (mty:ModuleOrNamespaceType) id depth = let moduleNotFound (modref: ModuleOrNamespaceRef) (mty:ModuleOrNamespaceType) (id:Ident) depth =
match !moduleNotFoundErrorCache with match moduleNotFoundErrorCache with
| Some error -> error | Some (oldId, error) when oldId = id.idRange -> error
| None -> | _ ->
let suggestNames() = let suggestNames() =
mty.ModulesAndNamespacesByDemangledName mty.ModulesAndNamespacesByDemangledName
|> Seq.filter (fun kv -> IsEntityAccessible amap m ad (modref.NestedTyconRef kv.Value)) |> Seq.filter (fun kv -> IsEntityAccessible amap m ad (modref.NestedTyconRef kv.Value))
...@@ -1779,7 +1779,7 @@ let rec ResolveLongIndentAsModuleOrNamespace atMostOne amap m fullyQualified (ne ...@@ -1779,7 +1779,7 @@ let rec ResolveLongIndentAsModuleOrNamespace atMostOne amap m fullyQualified (ne
|> HashSet |> HashSet
let error = raze (UndefinedName(depth,FSComp.SR.undefinedNameNamespace,id,suggestNames)) let error = raze (UndefinedName(depth,FSComp.SR.undefinedNameNamespace,id,suggestNames))
moduleNotFoundErrorCache := Some error moduleNotFoundErrorCache <- Some(id.idRange, error)
error error
match moduleOrNamespaces.TryFind id.idText with match moduleOrNamespaces.TryFind id.idText with
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册