Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
34 commits
Select commit Hold shift + click to select a range
25fdf73
Remove settings, other than debug logs from the extension
doriable Nov 18, 2025
889d980
Fix test releases URL
doriable Nov 19, 2025
258edb5
Address comments
doriable Nov 19, 2025
d898ddf
Adjust test conditions
doriable Nov 19, 2025
b37623e
Fix linux tests
doriable Nov 19, 2025
56a3efe
Fix test condition
doriable Nov 19, 2025
c61f4b9
Change artifact name for playwright results
doriable Nov 19, 2025
15535a8
Update README
doriable Nov 19, 2025
fb0f498
Update feature list to match docs
doriable Nov 19, 2025
a2a26d9
Address comments.
doriable Nov 19, 2025
c0c0409
Use single quotes in yaml
doriable Nov 19, 2025
6ce4ac0
Temporarily disable playwright tests when buf is not on the system $PATH
doriable Nov 20, 2025
8bf9e73
Add shared module in tests for mock server and use in playwright
doriable Nov 21, 2025
3ae28aa
Fix formatting
doriable Nov 21, 2025
e84f0e8
Address README changes
doriable Nov 21, 2025
291e3f4
Remove configurations from package.json
doriable Nov 21, 2025
2e70074
Merge remote-tracking branch 'origin/main' into BSR-6071-remove-configs
doriable Nov 24, 2025
7eba0bd
Merge remote-tracking branch 'origin/main' into BSR-6071-remove-configs
doriable Nov 24, 2025
6cb8942
Lengthen playwright test timeout
doriable Nov 24, 2025
7aa2ffd
Apply suggestions from code review
doriable Nov 25, 2025
4563ca8
Use playwright global setup/teardown
doriable Nov 25, 2025
55d9291
Update README.md
doriable Dec 2, 2025
e416567
Merge remote-tracking branch 'origin/main' into BSR-6071-remove-configs
doriable Dec 5, 2025
f8547ac
Disable playwright tests when buf is not installed on system $PATH
doriable Dec 5, 2025
1d67398
Fix
doriable Dec 5, 2025
c98034f
Rewrite README and remove extraneous commands.
doriable Dec 8, 2025
8cb271d
Merge remote-tracking branch 'origin/main' into BSR-6071-remove-configs
doriable Dec 8, 2025
6d6bf4c
WIP
doriable Dec 15, 2025
b146e76
Readme edits
doriable Dec 15, 2025
8f0f644
Code review suggestions
doriable Dec 16, 2025
d804f2b
Merge remote-tracking branch 'origin/main' into BSR-6071-remove-configs
doriable Dec 16, 2025
0dfecde
Move "community and support" after "commands"
doriable Dec 19, 2025
522e3a8
Merge remote-tracking branch 'origin/main' into BSR-6071-remove-configs
doriable Dec 23, 2025
be6a54a
Update README.md
doriable Jan 8, 2026
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
16 changes: 14 additions & 2 deletions .github/workflows/build.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,9 @@ jobs:
- macos-latest
- ubuntu-latest
- windows-latest
buf-bin-setup:
- buf-on-path
- buf-not-on-path
runs-on: ${{ matrix.os }}
steps:
- name: checkout
Expand All @@ -19,6 +22,7 @@ jobs:
node-version-file: ".nvmrc"
cache: npm
- uses: bufbuild/buf-action@v1
if: matrix.buf-bin-setup == 'buf-on-path'
with:
setup_only: true
- name: install-deps
Expand All @@ -32,24 +36,32 @@ jobs:
- name: format
run: npm run format
- name: integration-tests-with-xvfb
env:
BUF_INSTALLED: ${{ matrix.buf-bin-setup }}
run: xvfb-run -a npm run test:integration
if: runner.os == 'Linux'
- name: integration-tests
shell: bash
env:
BUF_INSTALLED: ${{ matrix.buf-bin-setup }}
run: npm run test:integration
if: runner.os != 'Linux'
- name: playwright-tests
run: npm run test:playwright
# Limiting playwright tests to macOS for now due to issues with xvfb on Linux and
# timeouts on windows
if: runner.os == 'macOS'
#
# NOTE: We disable playwright tests when buf is not installed on the system $PATH
# for now so we don't have the extension attempting to resolve the installation.
# We'll need to find a way to intercept the call from playwright's VS Code extension.
if: runner.os == 'macOS' && matrix.buf-bin-setup == 'buf-on-path'
- name: check diff
run: node scripts/gh-diffcheck.mjs
- name: upload-playwright-test-results
uses: actions/upload-artifact@v4
if: always()
with:
name: test-results
name: test-results-${{ matrix.buf-bin-setup }}
path: test-results/
retention-days: 5
if-no-files-found: ignore
137 changes: 51 additions & 86 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,122 +1,87 @@
# Buf for Visual Studio Code

The [VS Code Buf extension][vs-code-marketplace] helps you work with [Protocol Buffers][protobuf]
files in a much more intuitive way, adding smart syntax highlighting, navigation, formatting,
files in a much more intuitive way, adding semantic syntax highlighting, navigation, formatting,
documentation and diagnostic hovers, and integrations with [Buf][buf] commands.

## Features

- **Code navigation** - Go-to definition and documentation insets for `.proto` symbols.
- **Syntax highlighting** - Protobuf specific color and styling of code.
- **Code editing** - Formatting via `buf format` and annotations and hovers based on `buf lint`.
- **Documentation hovers** - Documentation for definitions when hovering a reference.
- **Buf command support** - Execution of `buf` CLI commands via the [Command Palette][command-palette].
- **Code navigation and documentation hovers**: Jump to or quickly glance a message or
service's definition.
- **Autocompletion**: Get code completion as you type through [IntelliSense][intellisense].
- **Formatting**: Formats `.proto` files on-save.
- **Syntax highlighting**: Code styling that provides clarity on Protobuf keywords and identifiers.
- **Diagnostics**: Get highlights and feedback on build and lint errors as you code.

![Preview features](./preview.gif)

## Getting Started

[Install the latest version via the VS Code marketplace][vs-code-marketplace].

By default, the extension will use your locally-installed version of `buf` on your system
`$PATH`. However, you don't have to install `buf` - the extension can manage and install it
for you based on the [buf.commandLine.path](#buf.commandline.path) and [buf.commandLine.version](#buf.commandline.version)
configurations:

| | <pre>buf.commandLine.path</pre> | <pre>buf.commandLine.version</pre> |
| --- | --- | --- |
| Default: Use `buf` from the system `$PATH`. | {empty} | {empty} |
| Use the latest released version of `buf` and check for updates on extension activation. | {empty} | `latest` |
| Use `buf` at specified path. | User specified path | {empty} |
| Install and use the specified version of `buf`. | {empty} | User specified semver version |
| Use `buf` at specified path and display an error message. | User specified path | User specified semver version |

## Extension Settings

This extension contributes the following configuration settings.

### buf.commandLine.path

Default: `null`
The path to a specific install of Buf to use. Relative paths are supported and are relative to the VS Code workspace root.
This extension doesn't stop at editing: open the [Command Palette][command-palette] (`Ctrl/Cmd+Shift+P`)
to quickly run common `buf` tasks such as `buf generate`. See the [full list of commands](#commands) for more.

### buf.commandLine.version

Default: `null`
Specific version (e.g. 'v1.53.0') of Buf release to download and install.
## Getting Started

### buf.restartAfterCrash
This extension requires Visual Studio Code 1.95 or newer (or editors compatible with VS Code 1.95+ APIs).

Default: `true`
Automatically restart the Buf Language Server (up to 4 times) if it crashes.
1. [Install the latest version via the VS Code marketplace][vs-code-marketplace].
2. Start editing `.proto` files!

### buf.enableHover
This extension does not require you to have the Buf CLI already installed. By default, the extension uses
the Buf CLI from your system `$PATH`. If `buf` isn't found on your `$PATH`, the extension automatically
downloads and installs the latest version to its own storage directory.

Default: `true`
Enable hover features provided by the language server.
## Commands

### buf.enable
A full list of [Command Palette][command-palette] commands provided by this extension:

Default: `true`
Enable Buf Language Server features.
- Start Buf Language Server: starts the Buf Language Server. If the Buf Language Server is
already running, it will stop and then start it.

### buf.debug
- Stop Buf Language Server: stops the Buf Language Server. If the Buf Language Server is not
currently running, then it is a no-op.

Default: `false`
Enable debug logs in output channels.
- Build: runs `buf build` with optional user input for the build output file. If the build
output is specified by the user, it will be created at the root of each VS Code workspace.

### buf.log-format
- Init: runs `buf config init` at the root of each VS Code workspace. This creates a `buf.yaml` file
to help users get started with Buf modules and workspaces.

Default: `text`
Buf Language Server log format.
- List available breaking change detection rules: runs `buf config ls-breaking-rules` at the
root of each VS Code workspace and provides a list of available [breaking change detection rules][breaking-rules]
in a VS Code editor window.

## Commands
- List available lint rules: runs `buf config ls-lint-rules` at the root of each VS Code workspace
and provides a list of available [lint rules][lint-rules] in a VS Code editor window.

This extension contributes the following commands to the [Command Palette][command-palette].
- Prune module dependencies: runs `buf dep prune` at the root of each VS Code workspace and
prunes unused dependencies from the `buf.lock` file(s).

### Setup
- Update module dependencies: runs `buf dep update` at the root of each VS Code workspace and
updates the dependencies in the `buf.lock` file(s).

- Install CLI: installs the `buf` CLI based on `buf.commandLine.path` and `buf.commandLine.version`
configurations and then attempts to start the language server.
- Update CLI: updates the `buf` CLI based on `buf.commandLine.path` and `buf.commandLine.version`
configurations and then attempts to start the language server.
- Generate: runs `buf generate` at the root of each VS Code workspace and generates code based
on the `buf.gen.yaml` file(s).

### Language Server
- Show Buf Output: shows the extension output channel.

- Start Buf Language Server: starts the Buf Language Server. If the Buf Language Server is
already running, it will stop and then start it.
- Stop Buf Language Server: stops the Buf Language Server. If the Buf Language Server is not
currently running, then it is a no-op.
## Community and Support

### Buf
Feedback is welcome and appreciated! For feature requests, bugs, or questions, please
[file an issue][issue].

- Build: runs `buf build` with an optional user input for the build output.
- Init: runs `buf config init` at the root of each VS Code workspace. This creates a `buf.yaml` file
to help users get started with Buf modules and workspaces.
- List available breaking change detection rules: lists the breaking change detection rules
that are available.
- List available lint rules: lists the lint rules that are available.
- Prune module dependencies: prunes unused dependencies from the `buf.lock` at the root of
each VS Code workspace.
- Update module dependencies: updates the dependencies in `buf.lock` at the root of each
VS Code workspace.
- Generate: runs `buf generate` at the root of each VS Code workspace.
- List module files: lists the Protobuf definition files for the Buf module/workspace at the
root of each VS Code workspace.
- Price of BSR paid plans: provides the pricing information for Buf Schema Registry (BSR)
for each VS Code workspace.
- Module stats: provides Buf module/workspace stats at the root of each VS Code workspace.

### Extension

- Show Buf Output: shows the extension output channel
If you're looking for help and/or discussion around Protobuf, best practices, etc., join us
on [Slack][slack].

## Legal

Offered under the [Apache 2 license][license].

[command-palette]: https://code.visualstudio.com/docs/getstarted/userinterface#_command-palette
[vs-code-marketplace]: https://marketplace.visualstudio.com/items?itemName=bufbuild.vscode-buf
[protobuf]: https://protobuf.dev/
[buf]: https://buf.build/
[breaking-rules]: https://buf.build/docs/breaking/rules
[command-palette]: https://code.visualstudio.com/docs/getstarted/userinterface#_command-palette
[issue]: https://github.com/bufbuild/vscode-buf/issues/new/choose
[intellisense]: https://code.visualstudio.com/docs/editing/intellisense
[license]: https://github.com/bufbuild/vscode-buf/blob/main/LICENSE
[lint-rules]: https://buf.build/docs/lint/rules
[protobuf]: https://protobuf.dev/
[slack]: https://buf.build/links/slack
[vs-code-marketplace]: https://marketplace.visualstudio.com/items?itemName=bufbuild.vscode-buf
97 changes: 2 additions & 95 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -75,12 +75,6 @@
"icon": "$(list-unordered)",
"title": "List available lint rules."
},
{
"command": "buf.configlsmodules",
"category": "Buf",
"icon": "$(folder-library)",
"title": "List modules in workspace."
},
{
"command": "buf.depprune",
"category": "Buf",
Expand All @@ -102,34 +96,6 @@
"title": "Generate",
"description": "Run `buf generate` across VS Code workspace(s)."
},
{
"command": "buf.lsfiles",
"category": "Buf",
"icon": "$(files)",
"title": "List module files.",
"description": "List module files across VS Code workspace(s)."
},
{
"command": "buf.price",
"category": "Buf",
"icon": "$(briefcase)",
"title": "Price for BSR paid plans.",
"description": "Check the price of BSR paid plans across VS Code workspace(s)."
},
{
"command": "buf.stats",
"category": "Buf",
"icon": "$(graph-line)",
"title": "Module stats",
"description": "Get stats for Buf modules across VS Code workspace(s)."
},
{
"command": "buf.install",
"category": "Buf",
"icon": "$(cloud-download)",
"title": "Install CLI",
"description": "Install the Buf CLI from GitHub releases."
},
{
"command": "buf.showOutput",
"category": "Buf",
Expand All @@ -147,74 +113,15 @@
"category": "Buf",
"icon": "$(debug-stop)",
"title": "Stop Buf Language Server"
},
{
"command": "buf.update",
"category": "Buf",
"icon": "$(sync)",
"title": "Update CLI",
"description": "Check for updates and install the latest version of the Buf CLI."
}
],
"configuration": {
"title": "Buf",
"properties": {
"buf.commandLine.path": {
"type": "string",
"description": "The path to a specific install of Buf to use. Relative paths are supported and are relative to the workspace root."
},
"buf.commandLine.version": {
"type": "string",
"description": "Specific version (git tag e.g. 'v1.53.0') of Buf release to download and install."
},
"buf.restartAfterCrash": {
"type": "boolean",
"default": true,
"description": "Automatically restart Buf (up to 4 times) if it crashes."
},
"buf.enableHover": {
"type": "boolean",
"default": true,
"description": "Enable hover features provided by the language server."
},
"buf.enable": {
"type": "boolean",
"default": true,
"description": "Enable Buf language server features."
},
"buf.debug": {
"buf.debugLogs": {
"type": "boolean",
"default": false,
"description": "Enable debug mode."
},
"buf.log-format": {
"type": [
"string",
"null"
],
"enum": [
"text",
"color",
"json"
],
"default": "text",
"description": "Buf language server log format."
},
"buf.checks.breaking.againstStrategy": {
"type": "string",
"enum": [
"disk",
"git"
],
"default": "git",
"description": "The strategy to use when checking breaking changes against a specific reference.",
"deprecationMessage": "Deprecated: breaking change detection is no longer supported in the LSP."
},
"buf.checks.breaking.againstGitRef": {
"type": "string",
"default": "refs/remotes/origin/HEAD",
"description": "The Git reference to check breaking changes against.",
"deprecationMessage": "Deprecated: breaking change detection is no longer supported in the LSP."
"description": "Enable debug logs for the Buf language server."
}
}
},
Expand Down
3 changes: 2 additions & 1 deletion playwright.config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -13,8 +13,9 @@ export default defineConfig<TestOptions>({
reporter: process.env.CI ? "html" : "list",
timeout: 120_000_000,
expect: {
timeout: 40_000,
timeout: 60_000,
},
globalSetup: "./test/playwright/global-setup",
projects: [
{
name: "VS Code insiders",
Expand Down
Loading
Loading