class

CRDoc::Search

Inherits Reference < Object

Full-text and regex search over names and docs.

Results rank name matches first, then by kind (types; constructors, class methods and macros; instance methods; constants and enum members), then by full name.

Constants

EXCERPT_WIDTH = 120
MARKDOWN_LINK = /\[([^\]]*)\]\([^)]*\)/

Constructors

new(index : Index)
Source

Class methods

excerpt(doc : String, position : Int32, length : Int32) : String

The doc line around position, trimmed and cut to EXCERPT_WIDTH characters centered on the match.

Source
kind_rank(kind : Entry::Kind) : Int32
Source
word_regex(word : String) : Regex

Matches word as a whole word, ignoring case.

Source

Instance methods

find(word : String, scope : Scope = :all, kinds : Array(Entry::Kind) | Nil = nil) : Array(Match)

Whole-word, case-insensitive search for word.

Source
regex(pattern : Regex, scope : Scope = :all, kinds : Array(Entry::Kind) | Nil = nil) : Array(Match)
Source

Nested types