I believe you already know about this problem and we've talked about it but I found an example in the wild:
let fantomasCoreFiles =
let triviaTypes = """
module internal Fantomas.Core.TriviaTypes
open FSharp.Compiler.Syntax
open FSharp.Compiler.Text
type FsAstType =
/// Root node of the syntax tree
| ParsedInput_
| Ident_
| SynIdent_
| LongIdent_
| SynLongIdent_
"""
let version = """
module internal Fantomas.Core.Version
open System.Reflection
let fantomasVersion =
lazy
(let assembly = typeof<TriviaTypes.FsAstType>.Assembly
assembly.GetCustomAttribute<AssemblyInformationalVersionAttribute>()
|> Option.ofObj
|> Option.map (fun a -> a.InformationalVersion)
|> Option.defaultValue (Assembly.GetExecutingAssembly().GetName().Version.ToString()))
"""
[
"TriviaTypes.fs", triviaTypes
"Version.fs", version
]
[<Test>]
let ``Fantomas.Core mismatch`` () =
let nodes =
fantomasCoreFiles
|> List.mapi (fun i (name, code) ->
{
Idx = FileIdx.make i
//Code = code
AST = parseSourceCode(name, code)
} : SourceFile)
|> List.toArray
let graph = AutomatedDependencyResolving.detectFileDependencies nodes
do ()
let getDepsOfFile fileName =
graph.Graph
|> Seq.pick (fun (KeyValue(f, deps)) -> if System.IO.Path.GetFileName f.Name = fileName then Some deps.Length else None)
Assert.AreEqual(0, getDepsOfFile "TriviaTypes.fs")
Assert.AreEqual(1, getDepsOfFile "Version.fs")
Both files share the internal Fantomas.Core namespace. The link in the second file to the first is not being picked up. typeof<TriviaTypes.FsAstType> should be recognized as Fantomas.Core.TriviaTypes.FsAstType.
Hello,
I believe you already know about this problem and we've talked about it but I found an example in the wild:
Both files share the internal
Fantomas.Core
namespace. The link in the second file to the first is not being picked up.typeof<TriviaTypes.FsAstType>
should be recognized asFantomas.Core.TriviaTypes.FsAstType
.