Skip to content

feat: trigger element attribute completions on { and support link/image attributes#266

Merged
mcanouil merged 1 commit intomainfrom
feat/element-attribute-trigger-brace
Feb 16, 2026
Merged

feat: trigger element attribute completions on { and support link/image attributes#266
mcanouil merged 1 commit intomainfrom
feat/element-attribute-trigger-brace

Conversation

@mcanouil
Copy link
Copy Markdown
Owner

Summary

  • Add { as a trigger character for the element attribute completion provider, so completions appear automatically when opening a Pandoc attribute block (e.g. ::: {, ]{, `{`).
  • Recognise ) before { in isPandocAttributeContext to detect link ([text](url){) and image (![alt](url){) attribute contexts, mapped to "Span".
  • Add four tests covering getAttributeBounds and parseAttributeAtPosition for link/image syntax.

Test plan

  • npx tsc --noEmit passes.
  • npx eslint src/ passes.
  • npx prettier --check "src/**/*.ts" passes.
  • npm test passes (332 passing; 10 pre-existing failures in activate.test.js).
  • Manual: type ::: { in a .qmd file and verify completions appear automatically.
  • Manual: type [text]{ and verify completions appear automatically.
  • Manual: type `code`{ and verify completions appear automatically.
  • Manual: type ![alt](url){ and verify completions appear automatically.
  • Manual: type { in plain text (not after a Pandoc element) and verify no completions appear.

@mcanouil mcanouil self-assigned this Feb 16, 2026
@mcanouil mcanouil added Type: Enhancement 💡 Issues related to enhancements, improvements, new features, or new analyses labels Feb 16, 2026
…mage attributes

Add `{` as a trigger character for the element attribute completion
provider so completions appear automatically when opening a Pandoc
attribute block.

Recognise `)` before `{` in the attribute parser to detect link and
image attribute contexts (`[text](url){` and `![alt](url){`).
@mcanouil mcanouil force-pushed the feat/element-attribute-trigger-brace branch from 6861641 to 85eaf33 Compare February 16, 2026 14:27
@mcanouil mcanouil merged commit 036cb18 into main Feb 16, 2026
7 checks passed
@mcanouil mcanouil deleted the feat/element-attribute-trigger-brace branch February 16, 2026 14:32
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Type: Enhancement 💡 Issues related to enhancements, improvements, new features, or new analyses

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant