Comments (14)
lot of work has been done ; major refactoring. I am now at the point that a few tests are failing. Hope to finish it in the next days.
from proto.
Hey,
Totally up to you! I'm hoping to have at least line numbers sooner than later, I have my own linter I need to implement (which maybe eventually I can contribute back), and I require at least line numbers for it (but column would be great too).
from proto.
yes sure.
the scanner knows the line so hopefully without much effort, you could add e.g. LineNumber to each node type.
from proto.
from proto.
do you expect to finish this in the near future? Otherwise, I will put some time to it
from proto.
One of my colleagues is almost finished on this, but has an off-by-one error https://github.com/emicklei/proto/compare/master...robbertvanginkel:linenumbers?expand=1, he should be finished with this soon
from proto.
Thinking about this upcoming change, what if we add the column position on the line as well. Similar to https://golang.org/src/go/token/position.go
from proto.
Hey, sorry about the delay. You may want to just continue on his work, Robbert is held up on a few things.
from proto.
I opened #10, which gets adds the line numbers and tests for the cases I could find. I don't plan on working on it more, not sure if its the best approach either as I'm still getting to know go as a language. I put up the pr so it can be continued/merge/closed as you see fit.
from proto.
Hey @emicklei how does that look as a start? We could do column after.
from proto.
hi,
@robbertvanginkel , @peter-edge thank you for all this work. Quite a big effort.
I was planning to continue with the feature by replacing the LineNumbers field to a Position struct (just lik go parser is doing). I had the impression you (your team) no longer had time to work on it.
from proto.
I like to proceed with the branch proposed and rewrite it to use the Position type instead.
from proto.
see https://github.com/emicklei/proto/tree/linenumbers
from proto.
@peter-edge @robbertvanginkel thank you for contributing. I just merged the changes
from proto.
Related Issues (20)
- Unable to parse simple protobuf file with imported options HOT 12
- Package name with "." causes issues when parsing HOT 1
- Issue with double-quoted options HOT 1
- Quote dropped in option parsing
- Missing semicolon at end silently ignored. HOT 1
- Quoted string constant
- Multi-line fields not parseable
- QuoteRune is a breaking change HOT 4
- Write proto struct to file? HOT 1
- Comments inside field options break parser HOT 2
- Nested enum with inline comments break parser HOT 5
- Infinite loop in Parser.Parse() HOT 2
- Sir, if I get the package field? HOT 3
- support proto3 presence HOT 1
- Field type with keyword is not correctly parsed HOT 3
- Option string values parsed as numbers HOT 8
- embedded comment parse fail HOT 7
- Parse failure on negative reserved enums HOT 4
- Boolean variable to test if a field is deprecated HOT 11
- unable to parse option name with leading dot HOT 2
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from proto.