Documentation ¶
Overview ¶
Package repomap provides functionality for analyzing and mapping repositories. This file is intentionally empty as we're using github.com/smacker/go-tree-sitter directly instead of implementing our own tree-sitter wrappers.
Index ¶
- Constants
- func CloseSmallGapsHelper(lines map[int]struct{}, codeSplitByLines []string, codeLen int) map[int]struct{}
- func IsGitRepository(dir string) bool
- type DiGraph
- type Edge
- type EdgeIndex
- type FileSystem
- type NodeIndex
- type RankedDefinition
- type RankedDefinitionsMap
- type RepoMap
- type RepoMapError
- type SimpleFileSystem
- type Tag
- type TagAnalyzer
- type TagGraph
- func (tg *TagGraph) CalculateAndDistributeRanks()
- func (tg *TagGraph) CalculatePageRanks() []float64
- func (tg *TagGraph) DebugRankedDefinitions()
- func (tg *TagGraph) DebugSortedDefinitions()
- func (tg *TagGraph) GenerateDotRepresentation() string
- func (tg *TagGraph) GetGraph() *DiGraph
- func (tg *TagGraph) GetRankedDefinitions() RankedDefinitionsMap
- func (tg *TagGraph) GetSortedDefinitions() []RankedDefinition
- func (tg *TagGraph) PopulateFromTagIndex(tagIndex *TagIndex, mentionedIdents map[string]struct{})
- func (tg *TagGraph) PrintDot()
- type TagIndex
- type TagKind
- type TreeContext
- func (tc *TreeContext) AddChildContext(index int)
- func (tc *TreeContext) AddContext()
- func (tc *TreeContext) AddLois(lois []int)
- func (tc *TreeContext) AddParentScopes(index int, recurseDepth []int)
- func (tc *TreeContext) ArrangeHeaders()
- func (tc *TreeContext) CloseSmallGaps()
- func (tc *TreeContext) FindAllChildren(node *tree_sitter.Node) []*tree_sitter.Node
- func (tc *TreeContext) Format() string
- func (tc *TreeContext) GetLastLineOfScope(index int) int
- func (tc *TreeContext) GetLois() map[int]struct{}
- func (tc *TreeContext) Init(cursor *tree_sitter.TreeCursor)
- func (tc *TreeContext) PrintState()
- func (tc *TreeContext) Walk(cursor *tree_sitter.TreeCursor)
- type TreeWalker
- type TreeWalker2
Constants ¶
View Source
const REPOMAP_DEFAULT_TOKENS = 1024
Variables ¶
This section is empty.
Functions ¶
func CloseSmallGapsHelper ¶
func CloseSmallGapsHelper(lines map[int]struct{}, codeSplitByLines []string, codeLen int) map[int]struct{}
TODO(codestory): Improve the name over here
func IsGitRepository ¶
Checks if a path is a git directory, it looks for any commit hash present and gets the timestamp for it as a poor-man's check
Types ¶
type FileSystem ¶
type RankedDefinition ¶
type RankedDefinitionsMap ¶
type RepoMap ¶
type RepoMap struct {
MapTokens int
}
func NewRepoMap ¶
func NewRepoMap() *RepoMap
func (*RepoMap) WithMapTokens ¶
type RepoMapError ¶
type RepoMapError struct {
Err error
}
func NewFileSystemError ¶
func NewFileSystemError(err error) *RepoMapError
func NewGraphAnalysisError ¶
func NewGraphAnalysisError(msg string) *RepoMapError
func NewIoError ¶
func NewIoError() *RepoMapError
func NewParseError ¶
func NewParseError(msg string) *RepoMapError
func NewSymbolAnalysisError ¶
func NewSymbolAnalysisError(msg string) *RepoMapError
func NewTreeGenerationError ¶
func NewTreeGenerationError(msg string) *RepoMapError
func (*RepoMapError) Error ¶
func (e *RepoMapError) Error() string
func (*RepoMapError) Unwrap ¶
func (e *RepoMapError) Unwrap() error
type SimpleFileSystem ¶
type SimpleFileSystem struct{}
type TagAnalyzer ¶
type TagAnalyzer struct {
// contains filtered or unexported fields
}
func NewTagAnalyzer ¶
func NewTagAnalyzer(tagIndex *TagIndex) *TagAnalyzer
func (*TagAnalyzer) DebugPrintRankedTags ¶
func (ta *TagAnalyzer) DebugPrintRankedTags()
func (*TagAnalyzer) GetRankedTags ¶
func (ta *TagAnalyzer) GetRankedTags() []Tag
type TagGraph ¶
type TagGraph struct {
// contains filtered or unexported fields
}
func NewTagGraph ¶
func NewTagGraph() *TagGraph
func NewTagGraphFromTagIndex ¶
func (*TagGraph) CalculateAndDistributeRanks ¶
func (tg *TagGraph) CalculateAndDistributeRanks()
func (*TagGraph) CalculatePageRanks ¶
func (*TagGraph) DebugRankedDefinitions ¶
func (tg *TagGraph) DebugRankedDefinitions()
func (*TagGraph) DebugSortedDefinitions ¶
func (tg *TagGraph) DebugSortedDefinitions()
func (*TagGraph) GenerateDotRepresentation ¶
func (*TagGraph) GetRankedDefinitions ¶
func (tg *TagGraph) GetRankedDefinitions() RankedDefinitionsMap
func (*TagGraph) GetSortedDefinitions ¶
func (tg *TagGraph) GetSortedDefinitions() []RankedDefinition
func (*TagGraph) PopulateFromTagIndex ¶
type TagIndex ¶
type TagIndex struct { Defines map[string]map[string]struct{} References map[string][]string Definitions map[string][]Tag CommonTags map[string]struct{} FileToTags map[string]map[string]struct{} Path string // contains filtered or unexported fields }
func NewTagIndex ¶
func (*TagIndex) GenerateFromFiles ¶
GenerateFromFiles generates tags from the given files
func (*TagIndex) PostProcessTags ¶
func (ti *TagIndex) PostProcessTags()
type TreeContext ¶
type TreeContext struct { Filename string ParentContext bool ChildContext bool LastLine bool Margin int MarkLois bool HeaderMax int ShowTopOfFileParentScope bool LoiPad int Lois map[int]struct{} ShowLines map[int]struct{} NumLines int Lines []string LineNumber bool DoneParentScopes map[int]struct{} Nodes [][]*tree_sitter.Node Scopes []map[int]struct{} Header [][][3]int }
func NewTreeContext ¶
func NewTreeContext(code string, fsFilePath string) *TreeContext
func (*TreeContext) AddChildContext ¶
func (tc *TreeContext) AddChildContext(index int)
func (*TreeContext) AddContext ¶
func (tc *TreeContext) AddContext()
func (*TreeContext) AddLois ¶
func (tc *TreeContext) AddLois(lois []int)
func (*TreeContext) AddParentScopes ¶
func (tc *TreeContext) AddParentScopes(index int, recurseDepth []int)
func (*TreeContext) ArrangeHeaders ¶
func (tc *TreeContext) ArrangeHeaders()
func (*TreeContext) CloseSmallGaps ¶
func (tc *TreeContext) CloseSmallGaps()
func (*TreeContext) FindAllChildren ¶
func (tc *TreeContext) FindAllChildren(node *tree_sitter.Node) []*tree_sitter.Node
func (*TreeContext) Format ¶
func (tc *TreeContext) Format() string
func (*TreeContext) GetLastLineOfScope ¶
func (tc *TreeContext) GetLastLineOfScope(index int) int
func (*TreeContext) GetLois ¶
func (tc *TreeContext) GetLois() map[int]struct{}
func (*TreeContext) Init ¶
func (tc *TreeContext) Init(cursor *tree_sitter.TreeCursor)
func (*TreeContext) PrintState ¶
func (tc *TreeContext) PrintState()
func (*TreeContext) Walk ¶
func (tc *TreeContext) Walk(cursor *tree_sitter.TreeCursor)
type TreeWalker ¶
type TreeWalker struct { Scopes []map[int]struct{} Header [][][3]int Nodes [][]*tree_sitter.Node Tree *tree_sitter.Tree }
func NewTreeWalker ¶
func NewTreeWalker(tree *tree_sitter.Tree, numLines int) *TreeWalker
func (*TreeWalker) GetHeaders ¶
func (tw *TreeWalker) GetHeaders() [][][3]int
func (*TreeWalker) GetNodes ¶
func (tw *TreeWalker) GetNodes() [][]*tree_sitter.Node
func (*TreeWalker) GetScopes ¶
func (tw *TreeWalker) GetScopes() []map[int]struct{}
func (*TreeWalker) GetTree ¶
func (tw *TreeWalker) GetTree() *tree_sitter.Tree
func (*TreeWalker) WalkTree ¶
func (tw *TreeWalker) WalkTree(node *tree_sitter.Node)
type TreeWalker2 ¶
type TreeWalker2 struct { Nodes [][]*tree_sitter.Node Scopes []map[int]struct{} Header [][][3]int }
func NewTreeWalker2 ¶
func NewTreeWalker2(numLines int) *TreeWalker2
func (*TreeWalker2) GetAllTrueNodes ¶
func (tw *TreeWalker2) GetAllTrueNodes() [][]*tree_sitter.Node
func (*TreeWalker2) GetNodesForLine ¶
func (tw *TreeWalker2) GetNodesForLine(line int) []*tree_sitter.Node
func (*TreeWalker2) Walk ¶
func (tw *TreeWalker2) Walk(cursor *tree_sitter.TreeCursor)
Source Files ¶
Click to show internal directories.
Click to hide internal directories.