Since the .proto files that contain the descriptions of your data structures are text files, you can open them with any text editor. However, it's a lot easier if you have syntax highlighting. And it would be nice if your editor also detects errors such as misspelling a message type or using a field number twice.
In this article I will compare different editors.
JetBrains is a company that produces IDEs for many different programming lanuages. Some of them have a free edition, such as IntelliJ IDEA (Java/Kotlin) and PyCharm (Python). Some are free for non-commercial use, and some have a 30-day trial. All IDEs are based on the same code and share the same plugin system.
When opening a .proto file the IDE will ask you if it may install this plugin for editing .proto files.
You may need to configure the import paths in File › Settings › Language & Frameworks › Protocol Buffers
before
it correctly parses your imports. After that, it works perfectly: Errors are displayed in red, autocomplete works and you can Ctrl+Click on imports and message types to follow them.
Visual Studio Code (VS Code) is a free and popular cross-platform source code editor developed by Microsoft. There are a huge number of extensions written for it, which makes it a great for many It has many extensions that can add syntax highlighting to proto files:
I tested them all and I came across a lot of garbage.
The extension Protocol Buffers by Ukjae Jeong has its
problems, but works better than the others.
In standard configuration, only syntax highlighting and outline work. However, you can configure it to work together with formatters, linters and compilers for Protocol Buffers.
After installing Buf and checking the Protobuf3 › Buf › Lint
checkbox in the settings of the extension,
the Buf linter is ran everytime you save a proto file.
Sublime Text is a cross-platform source code editor. It is a commercial application, but it has a free evalutation version that you can try for as long as you like. You can add Protocol Buffers syntax highlighting by following the instructions in the GitHub project VcamX/protobuf-syntax-highlighting.
Syntax coloring and in-file navigation with Ctrl+R work. Other than that there are no special features.
Notepad++ is a light-weight free source code editor for Windows. Perfect if you like fast programs and don't need the power of an IDE. You can add Protocol Buffers syntax highlighting by following the instructions on the GitHub project chai2010/notepadplus-protobuf.
The syntax highlighting and function list functionality works. There is no autocomplete other than the guessing of Notepad++ and there are no other fancy features.
All programs can do syntax coloring. Also, they all have the structure/outline feature with a table-of-contents of your file. If that's all you need, it doesn't really matter which program you use.
But, if you want more, if you want your code editor to actually understand your code and spot errors, your have less choice. A JetBrains IDE will do the best job with the least amount of installation/configuration trouble. If you're already using VS Code and don't want to install yet another bulky IDE you may consider using VS Code instead.
Do you know an other editor that should be on this page? Please let me know.