MCPcopy Create free account
hub / github.com/AmrDeveloper/GQL / complete

Method complete

src/gitql/gitql_line_editor.rs:100–121  ·  view source on GitHub ↗
(&self, input: &StyledBuffer)

Source from the content-addressed store, hash-verified

98
99impl Completer for FixedCompleter {
100 fn complete(&self, input: &StyledBuffer) -> Vec<Suggestion> {
101 let mut suggestions: Vec<Suggestion> = vec![];
102 if input.position() != input.len() {
103 return suggestions;
104 }
105
106 if let Some(keyword) = input.last_alphabetic_keyword() {
107 for reserved_keyword in GITQL_RESERVED_KEYWORDS {
108 if reserved_keyword.starts_with(&keyword) {
109 let suggestion = Suggestion {
110 content: StyledBuffer::from(reserved_keyword),
111 span: Span {
112 start: input.len() - keyword.len(),
113 end: input.len(),
114 },
115 };
116 suggestions.push(suggestion);
117 }
118 }
119 }
120 suggestions
121 }
122}
123
124#[derive(Default)]

Callers

nothing calls this directly

Calls 1

lenMethod · 0.45

Tested by

no test coverage detected