microsoft / microsoft/vscode-cpptools
IntelliSense errors with Parsing the .pb.h header file generated from the protobuffer proto file
Nobody has claimed this yet.
- Dominant language
- TypeScript
- Stars
- 6.2k
- Forks
- 1.7k
- Avg merge
- 14h 46m
- Merged PRs (30d)
- 61
Description
Environment
- OS and Version: CentOS7
- VS Code Version: 1.98.2
- C/C++ Extension Version: 1.29.3
Bug Summary and Steps to Reproduce
Bug Summary:
Opening the .pb.h header file generated from the .proto file of Protobuf, there is IntelliSense error: this declaration has no storage class or type specifier.
- My protobuf version is 3.6.0
- The minimal case might look like this:
#include <google/protobuf/port_def.inc>
#include <google/protobuf/port_undef.inc>
#include <google/protobuf/port_def.inc>
PROTOBUF_NAMESPACE_OPEN
namespace internal {
class AnyMetadata;
} // namespace internal
PROTOBUF_NAMESPACE_CLOSE
-
Error displayed on macro PROTOBUF_NAMESPACE_OPEN
-
The attachment here is the header file provided by protobuf
protobuf-include.zip
Configuration and Logs
{
"configurations": [
{
"name": "Linux",
],
"defines": [
"_DEBUG",
"UNICODE",
"_UNICODE"
],
"cStandard": "c11",
"cppStandard": "c++11",
"intelliSenseMode": "linux-gcc-x64"
}
],
"version": 4
}
Other Extensions
No response
Additional context
No response
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start with the minimal .pb.h snippet and the diagnostic on PROTOBUF_NAMESPACE_OPEN, using the reported cStandard, cppStandard, and intelliSenseMode settings. Reproduce with protobuf-include.zip and the listed VS Code and C/C++ extension versions; done means the generated header no longer shows this IntelliSense error.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- cpp, typescript
- Domain
- devtools, tooling
- Issue type
- Bug
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 30/100