Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Use the Buf CLI as an LSP #344

Open
wants to merge 5 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
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
8 changes: 4 additions & 4 deletions .eslintrc.json
Original file line number Diff line number Diff line change
Expand Up @@ -10,10 +10,10 @@
],
"rules": {
"@typescript-eslint/naming-convention": "warn",
"@typescript-eslint/semi": "warn",
"curly": "warn",
"eqeqeq": "warn",
"no-throw-literal": "warn",
"@typescript-eslint/semi": "error",
"curly": "error",
"eqeqeq": "error",
"no-throw-literal": "error",
"semi": "off"
}
}
8 changes: 1 addition & 7 deletions .vscode-test.mjs
Original file line number Diff line number Diff line change
@@ -1,9 +1,3 @@
import { defineConfig } from "@vscode/test-cli";

export default defineConfig([
{
label: "unitTests",
files: "out/test/**/*.test.js",
workspaceFolder: "./test-workspaces/npm-buf-workspace",
},
]);
export default defineConfig([]);
9 changes: 7 additions & 2 deletions .vscodeignore
Original file line number Diff line number Diff line change
@@ -1,11 +1,16 @@
.github/**
.vscode/**
.vscode-test/**
out/test/**
src/**
test-workspaces/**
.envrc
.gitignore
.yarnrc
vsc-extension-quickstart.md
.eslintrc.json
.vscode-test.mjs
**/tsconfig.json
**/.eslintrc.json
**/*.map
**/*.ts
**/*.md
**/Makefile
61 changes: 61 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,61 @@
# Changelog

## [Unreleased]

- `buf beta lsp` support.

## [v0.6.2]

- Reintroduce relative binary path support.

## [v0.6.1]

- Revert relative binary path support.

## [v0.6.0]

- Support relative binary path.

## [v0.5.3]

- Add syntax highlighting for `.proto` files.

## [v0.5.2]

- Fix lint highlighting issue outside of the current file.

## [v0.5.1]

- Fix an issue with setting `buf format` as the default formatter for `proto3` files.

## [v0.5.0]

- Add formatting through using `buf format`. Defaults to format on save.

## [v0.4.0]

- Use single file reference to resolve lint file from any path.

## [v0.3.1]

- Accept `v1.0.0-rc1` in version parser.

## [v0.3.0]

- Change `--version` to read from both `stdout` and `stderr`.

## [v0.2.0]

- Update minimum required version to `v0.34.0`.

## [v0.1.3]

- Update logo.

## [v0.1.0]

- Add version check and download link.

## [v0.0.3]

- Fix missing generation command.
65 changes: 19 additions & 46 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,58 +2,31 @@

## Installation

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.
[Install the latest version via the VSCode marketplace.](https://marketplace.visualstudio.com/items?itemName=bufbuild.vscode-buf)

To install manually (or to install an unreleased version), clone this
repository, run `make`, and then install the resulting `vscode-buf-<version>.vsix`
with

```console
$ code --install-extension `vscode-buf-<version>.vsix`
```

## Features

- Lints your protobuf files using `buf lint`. It checks your currently opened file
whenever you save it.
- Syntax highlighting for `.proto` files, including semantic highlighting.

![Lint errors](./lint_errors.png)
- Linting via `buf lint` and `buf breaking`.

- Formats your protobuf files using `buf format`.
- Formatting via `buf format`.

- Provides syntax highlighting for `.proto` files.
- Go to definition and documentation insets for `.proto` symbols.

## Requirements

- [buf](https://docs.buf.build/installation)

## 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`.

## Changelog

- v0.6.2
- Reintroduce relative binary path support.
- v0.6.1
- Revert relative binary path support.
- v0.6.0
- Support relative binary path.
- v0.5.3
- Add syntax highlighting for `.proto` files.
- v0.5.2
- Fix lint highlighting issue outside of the current file.
- v0.5.1
- Fix an issue with setting buf format as the default formatter for proto3 files.
- v0.5.0
- Add formatting through using buf format. Defaults to format on save.
- v0.4.0
- Use single file reference to resolve lint file from any path
- v0.3.1
- Accept v1.0.0-rc1 in version parser
- v0.3.0
- Change `--version` to read from both `stdout` and `stderr`
- v0.2.0
- Update minimum required version to v0.34.0
- v0.1.3
- Update logo
- v0.1.0
- Add version check and download link
- v0.0.3
- Fix missing generation command
You do not need to have `buf` installed; the extension will install it for
you automatically. You must, however, be on a platform that Buf ships releases
for, which can be found at https://github.com/bufbuild/buf/releases.

You can also have the extension use a locally-installed version of the `buf`
tool, instead.
Loading
Loading