class

Obelisk::PriorityLexerRegistry

Inherits Reference < Object

Enhanced lexer registry with priority-based selection

Constructors

new(selector : Obelisk::PriorityLexerSelector = PriorityLexerSelector.new)
Source

Instance methods

get(name : String) : Lexer | Nil
Source
get_candidates(filename : String | Nil = nil, mime_type : String | Nil = nil) : Array(Lexer)
Source
meets_threshold?(lexer_name : String, text : String, threshold : Float32 = 0.5_f32, filename : String | Nil = nil, mime_type : String | Nil = nil) : Bool
Source
names
Source
register(lexer : Lexer) : Nil
Source
select_best(text : String, filename : String | Nil = nil, mime_type : String | Nil = nil) : SelectionResult | Nil

Priority-based selection methods

Source
select_by_name_or_auto(name_or_alias : String | Nil, text : String, filename : String | Nil = nil, mime_type : String | Nil = nil) : Lexer | Nil
Source
select_ranked(text : String, filename : String | Nil = nil, mime_type : String | Nil = nil, limit : Int32 | Nil = nil) : Array(SelectionResult)
Source