{"modulePath":"github.com/pencode-labs/pencode","version":"v0.1.0-rc.15","isLatest":true,"isStandardLibrary":false,"goos":"all","goarch":"all","docs":"# package textsearch\n\nPackage textsearch shares find/replace semantics between the editor and server.\n\n## Types\n\n```go\ntype Match struct {\n\tStart, End int\n\t// contains filtered or unexported fields\n}\n```\n\n```go\ntype Options struct {\n\tCaseSensitive, WholeWord, Regex, PreserveCase bool\n}\n```\n\n```go\ntype Pattern struct {\n\t// contains filtered or unexported fields\n}\n```\n\n```go\nfunc Compile(query string, options Options) (*Pattern, error)\n```\n\n```go\nfunc (p *Pattern) FindAll[T string | []byte](content T, dst []Match, limit int) []Match\n```\nFindAll reuses caller-owned storage. A negative limit retains every match.\n\n```go\nfunc (p *Pattern) FindRange[T string | []byte](content T, dst []Match, start, end, limit int, countAll bool) ([]Match, int)\n```\nFindRange keeps document-relative offsets and word/regexp boundary semantics. countAll counts matches beyond the storage limit without retaining them.\n\n```go\nfunc (p *Pattern) FindSnapshot(content piecetree.Snapshot, dst []Match, start, end, limit int) []Match\n```\nFindSnapshot searches immutable pieces without materializing the document. Regexp readers preserve whole-document assertion and submatch semantics.\n\n```go\nfunc (p *Pattern) Replace(content, replacement string, matches []Match) string\n```\nReplace applies the original ranges once, so inserted matches are never visited.\n\n```go\nfunc (p *Pattern) Replacement(content string, match Match, replacement string) string\n```\n\n","path":"github.com/pencode-labs/pencode/textsearch","name":"textsearch","synopsis":"Package textsearch shares find/replace semantics between the editor and server.","isRedistributable":true}
