Skip to content

feat: add file-path completion for schema-typed path arguments#263

Merged
mcanouil merged 2 commits intomainfrom
feat/file-path-completion
Feb 16, 2026
Merged

feat: add file-path completion for schema-typed path arguments#263
mcanouil merged 2 commits intomainfrom
feat/file-path-completion

Conversation

@mcanouil
Copy link
Copy Markdown
Owner

Summary

  • Add file-path completion for shortcode arguments, YAML values, and element attributes when a _schema.yml declares completion.type: file with an optional extensions filter.
  • Introduce a shared filePathCompletion utility (isFilePathDescriptor, buildFilePathCompletions) that searches the workspace for matching files and builds VS Code completion items.
  • Update hasCompletableValues to recognise completion.type === "file" descriptors so that key completions chain to file suggestions automatically.
  • Replace the inline completable-values check in the YAML provider with the shared hasCompletableValues utility for consistency across all providers.
  • Add tests covering isFilePathDescriptor, hasCompletableValues with file-path descriptors, and schema round-tripping of completion.type: file.

Test plan

  • Core package tests pass (420/420, including two new schema round-trip tests).
  • VS Code extension tests pass (328/328 passing; 10 pre-existing failures in activate.test.ts unrelated to this change).
  • TypeScript compiler reports zero errors.
  • ESLint and Prettier report zero issues.
  • Manual verification: install the external extension (with updated _schema.yml declaring completion.type: file on its file argument), type {{< external , and confirm .md/.qmd files from the workspace appear in the completion list.

…and element attributes

When a _schema.yml declares completion.type: file (with optional extensions filter),
the completion providers now suggest workspace files matching the specified extensions.

- Add filePathCompletion utility with isFilePathDescriptor and buildFilePathCompletions.
- Update shortcodeCompletionProvider to offer file suggestions for path-typed arguments
  and attribute values.
- Update yamlCompletionProvider to offer file suggestions for path-typed field values.
- Update elementAttributeCompletionProvider to offer file suggestions for path-typed
  attribute values.
- Update hasCompletableValues to recognise completion.type === "file".
- Add tests for isFilePathDescriptor, hasCompletableValues, and schema round-tripping.
Replace inline completable-values check in fieldToCompletionItem with
the shared hasCompletableValues utility from schemaDocumentation.
This ensures consistent detection of file-path descriptors and
completion.values across all providers.
@mcanouil mcanouil self-assigned this Feb 16, 2026
@mcanouil mcanouil added the Type: Enhancement 💡 Issues related to enhancements, improvements, new features, or new analyses label Feb 16, 2026
@mcanouil mcanouil merged commit 171de1f into main Feb 16, 2026
7 checks passed
@mcanouil mcanouil deleted the feat/file-path-completion branch February 16, 2026 11:38
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