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

Can't access sources. #38

Closed
TheMasteredPanda opened this issue Nov 21, 2017 · 5 comments
Closed

Can't access sources. #38

TheMasteredPanda opened this issue Nov 21, 2017 · 5 comments

Comments

@TheMasteredPanda
Copy link

TheMasteredPanda commented Nov 21, 2017

Apache Maven 3.5.0
Java version: 1.8.0_151, vendor: Oracle Corporation
Default locale: en, platform encoding: UTF-8
OS name: "linux", version: "4.13.0-kali1-amd64", arch: "amd64", family: "unix"
IDE: IntelliJ Ultimate 2017.2.6

Problem: The sources are generated but I cannot use them. For example, I can't extend the base implementation when making a new service. I really don't know what the problem is.

My .proto file:

syntax = "proto3";

package me.tmp.grpc.server.generated;

option java_multiple_files = true;

service GRPCTestService {
    rpc greet(HelloRequest) returns (HelloResponse);
}

message HelloRequest {
    string name = 1;
}

message HelloResponse {
    string message = 1;
}

The output: https://gist.github.com/TheMasteredPanda/13139c44536d32d9a36614b150639b20

@sergei-ivanov
Copy link
Member

I am not sure that I understand the problem. Are sources being generated or not?

@TheMasteredPanda TheMasteredPanda changed the title Not generating source. Can't access sources. Nov 21, 2017
@TheMasteredPanda
Copy link
Author

Hey, @sergei-ivanov, apologizes for the confusion. The sources are being generated, I just cant access them.

@TheMasteredPanda
Copy link
Author

Proof that they have been generated: https://gyazo.com/cca1e51bdede7fb5b2c84df7d78c42e9
My pom.xml too: https://gist.github.com/TheMasteredPanda/55d55b1baee53e21eb573b83180efd30

Thing is I cannot extend any of these generated classes. I really don't understand why.

@sergei-ivanov
Copy link
Member

Looks like the output folders are not marked as source folders in IDEA. Normally it is quite good at automatically detecting them, but sometimes needs a nudge. Try either running "refresh" action in the maven projects window, or "detect source directories" (or whatever it is called, there is a button on the maven panel toolbar). Check that there is automatic detection of generated sources configured in maven settings in IDEA. Failing all that, right-click on the directories in the project tree and select "mark directory as > source folder".

@TheMasteredPanda
Copy link
Author

That done it, thanks @sergei-ivanov!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

No branches or pull requests

2 participants