Skip to content

Commit 40ffa80

Browse files
Update README.md
1 parent 4f39043 commit 40ffa80

File tree

1 file changed

+29
-13
lines changed

1 file changed

+29
-13
lines changed

README.md

Lines changed: 29 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ Compatibility Matrix:
1111

1212
| Plugin Version | IDE Version Range |
1313
|-----------------|--------------------|
14-
| 0.9.0 | IDEA 2017.1+ |
14+
| 0.9.0+ | IDEA 2017.1+ |
1515
| 0.8.0 | IDEA 2016.1+ |
1616
| 0.6.0 | IDEA 13 - IDEA 15 |
1717

@@ -27,18 +27,34 @@ Plugin page: https://plugins.jetbrains.com/plugin/8277-protobuf-support
2727

2828
### Configuration
2929

30-
The plugin does not require any further configuration.
31-
Imports for your own proto files do not work immediatly, you will see a 'File not found' notification.
32-
Each proto file which is supposed to be used in an import must be located in a source directory.
33-
34-
For gradle you can do it like this:
35-
```gradle
36-
idea {
37-
module {
38-
sourceDirs += file("${projectDir}/src/main/proto")
39-
}
40-
}
41-
```
30+
The plugin does not require configuration by default, for majority of projects it should work out of the box.
31+
32+
#### Imports
33+
34+
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.
35+
36+
In order to fix it, you should tell to plugin where is the "sources root" for your proto files.
37+
38+
There are a couple ways of doing that:
39+
40+
1. Mark directory as a source/resources root (right click on folder in project structure, "Mark forlder as...."):
41+
42+
![image](https://user-images.githubusercontent.com/4040120/28202383-c96d6f08-687d-11e7-905d-53dfcf6e0799.png)
43+
44+
2. Configure directory as source/resources folder in `maven`/`gradle` or other build system (if IDEA has support for that build system).
45+
46+
For gradle you can do it like this:
47+
```gradle
48+
idea {
49+
module {
50+
sourceDirs += file("${projectDir}/src/main/proto")
51+
}
52+
}
53+
```
54+
55+
3. You can go to plugin settings, and add source roots there (this is also useful for external imports):
56+
57+
![image](https://user-images.githubusercontent.com/4040120/28202438-0fbe29ca-687e-11e7-964a-bb1f10dfcd4f.png)
4258

4359
### Roadmap
4460

0 commit comments

Comments
 (0)