mirror of https://github.com/helix-editor/helix
Add `text` to language completer
parent
01ee42bb14
commit
cc47d3fb9d
|
@ -330,13 +330,19 @@ pub mod completers {
|
||||||
pub fn language(editor: &Editor, input: &str) -> Vec<Completion> {
|
pub fn language(editor: &Editor, input: &str) -> Vec<Completion> {
|
||||||
let matcher = Matcher::default();
|
let matcher = Matcher::default();
|
||||||
|
|
||||||
let mut matches: Vec<_> = editor
|
let text: String = "text".into();
|
||||||
|
|
||||||
|
let language_ids = editor
|
||||||
.syn_loader
|
.syn_loader
|
||||||
.language_configs()
|
.language_configs()
|
||||||
.filter_map(|config| {
|
.map(|config| &config.language_id)
|
||||||
|
.chain(std::iter::once(&text));
|
||||||
|
|
||||||
|
let mut matches: Vec<_> = language_ids
|
||||||
|
.filter_map(|language_id| {
|
||||||
matcher
|
matcher
|
||||||
.fuzzy_match(&config.language_id, input)
|
.fuzzy_match(language_id, input)
|
||||||
.map(|score| (&config.language_id, score))
|
.map(|score| (language_id, score))
|
||||||
})
|
})
|
||||||
.collect();
|
.collect();
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue