Skip to content

fix: suppress suggest menu when no completions available#276

Merged
mcanouil merged 3 commits intomainfrom
fix/suggest-menu-no-suggestions
Feb 19, 2026
Merged

fix: suppress suggest menu when no completions available#276
mcanouil merged 3 commits intomainfrom
fix/suggest-menu-no-suggestions

Conversation

@mcanouil
Copy link
Copy Markdown
Owner

Summary

  • Add shouldRetriggerSuggest pre-check in yamlPosition.ts that verifies the cursor is in a completable context (root level, extensions, or format key paths) before re-triggering the suggest widget on backspace.
  • Schema definition files (_schema.yml) retain the previous behaviour of always re-triggering within YAML regions.
  • Prevents the "No suggestions." popup when pressing backspace in non-completable positions such as title: My title.

Test plan

  • 10 new unit tests for shouldRetriggerSuggest covering YAML, QMD, and out-of-region scenarios.
  • Manual: in _quarto.yml with title: My title, backspace at end produces no popup.
  • Manual: under extensions:\n modal:, backspace re-triggers suggestions.
  • Manual: _schema.yml backspace behaviour unchanged.

Add shouldRetriggerSuggest pre-check in yamlPosition.ts that verifies
the cursor is in a completable context (root level, extensions, or
format key paths) before re-triggering the suggest widget on backspace.

Schema definition files retain the previous behaviour of always
re-triggering within YAML regions.
@mcanouil mcanouil self-assigned this Feb 19, 2026
@mcanouil mcanouil added the Type: Bug 🐛 Issues related to bugs, errors, or mistakes label Feb 19, 2026
Use getYamlIndentLevel on the line prefix up to the cursor position
so that blank-line indent trimming in getYamlKeyPath receives the
true indentation depth rather than a potentially larger column value.
@mcanouil mcanouil merged commit 248aef7 into main Feb 19, 2026
7 checks passed
@mcanouil mcanouil deleted the fix/suggest-menu-no-suggestions branch February 19, 2026 11:35
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Type: Bug 🐛 Issues related to bugs, errors, or mistakes

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant