repomap

package
v0.28.1 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Jan 10, 2026 License: MIT Imports: 11 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var SupportedLanguages = map[string]*sitter.Language{
	".go":  golang.GetLanguage(),
	".js":  javascript.GetLanguage(),
	".ts":  typescript.GetLanguage(),
	".py":  python.GetLanguage(),
	".jsx": javascript.GetLanguage(),
	".tsx": typescript.GetLanguage(),
	".mjs": javascript.GetLanguage(),
}

SupportedLanguages は対応言語のマップ

Functions

func GetLanguage

func GetLanguage(filePath string) *sitter.Language

GetLanguage はファイル拡張子から言語を取得

func IsSupportedFile

func IsSupportedFile(filePath string) bool

IsSupportedFile はサポートされているファイルかどうか

Types

type FileSymbols

type FileSymbols struct {
	Path    string
	Symbols []Symbol
}

FileSymbols はファイル内のシンボル一覧

func ExtractSymbols

func ExtractSymbols(filePath string) (*FileSymbols, error)

ExtractSymbols はファイルからシンボルを抽出

type RepoMap

type RepoMap struct {
	RootPath  string
	Files     []*FileSymbols
	MaxTokens int // トークン制限
}

RepoMap はリポジトリのコード構造マップ

func NewRepoMap

func NewRepoMap(rootPath string, maxTokens int) *RepoMap

NewRepoMap は新しいRepoMapを作成

func (*RepoMap) Build

func (rm *RepoMap) Build() error

Build はリポジトリをスキャンしてマップを構築

func (*RepoMap) Generate

func (rm *RepoMap) Generate() string

Generate はRepo Map文字列を生成

func (*RepoMap) GetSymbolCount

func (rm *RepoMap) GetSymbolCount() int

GetSymbolCount はシンボル総数を返す

type Symbol

type Symbol struct {
	Name       string // シンボル名
	Kind       string // "function", "struct", "class", "method", "interface"
	Signature  string // 完全なシグネチャ(func CreateUser(name string) error)
	FilePath   string // ファイルパス
	Line       int    // 行番号
	References int    // 参照回数(ランキング用)
}

Symbol はコード内のシンボル(関数、クラス、構造体等)

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL