MCPcopy Index your code
hub / github.com/dbcli/mycli / _emit_binary_or_comma

Function _emit_binary_or_comma

mycli/packages/completion_engine.py:365–380  ·  view source on GitHub ↗
(ctx: SuggestContext)

Source from the content-addressed store, hash-verified

363
364
365def _emit_binary_or_comma(ctx: SuggestContext) -> list[Suggestion]:
366 original_text = ctx.text_before_cursor
367 prev_keyword, rewound_text = find_prev_keyword(ctx.text_before_cursor)
368 enum_suggestion = _enum_value_suggestion(original_text, ctx.full_text)
369
370 # guard against non-progressing parser rewinds, which can otherwise
371 # recurse forever on some operator shapes.
372 if prev_keyword and rewound_text.rstrip() != original_text.rstrip():
373 fallback = suggest_based_on_last_token(prev_keyword, rewound_text, None, ctx.full_text, ctx.identifier)
374 else:
375 # perhaps this fallback should include columns
376 fallback = _keyword_suggestions()
377
378 if enum_suggestion and _is_where_or_having(prev_keyword):
379 return [enum_suggestion] + fallback
380 return fallback
381
382
383def _word_starts_with_digit_or_dot(ctx: SuggestContext) -> bool:

Calls 5

find_prev_keywordFunction · 0.90
_enum_value_suggestionFunction · 0.85
_keyword_suggestionsFunction · 0.85
_is_where_or_havingFunction · 0.85