Skip to content

fix: use SnippetString for YAML completion indentation and re-trigger on backspace#264

Merged
mcanouil merged 1 commit intomainfrom
fix/yaml-completion-indent-backspace
Feb 16, 2026
Merged

fix: use SnippetString for YAML completion indentation and re-trigger on backspace#264
mcanouil merged 1 commit intomainfrom
fix/yaml-completion-indent-backspace

Conversation

@mcanouil
Copy link
Copy Markdown
Owner

Summary

  • Use SnippetString instead of plain strings in adjustForValuePosition to prevent VS Code's increaseIndentPattern from adding extra indentation when completing keys after a colon.
  • Add a debounced onDidChangeTextDocument listener to re-trigger the suggest widget on backspace, since backspace cannot be a trigger character.

Test plan

  • In _quarto.yml, type extensions:\n modal:, place cursor after modal:, trigger completion, accept an option key. The key should appear at 4 spaces of indentation (not 6).
  • In _quarto.yml, start typing an option key under an extension, press backspace. The suggest widget should re-appear.
  • Verify npx tsc --noEmit, npx eslint src/, and npx prettier --check "src/**/*.ts" all pass.

… on backspace

Use SnippetString instead of plain strings in adjustForValuePosition
so VS Code's increaseIndentPattern does not double the indentation
when completing keys after a colon.

Add a debounced onDidChangeTextDocument listener that re-triggers the
suggest widget on single-character deletions, since backspace cannot
be registered as a trigger character.
@mcanouil mcanouil added the Type: Bug 🐛 Issues related to bugs, errors, or mistakes label Feb 16, 2026
@mcanouil mcanouil self-assigned this Feb 16, 2026
@mcanouil mcanouil enabled auto-merge (squash) February 16, 2026 11:47
@mcanouil mcanouil merged commit 5685d36 into main Feb 16, 2026
7 checks passed
@mcanouil mcanouil deleted the fix/yaml-completion-indent-backspace branch February 16, 2026 11:51
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