Giter VIP home page Giter VIP logo

protobuf-jetbrains-plugin's Introduction

Protobuf Support for JetBrains IDEs

Join the chat at https://gitter.im/protostuff/protobuf-jetbrains-plugin

Protobuf Support Plugin for IntelliJ IDEA & other JetBrains products.

Latest plugin release is compatible with IntelliJ IDEA 2017.1 (older releases are compatible with IDEA 13+). Other JetBrains IDEs of the same or higher version should be supported as well.

Compatibility Matrix:

Plugin Version IDE Version Range
0.9.0+ IDEA 2017.1+
0.8.0 IDEA 2016.1+
0.6.0 IDEA 13 - IDEA 15

Installation

IntelliJ IDEA should suggest you to install plugin automatically when you open .proto file. You can install plugin manually by opening "Plugins" settings, "Browse repositories..." - search for "Protobuf Support".

Plugin page: https://plugins.jetbrains.com/plugin/8277-protobuf-support

Configuration

The plugin does not require configuration by default, for majority of projects it should work out of the box.

Imports

If you see 'File not found' error mark for the import statement, it means plugin cannot resolve target file within current set of source (or resource) roots.

In order to fix it, you should tell to plugin where is the "sources root" for your proto files.

There are a couple ways of doing that:

  1. Mark directory as a source/resources root (right click on folder in project structure, "Mark forlder as...."):

image

  1. Configure directory as source/resources folder in maven/gradle or other build system (if IDEA has support for that build system).

    For gradle you can do it like this:

    idea {
        module {
            sourceDirs += file("${projectDir}/src/main/proto")
        }
    }

    for maven, you can add as a resource directory:

    <?xml version="1.0" encoding="UTF-8"?>
    <project xmlns="http://maven.apache.org/POM/4.0.0"
             xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
             xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
    
        <modelVersion>4.0.0</modelVersion>
    
        <groupId>groupId</groupId>
        <artifactId>artifactId</artifactId>
        <version>1.0.0-SNAPSHOT</version>
    
        <dependencies>
          ...
        </dependencies>
    
        <build>
            <resources>
                <resource>
                    <directory>src/main/proto</directory>
                </resource>
            </resources>
        </build>
    </project>
  2. You can go to plugin settings, and add source roots there (this is also useful for external imports):

    image

Roadmap

https://github.com/protostuff/protobuf-jetbrains-plugin/wiki/Roadmap

Build

Run following command in the shell:

./gradlew build

It should be possible to run build on any platform (Linux, Windows, MacOS) where Gradle is supported.

JDK 8 must be installed and available on PATH in order to build plugin.

Run IntelliJ IDEA with enabled plugin (for development)

./gradlew runIdea

Screenshots

image

protobuf-jetbrains-plugin's People

Contributors

bhdrk avatar gitter-badger avatar kshchepanovskyi avatar songtm avatar

Watchers

 avatar

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.