Giter Site home page Giter Site logo

bufbuild / intellij-buf Goto Github PK

View Code? Open in Web Editor NEW
15.0 16.0 2.0 1.79 MB

IntelliJ plugin for Buf

Home Page: https://plugins.jetbrains.com/plugin/19147-buf-for-protocol-buffers

License: Apache License 2.0

Kotlin 96.16% HTML 0.14% Python 3.70%
intellij plugin

intellij-buf's Introduction

Buf Support for IntelliJ Platform

Build Version Downloads

This plugin extends Protocol Buffer support in the IDE by integrating with Buf.

Buf CLI provides advanced linting and detection of potentially breaking changes in your Proto messages and services. Integration with Buf Schema Registry helps manage, discover and share API definitions.

Development Guide

Please submit bug reports and feature requests via GitHub Issues and don't hesitate to contribute via PRs.

Running tests

Once you have Buf CLI installed locally just run ./gradlew test in your terminal or open the project in IntelliJ and use Run Tests run configuration.

Running the plugin

In order to run the plugin from sources either run ./gradlew runIde in your terminal or open the project in IntelliJ and use Run Plugin run configuration.

Distributing the plugin

To build a local distribution of the plugin which can be shared run ./gradlew buildPlugin from your terminal and use build/distributions/intellij-buf-*.zip for sharing and installing from disk.

Publishing the plugin

Process of publishing the plugin to JetBrains Marketplace is automated via GitHub Releases:

  • Update pluginVersion in gradle.properties.
  • Add a new entry to CHANGELOG.md for the new version.
  • Create a GitHub Release which will automatically submit the plugin for a review.
  • After the review, which can take a day or two, the plugin will be available on JetBrains Marketplace.

intellij-buf's People

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Forkers

pqn devkanro

intellij-buf's Issues

Auto-import support for remote packages

Auto-import of messages is not working in Webstorm with remote packages. Users would like to be able to enter a message name and have Webstorm auto-import the full name without having to manually type it.

Note: This is also an issue in VS Code as well: bufbuild/vscode-buf#206

Automatically run `buf generate` when proto files are edited

One of the biggest points of developer friction when working with protos is regenerating stubs after changing the protos. As quick as the Buf generator is, it would make a lot of sense for it to be automatically run any time proto files in its workspace are modified.

Example workflow:

  1. Developer is implementing a gRPC method in a Node server
  2. Realizes a field is missing from the request proto
  3. Opens the proto file and add the new field
  4. Saves the proto file
  5. Switches back to the server code implementing the gRPC method
  6. The server code is now aware of the new field and can use it

Without this feature, developers need an extra step between 4 and 5 to manually re-run the buf generate command. It's not super time-consuming, but it's extra friction and context switching that can break flow.

Related: I've filed the same request for the VSCode plugin as bufbuild/vscode-buf#187

Register BUF configuration schemas

Hi, I am working on integrating buf and installed the intellij plugin. I suggest that the plugin is updated to register the JSON schemas for the yaml files - so these are validated by the IDE.

Reformat Code on proto file introduces newlines at 8192 char intervals

When a proto file larger than 8192 chars has Reformat Code run, newlines are introduced after each 8192 chars.

This does not happen to the file when buf format is run on the same file.

This obviously can break the syntax of the proto file in various ways, which subsequently breaks protoc compilation and future buf format executions.

In the latter case, there's an additional issue that a Reformat Code run on a file with invalid syntax fails and clears the IntelliJ editor buffer.
(e.g. buf format would report a Failure: filename.proto:245:8: syntax error)

It looks like the output of buf format is being read from stdout and joined with separating newlines at https://github.com/bufbuild/intellij-buf/blob/main/src/main/kotlin/build/buf/intellij/formatter/BufFormatterService.kt#L66 , when in this case it should probably just be concatenated verbatim without separators.

buf.lock dependencies not resolving

I'm using Goland (2022.2) with buf 1.7.0 and non-well-known-types are not resolving and show an error, even though . Unlike #37, well known types work just fine. Running buf build and buf generate work as expected with no errors, and the generated code uses the date package. This is my first time importing an external dependency, so I am not sure if this worked before or not.

conversation here: https://bufbuild.slack.com/archives/CRZ680FUH/p1661382658841319

image

image

Here's a barebones example that I believe should reproduce the issue, though I haven't tested it locally.

syntax = "proto3";

package billing;

import "google/type/date.proto";
import "google/protobuf/timestamp.proto";

message Test
  google.type.Date date = 1;
  google.protobuf.Timestamp timestamp = 2;
}

buf.yaml

version: v1
build:
  excludes:
    - bazel-bin
    - bazel-go.nozzle.io
    - bazel-out
    - bazel-testlogs

deps:
 - buf.build/googleapis/googleapis

lint:
  use:
    - DEFAULT
breaking:
  use:
    - FILE

buf.gen.yaml

version: v1
managed:
  enabled: true
  go_package_prefix:
    default: go.nozzle.io
    except:
      - buf.build/googleapis/googleapis
plugins:
  - name: go
    out: .
    opt: paths=source_relative
  - name: go-grpc
    out: .
    opt:
      - paths=source_relative
      - require_unimplemented_servers=false
  - name: go-json
    out: .
    opt:
      - paths=source_relative
      - enums_as_ints=false
      - emit_defaults=false
      - orig_name=false
      - allow_unknown=false

buf.lock

version: v1
deps:
  - remote: buf.build
    owner: googleapis
    repository: googleapis
    commit: 80720a488c9a414bb8d4a9f811084989

Error using Buf plugin in IntelliJ 2023.2

I'm seeing this error logged after upgrading to IntelliJ 2023.2:

com.intellij.diagnostic.PluginException: No display name is specified for configurable build.buf.intellij.configurable.BufConfigurable in xml file;
specify it using 'displayName' or 'key' attribute to avoid necessity to load the configurable class when Settings dialog is opened [Plugin: com.github.bufbuild.intellij]

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.