feat: add file-path completion for schema-typed path arguments#263
Merged
feat: add file-path completion for schema-typed path arguments#263
Conversation
…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.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
_schema.ymldeclarescompletion.type: filewith an optionalextensionsfilter.filePathCompletionutility (isFilePathDescriptor,buildFilePathCompletions) that searches the workspace for matching files and builds VS Code completion items.hasCompletableValuesto recognisecompletion.type === "file"descriptors so that key completions chain to file suggestions automatically.hasCompletableValuesutility for consistency across all providers.isFilePathDescriptor,hasCompletableValueswith file-path descriptors, and schema round-tripping ofcompletion.type: file.Test plan
activate.test.tsunrelated to this change).externalextension (with updated_schema.ymldeclaringcompletion.type: fileon itsfileargument), type{{< external, and confirm.md/.qmdfiles from the workspace appear in the completion list.