Skip to content

Add LSP filesystem path and proto type completions#4528

Open
stefanvanburen wants to merge 1 commit intomainfrom
svanburen/yaml-completions-followup
Open

Add LSP filesystem path and proto type completions#4528
stefanvanburen wants to merge 1 commit intomainfrom
svanburen/yaml-completions-followup

Conversation

@stefanvanburen
Copy link
Copy Markdown
Member

Quick follow-up to #4527.

Filesystem path completions for path-valued fields in buf.yaml (modules[*].path, modules[*].includes, modules[*].excludes, lint.ignore, breaking.ignore, policies[*].ignore, {lint,breaking}.ignore_only.RULE_ID) and buf.gen.yaml (plugins[*].out, inputs[*].directory, inputs[*].paths, inputs[*].exclude_paths). Reads the directory of the config file and offers matching files and directories, filtered by prefix. Directory- only keys (path, out, directory, includes, excludes) suppress file entries.

Proto type completions for buf.gen.yaml types and exclude_types sequences. Eagerly leases the workspace on first Track to make fully-qualified message, enum, and service names available; the lease is reused across subsequent Tracks to avoid running workspace.Refresh on every keystroke.

Also offer rule ID completions for policies[*].ignore_only by adding a "policies" case to bufYAMLIgnoreOnlyKeyItems that returns the union of lint and breaking rule IDs, since a policy can suppress either kind.

This should make our completions better than what yaml-language-server could provide, as the JSONSchema has no way to designate a field as a "directory" or "file" for completions.

Quick follow-up to #4527.

Filesystem path completions for path-valued fields in `buf.yaml`
(`modules[*].path`, `modules[*].includes`, `modules[*].excludes`,
`lint.ignore`, `breaking.ignore`, `policies[*].ignore`,
`{lint,breaking}.ignore_only.RULE_ID`) and `buf.gen.yaml`
(`plugins[*].out`, `inputs[*].directory`, `inputs[*].paths`,
`inputs[*].exclude_paths`). Reads the directory of the config file and
offers matching files and directories, filtered by prefix. Directory-
only keys (`path`, `out`, `directory`, `includes`, `excludes`) suppress
file entries.

Proto type completions for `buf.gen.yaml` `types` and `exclude_types`
sequences. Eagerly leases the workspace on first `Track` to make
fully-qualified message, enum, and service names available; the lease
is reused across subsequent `Track`s to avoid running
`workspace.Refresh` on every keystroke.

Also offer rule ID completions for `policies[*].ignore_only` by adding
a `"policies"` case to `bufYAMLIgnoreOnlyKeyItems` that returns the
union of lint and breaking rule IDs, since a policy can suppress
either kind.

This should make our completions better than what `yaml-language-server`
could provide, as the JSONSchema has no way to designate a field as
a "directory" or "file" for completions.
@github-actions
Copy link
Copy Markdown
Contributor

github-actions Bot commented May 7, 2026

The latest Buf updates on your PR. Results from workflow Buf CI / buf (pull_request).

BuildFormatLintBreakingUpdated (UTC)
✅ passed✅ passed✅ passed✅ passedMay 7, 2026, 3:54 PM

@stefanvanburen stefanvanburen marked this pull request as ready for review May 7, 2026 16:04
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant