Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
27 commits
Select commit Hold shift + click to select a range
65613f4
Spiritual successor to mcy/lsp.
christogav Apr 1, 2025
97ff9e0
Push package-lock.json.
christogav Apr 1, 2025
9e9308b
Fix: load buf modules not running on extension start.
christogav Apr 5, 2025
8f0f3f1
Merge branch 'main' into christogav/lsp
christogav Apr 8, 2025
8f93b86
Push package-lock.json
christogav Apr 8, 2025
228f12c
Fix missing semver types.
christogav Apr 8, 2025
40fd61e
npm run format
christogav Apr 8, 2025
08080b4
lint: rename files
christogav Apr 8, 2025
bd6d0b1
(es)lint: fixes
christogav Apr 8, 2025
9071ecf
Fix tests.
christogav Apr 8, 2025
5f99ba2
PR feedback:
christogav Apr 9, 2025
75bf1d2
Ensure specific version is found and used if set in config.
christogav Apr 9, 2025
15de155
Simplify testing - decouple some dependencies and intro stub/mocks.
christogav Apr 10, 2025
226374a
Tidy command descriptions.
christogav Apr 16, 2025
c32d2cc
If we can acquire a github token - use one to avoid being rate limite…
christogav Apr 24, 2025
d4fac39
Fix extension management of buf by path, version or attempt to find o…
christogav Apr 28, 2025
9372c76
Add warning when both buf.commandLine.path and buf.commandLine.versio…
christogav Apr 28, 2025
79f9bde
Move out command types to avoid circular dependency and simplify inde…
christogav Apr 28, 2025
8b79352
Remove commands from being exported in index.
christogav Apr 28, 2025
b6c8bd4
Support relative buf.commandLine.path.
christogav Apr 30, 2025
23acd03
Remove extra assertion failing - adds no value.
christogav Apr 30, 2025
faed790
Bump @vscode/test-electron to avoid installation issue found in https…
christogav May 1, 2025
4dbcae3
Merge branch 'main' into christogav/lsp
May 14, 2025
26605d8
Merge branch 'main' into christogav/lsp
christogav May 20, 2025
51892ae
Fix version handling per PR feedback.
christogav May 20, 2025
574902e
Remove `buf.remove` as no longer neccessary based on how we handle ve…
christogav May 20, 2025
65f950f
Bump version and improve the README.
christogav May 20, 2025
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
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -4,3 +4,4 @@ node_modules
.vscode-test/
*.vsix
.env/
.user-data-dir-test
20 changes: 16 additions & 4 deletions .vscode/launch.json
Original file line number Diff line number Diff line change
Expand Up @@ -9,20 +9,32 @@
"name": "Run Extension",
"type": "extensionHost",
"request": "launch",
"args": ["--extensionDevelopmentPath=${workspaceFolder}"],
"args": [
"--disable-extensions",
"--extensionDevelopmentPath=${workspaceFolder}"
],
"outFiles": ["${workspaceFolder}/out/**/*.js"],
"preLaunchTask": "${defaultBuildTask}"
"preLaunchTask": "npm: watch"
},
{
"name": "Extension Tests",
"type": "extensionHost",
"request": "launch",
"runtimeExecutable": "${execPath}",
"args": [
"--disable-extensions",
"--profile-temp",
"--extensionDevelopmentPath=${workspaceFolder}",
"--extensionTestsPath=${workspaceFolder}/out/test/suite/index"
"--extensionTestsPath=${workspaceFolder}/out/test/unit/index",
"--user-data-dir=${workspaceFolder}/extension/.user-data-dir-test",
"--timeout",
"999999"
],
"outFiles": ["${workspaceFolder}/out/test/**/*.js"],
"preLaunchTask": "${defaultBuildTask}"
"sourceMaps": true,
"smartStep": true,
"preLaunchTask": "npm: watch",
"cwd": "${workspaceFolder}/extension"
}
]
}
1 change: 1 addition & 0 deletions .vscode/tasks.json
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@
"version": "2.0.0",
"tasks": [
{
"label": "npm: watch",
"type": "npm",
"script": "watch",
"problemMatcher": "$tsc-watch",
Expand Down
92 changes: 78 additions & 14 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,34 +1,98 @@
# Buf for Visual Studio Code

## Installation
The [VS Code Buf extension](https://marketplace.visualstudio.com/items?itemName=bufbuild.vscode-buf) provides rich support for [Protocol Buffers](https://protobuf.dev/) using the [Buf](https://buf.build/) development environment.

Install via the Visual Studio Code extension browser or see
[the extension page](https://marketplace.visualstudio.com/items?itemName=bufbuild.vscode-buf)
for detailed installation instructions.

## Features
## Requirements

- Lints your protobuf files using `buf lint`. It checks your currently opened file
whenever you save it.
* Visual Studio Code
* A [Buf](https://buf.build/) configuration environment.

![Lint errors](./lint_errors.png)
## Getting Started

- Formats your protobuf files using `buf format`.
The Buf CLI is the ultimate tool for modern, fast, and efficient Protobuf API management. Getting started is simple!

- Provides syntax highlighting for `.proto` files.
1. Install the [VS Code Buf extension](https://marketplace.visualstudio.com/items?itemName=bufbuild.vscode-buf).
2. Create a [buf.yaml](https://buf.build/docs/cli/#default-configuration) in the root of your workspace.
3. Open any Protobuf file to automatically activate the extension. A Buf status bar appears in the bottom right corner of the window.
4. The extension depends on the [Buf CLI](https://buf.build/docs/cli/). If a Buf binary is not found in your path, the extension will attempt to install the latest release from Github.

## Requirements
## Features

- [buf](https://docs.buf.build/installation)
- **Code navigation** - Jump to or peek at a symbol's declaration.
- **Syntax highlighting** - Protobuf specific color and styling of code.
- **Code editing** - Support for formatting and linting.
- **Buf command support** - Execution of Buf CLI commands e.g. [Buf Generate](https://buf.build/docs/generate/tutorial/).

## Extension Settings

This extension contributes the following settings:

- `buf.binaryPath`: configure the path to your buf binary. By default it uses `buf` in your `$PATH`.
### buf.commandLine.path

Default: `null`

The path to a specific install of Buf to use. Relative paths are supported and are relative to the workspace root.

> If not set and `buf.commandLine.version` is also not set, the extension will attempt to find a os-specific Buf binary on the path.

### buf.commandLine.version

Default: `null`

Specific version (git tag e.g. 'v1.53.0') of Buf release to download and install.

### buf.restartAfterCrash

Default: `true`

Automatically restart Buf (up to 4 times) if it crashes.

### buf.checkUpdates

Default: `true`

Check for language server updates on startup.

### buf.enableHover

Default: `true`

Enable hover features provided by the language server.

### buf.enable

Default: `true`

Enable Buf language server features.

### buf.debug

Default: `false`

Enable debug mode.

### buf.log-format

Default: `text`

Buf language server log format.

### buf.checks.breaking.againstStrategy

Default: `git`

The strategy to use when checking breaking changes against a specific reference.

### buf.checks.breaking.againstGitRef

Default: `refs/remotes/origin/HEAD`

The Git reference to check breaking changes against.

## Changelog

- v0.8.0
- Improve overall editor functionality, using Buf Language Server.
- v0.7.2
- Fix issue with `buf` commands returning an unexpected error on exec.
- v0.7.1
Expand Down
Loading