Skip to content

Priority-based lexer selection in get_lexer_by_name et al. #1603

@e-kayrakli

Description

@e-kayrakli

Current (0fa29a0) implementations of get_lexer_by_name and some other similar functions don't take priority of the lexer into consideration and return the first lexer with the matching name. This implies that plugins are never checked if there's a builtin lexer with the given name.

Checking all the installed lexers and matching based on priority or other heuristics that are already implemented for guessing lexers based on content etc. can enable users to override some of the builtin lexers with their own custom ones by assigning higher priority to their lexers.

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions