Documentation ¶
Index ¶
- type MemEditor
- func (ve *MemEditor) CompareRangeWithString(start, end int, compareTo string) (bool, error)
- func (ve *MemEditor) ExpandWordTextRange(i RangeIf) RangeIf
- func (ve *MemEditor) FindRegexpRange(patternStr string, callback func(RangeIf) error) error
- func (ve *MemEditor) FindStringRange(feature string, callback func(RangeIf) error) error
- func (ve *MemEditor) FindStringRangeIndexFirst(startIndex int, feature string, callback func(RangeIf)) (end int, ok bool)
- func (ve *MemEditor) GetContextAroundRange(startPos, endPos PositionIf, n int) (string, error)
- func (ve *MemEditor) GetCurrentLine() (string, error)
- func (ve *MemEditor) GetEndOffsetByLine(x int) (int, error)
- func (ve *MemEditor) GetLine(x int) (string, error)
- func (ve *MemEditor) GetMinAndMaxOffset(pos ...PositionIf) (int, int)
- func (ve *MemEditor) GetOffsetByPosition(p PositionIf) int
- func (ve *MemEditor) GetOffsetByPositionRaw(line, col int) int
- func (ve *MemEditor) GetOffsetByPositionWithError(line, col int) (int, error)
- func (ve *MemEditor) GetPositionByOffset(offset int) PositionIf
- func (ve *MemEditor) GetPositionByOffsetWithError(offset int) (PositionIf, error)
- func (ve *MemEditor) GetSourceCode() string
- func (ve *MemEditor) GetStartOffsetByLine(x int) (int, error)
- func (ve *MemEditor) GetTextFromOffset(offset1, offset2 int) string
- func (ve *MemEditor) GetTextFromPosition(p1, p2 PositionIf) string
- func (ve *MemEditor) GetTextFromRange(i RangeIf) string
- func (ve *MemEditor) GetTextFromRangeContext(i RangeIf, lineNum int) string
- func (ve *MemEditor) GetTextFromRangeWithError(r RangeIf) (string, error)
- func (ve *MemEditor) GetUrl() string
- func (ve *MemEditor) GetWordTextFromRange(i RangeIf) string
- func (ve *MemEditor) IsOffsetValid(offset int) bool
- func (ve *MemEditor) IsValidPosition(line, col int) bool
- func (ve *MemEditor) MoveCursor(position int) error
- func (ve *MemEditor) PushSourceCodeContext(i any)
- func (ve *MemEditor) ResetSourceCodeHash()
- func (ve *MemEditor) Select(start, end int) (string, error)
- func (ve *MemEditor) SetUrl(url string)
- func (ve *MemEditor) SourceCodeMd5() string
- func (ve *MemEditor) SourceCodeSha1() string
- func (ve *MemEditor) SourceCodeSha256() string
- func (ve *MemEditor) UpdateTextByRange(r RangeIf, newText string) error
- type Position
- type PositionIf
- type Range
- type RangeIf
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type MemEditor ¶
type MemEditor struct {
// contains filtered or unexported fields
}
func NewMemEditor ¶
func (*MemEditor) CompareRangeWithString ¶
比较指定范围的文本是否与给定字符串相同
func (*MemEditor) ExpandWordTextRange ¶
func (*MemEditor) FindRegexpRange ¶
func (*MemEditor) FindStringRange ¶
func (*MemEditor) FindStringRangeIndexFirst ¶
func (*MemEditor) GetContextAroundRange ¶
func (ve *MemEditor) GetContextAroundRange(startPos, endPos PositionIf, n int) (string, error)
func (*MemEditor) GetCurrentLine ¶
GetCurrentLine 返回当前光标所在行的内容
func (*MemEditor) GetMinAndMaxOffset ¶
func (ve *MemEditor) GetMinAndMaxOffset(pos ...PositionIf) (int, int)
func (*MemEditor) GetOffsetByPosition ¶
func (ve *MemEditor) GetOffsetByPosition(p PositionIf) int
func (*MemEditor) GetOffsetByPositionRaw ¶
func (*MemEditor) GetOffsetByPositionWithError ¶
func (*MemEditor) GetPositionByOffset ¶
func (ve *MemEditor) GetPositionByOffset(offset int) PositionIf
func (*MemEditor) GetPositionByOffsetWithError ¶
func (ve *MemEditor) GetPositionByOffsetWithError(offset int) (PositionIf, error)
func (*MemEditor) GetSourceCode ¶
func (*MemEditor) GetStartOffsetByLine ¶
func (*MemEditor) GetTextFromOffset ¶
func (*MemEditor) GetTextFromPosition ¶
func (ve *MemEditor) GetTextFromPosition(p1, p2 PositionIf) string
func (*MemEditor) GetTextFromRange ¶
func (*MemEditor) GetTextFromRangeContext ¶
func (*MemEditor) GetTextFromRangeWithError ¶
GetTextFromRangeWithError 根据Range获取文本,优先使用Offset,其次使用Line和Column
func (*MemEditor) GetWordTextFromRange ¶
func (*MemEditor) IsOffsetValid ¶
func (*MemEditor) IsValidPosition ¶
func (*MemEditor) MoveCursor ¶
MoveCursor 移动模拟光标位置
func (*MemEditor) PushSourceCodeContext ¶
func (*MemEditor) ResetSourceCodeHash ¶
func (ve *MemEditor) ResetSourceCodeHash()
func (*MemEditor) SourceCodeMd5 ¶
func (*MemEditor) SourceCodeSha1 ¶
func (*MemEditor) SourceCodeSha256 ¶
type Position ¶
type Position struct {
// contains filtered or unexported fields
}
func NewPosition ¶
type PositionIf ¶
type Range ¶
type Range struct {
// contains filtered or unexported fields
}
func NewRange ¶
func NewRange(p1, p2 PositionIf) *Range
func (*Range) GetEnd ¶
func (r *Range) GetEnd() PositionIf
func (*Range) GetStart ¶
func (r *Range) GetStart() PositionIf
type RangeIf ¶
type RangeIf interface { GetStart() PositionIf GetEnd() PositionIf }
Click to show internal directories.
Click to hide internal directories.