lsp

package
v0.45.0 Latest Latest
Warning

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

Go to latest
Published: Jan 30, 2026 License: MIT Imports: 12 Imported by: 0

Documentation

Index

Constants

View Source
const LSPToolTimeout = 30 * time.Second

LSPToolTimeout is the timeout for LSP operations

Variables

View Source
var LSPClient *lsplib.Client

LSPClient is set by agent during initialization

Functions

func FormatReferenceWarning

func FormatReferenceWarning(refs []ReferenceInfo) string

FormatReferenceWarning は参照警告メッセージをフォーマット

func RegisterTools

func RegisterTools(registry *tools.Registry)

RegisterTools registers all LSP tools to the registry

Types

type LSPDefinitionTool

type LSPDefinitionTool struct{}

LSPDefinitionTool finds the definition of a symbol

func (*LSPDefinitionTool) Description added in v0.44.0

func (t *LSPDefinitionTool) Description() string

func (*LSPDefinitionTool) Name

func (t *LSPDefinitionTool) Name() string

func (*LSPDefinitionTool) Parameters added in v0.44.0

func (t *LSPDefinitionTool) Parameters() map[string]interface{}

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) Description added in v0.44.0

func (t *LSPDiagnosticsTool) Description() string

func (*LSPDiagnosticsTool) Name

func (t *LSPDiagnosticsTool) Name() string

func (*LSPDiagnosticsTool) Parameters added in v0.44.0

func (t *LSPDiagnosticsTool) Parameters() map[string]interface{}

func (*LSPDiagnosticsTool) Run

type LSPHoverTool

type LSPHoverTool struct{}

LSPHoverTool gets type information and documentation for a symbol

func (*LSPHoverTool) Description added in v0.44.0

func (t *LSPHoverTool) Description() string

func (*LSPHoverTool) Name

func (t *LSPHoverTool) Name() string

func (*LSPHoverTool) Parameters added in v0.44.0

func (t *LSPHoverTool) Parameters() map[string]interface{}

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) Description added in v0.44.0

func (t *LSPReferencesTool) Description() string

func (*LSPReferencesTool) Name

func (t *LSPReferencesTool) Name() string

func (*LSPReferencesTool) Parameters added in v0.44.0

func (t *LSPReferencesTool) Parameters() map[string]interface{}

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) Description added in v0.44.0

func (t *LSPRenameTool) Description() string

func (*LSPRenameTool) Name

func (t *LSPRenameTool) Name() string

func (*LSPRenameTool) Parameters added in v0.44.0

func (t *LSPRenameTool) Parameters() map[string]interface{}

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 は削除される文字列からシンボルを抽出

Jump to

Keyboard shortcuts

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