Documentation
¶
Index ¶
Constants ¶
const LSPToolTimeout = 30 * time.Second
LSPToolTimeout is the timeout for LSP operations
Variables ¶
var LSPClient *lsplib.Client
LSPClient is set by agent during initialization
Functions ¶
func FormatReferenceWarning ¶
func FormatReferenceWarning(refs []ReferenceInfo) string
FormatReferenceWarning は参照警告メッセージをフォーマット
func RegisterTools ¶
RegisterTools registers all LSP tools to the registry
Types ¶
type LSPDefinitionTool ¶
type LSPDefinitionTool struct{}
LSPDefinitionTool finds the definition of a symbol
func (*LSPDefinitionTool) Name ¶
func (t *LSPDefinitionTool) Name() string
func (*LSPDefinitionTool) Run ¶
func (t *LSPDefinitionTool) Run(args map[string]string) (string, *tools.FileChange, error)
type LSPDiagnosticsTool ¶
type LSPDiagnosticsTool struct{}
LSPDiagnosticsTool gets errors and warnings for a file
func (*LSPDiagnosticsTool) Name ¶
func (t *LSPDiagnosticsTool) Name() string
func (*LSPDiagnosticsTool) Run ¶
func (t *LSPDiagnosticsTool) Run(args map[string]string) (string, *tools.FileChange, error)
type LSPHoverTool ¶
type LSPHoverTool struct{}
LSPHoverTool gets type information and documentation for a symbol
func (*LSPHoverTool) Name ¶
func (t *LSPHoverTool) Name() string
func (*LSPHoverTool) Run ¶
func (t *LSPHoverTool) Run(args map[string]string) (string, *tools.FileChange, error)
type LSPReferencesTool ¶
type LSPReferencesTool struct{}
LSPReferencesTool finds all references to a symbol
func (*LSPReferencesTool) Name ¶
func (t *LSPReferencesTool) Name() string
func (*LSPReferencesTool) Run ¶
func (t *LSPReferencesTool) Run(args map[string]string) (string, *tools.FileChange, error)
type LSPRenameTool ¶
type LSPRenameTool struct{}
LSPRenameTool renames a symbol at the given position
func (*LSPRenameTool) Name ¶
func (t *LSPRenameTool) Name() string
func (*LSPRenameTool) Run ¶
func (t *LSPRenameTool) Run(args map[string]string) (string, *tools.FileChange, error)
type ReferenceInfo ¶
type ReferenceInfo struct {
Symbol string
FilePath string
Line int // 1-indexed
IsLocal bool // 同一ファイル内の参照
}
ReferenceInfo は参照情報
func CheckReferencesBeforeDelete ¶
func CheckReferencesBeforeDelete(filePath string, symbols []SymbolInfo) ([]ReferenceInfo, bool, error)
CheckReferencesBeforeDelete はLSPで参照をチェック 戻り値: 参照リスト, 外部参照あり?, エラー
func GetExternalReferences ¶
func GetExternalReferences(refs []ReferenceInfo) []ReferenceInfo
GetExternalReferences は外部参照のみをフィルタして返す
type SymbolInfo ¶
type SymbolInfo struct {
Name string
Line int // 1-indexed
Column int // 1-indexed
Kind string // func, type, var, const, class, etc.
}
SymbolInfo は削除対象のシンボル情報
func ExtractSymbolsFromContent ¶
func ExtractSymbolsFromContent(content, language string) []SymbolInfo
ExtractSymbolsFromContent はファイル内容からシンボル(関数/型/変数)を抽出
func ExtractSymbolsFromOldStr ¶
func ExtractSymbolsFromOldStr(oldStr, language string) []SymbolInfo
ExtractSymbolsFromOldStr は削除される文字列からシンボルを抽出