Skip to content

Add mermaid serialization of the trie from graph based typechecking - #15144

Merged
T-Gro merged 6 commits into
dotnet:mainfrom
dawedawe:dump_dep_trie
May 2, 2023
Merged

T-Gro merged 6 commits into
dotnet:mainfrom
dawedawe:dump_dep_trie

Conversation

@dawedawe

Copy link
Copy Markdown
Contributor

If the dependency graph from graph-based typechecking is serialized, let's also dump the trie used in the algorithm.
Example from Fantomas.Core:

classDiagram

class root

root <|-- ns_Microsoft
class ns_Microsoft {

   .NETStandard,Version=v2.0.AssemblyAttributes.fs(0)
}

ns_Microsoft <|-- ns_BuildSettings
class ns_BuildSettings {

   .NETStandard,Version=v2.0.AssemblyAttributes.fs(0)
}

root <|-- ns_FSharp
class ns_FSharp {

   Fantomas.Core.AssemblyInfo.fs(1)
}

root <|-- ns_Fantomas
class ns_Fantomas {

   AssemblyInfo.fs(2)
   ISourceTextExtensions.fsi(3)
   RangeHelpers.fsi(5)
   Utils.fsi(7)
   FormatConfig.fs(9)
   SyntaxOak.fs(10)
   ASTTransformer.fsi(11)
   Version.fs(13)
   Queue.fs(14)
   Trivia.fsi(15)
   Defines.fsi(17)
   CodeFormatterTypes.fs(19)
   Context.fsi(20)
   CodePrinter.fsi(22)
   MultipleDefineCombinations.fsi(24)
   CodeFormatterImpl.fsi(26)
   Validation.fsi(28)
   Selection.fsi(30)
   CodeFormatter.fsi(32)
}

ns_Fantomas <|-- ns_Core
class ns_Core {
   FormatConfig.fs[9]
   Queue.fs[14]
   Defines.fsi[17]
   CodeFormatterTypes.fs[19]
   CodeFormatter.fsi[32]

   AssemblyInfo.fs(2)
   ISourceTextExtensions.fsi(3)
   RangeHelpers.fsi(5)
   Utils.fsi(7)
   SyntaxOak.fs(10)
   ASTTransformer.fsi(11)
   Version.fs(13)
   Trivia.fsi(15)
   Context.fsi(20)
   CodePrinter.fsi(22)
   MultipleDefineCombinations.fsi(24)
   CodeFormatterImpl.fsi(26)
   Validation.fsi(28)
   Selection.fsi(30)
}

ns_Core <|-- mod_AssemblyVersionInformation
class mod_AssemblyVersionInformation {
   AssemblyInfo.fs[2]
}

ns_Core <|-- mod_ISourceTextExtensions
class mod_ISourceTextExtensions {
   ISourceTextExtensions.fsi[3]
}

ns_Core <|-- mod_RangeHelpers
class mod_RangeHelpers {
   RangeHelpers.fsi[5]
}

ns_Core <|-- mod_RangePatterns
class mod_RangePatterns {
   RangeHelpers.fsi[5]
}

ns_Core <|-- mod_String
class mod_String {
   Utils.fsi[7]
}

ns_Core <|-- mod_List
class mod_List {
   Utils.fsi[7]
}

ns_Core <|-- mod_Async
class mod_Async {
   Utils.fsi[7]
}

ns_Core <|-- mod_Continuation
class mod_Continuation {
   Utils.fsi[7]
}

ns_Core <|-- mod_SyntaxOak
class mod_SyntaxOak {
   SyntaxOak.fs[10]
}

ns_Core <|-- mod_ASTTransformer
class mod_ASTTransformer {
   ASTTransformer.fsi[11]
}

ns_Core <|-- mod_Version
class mod_Version {
   Version.fs[13]
}

ns_Core <|-- mod_Queue
class mod_Queue {
   Queue.fs[14]
}

ns_Core <|-- mod_Trivia
class mod_Trivia {
   Trivia.fsi[15]
}

ns_Core <|-- mod_Defines
class mod_Defines {
   Defines.fsi[17]
}

ns_Core <|-- mod_Context
class mod_Context {
   Context.fsi[20]
}

ns_Core <|-- mod_CodePrinter
class mod_CodePrinter {
   CodePrinter.fsi[22]
}

ns_Core <|-- mod_MultipleDefineCombinations
class mod_MultipleDefineCombinations {
   MultipleDefineCombinations.fsi[24]
}

ns_Core <|-- mod_CodeFormatterImpl
class mod_CodeFormatterImpl {
   CodeFormatterImpl.fsi[26]
}

ns_Core <|-- mod_Validation
class mod_Validation {
   Validation.fsi[28]
}

ns_Core <|-- mod_Selection
class mod_Selection {
   Selection.fsi[30]
}

Loading

@vzarytovskii

vzarytovskii commented Apr 25, 2023 •

Copy link
Copy Markdown
Member

Oh, that's great! I'd be up to setting it up in CI to publish those as comments in PRs as well for FCS and VF solutions

Comment thread src/Compiler/Driver/GraphChecking/TrieMapping.fs Outdated
@dawedawe
dawedawe marked this pull request as ready for review April 26, 2023 06:38
@dawedawe
dawedawe requested a review from a team as a code owner April 26, 2023 06:38
@T-Gro
T-Gro enabled auto-merge (squash) May 2, 2023 08:39
@T-Gro
T-Gro merged commit f2b5137 into dotnet:main May 2, 2023
@dawedawe
dawedawe deleted the dump_dep_trie branch May 2, 2023 11:56
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

Archived in project

Development

Successfully merging this pull request may close these issues.

6 participants