mafintosh / mafintosh/protocol-buffers

Leading '.' not supported

Open
#80 0 comments 0 reactions 0 assignees View on GitHub
Dominant language
JavaScript
Stars
760
Forks
75
PR merge metrics
No merged PRs in 30d

Description

test.proto
```proto
enum FOO {
BAR = 1;
}
message AnotherOne {
.FOO list = 1;
}
```
```js
> var messages = protobuf(fs.readFileSync('test.proto'))
Uncaught Error: Could not resolve .FOO
```
See https://developers.google.com/protocol-buffers/docs/proto#packages-and-name-resolution:
> Type name resolution in the protocol buffer language works like C++: first the innermost scope is searched, then the next-innermost, and so on, with each package considered to be "inner" to its parent package. **A leading '.' (for example, .foo.bar.Baz) means to start from the outermost scope instead.**

Contributor guide

No contributing guide indexed for this repository

Research direction

Start by reproducing the example from test.proto with the JavaScript protobuf(fs.readFileSync('test.proto')) entry point. Compare the resolver's behavior with the linked Protocol Buffers name-resolution rules. Done means a leading-dot type such as .FOO resolves from the outermost scope without the reported error.

Written by the indexing model from the issue text.

Assessment

Tech stack
javascript
Domain
backend-api-design
Issue type
Bug
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Clearly specified
Newbie friendliness
45/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.