Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add line numbers to all Visitees? #7

Closed
bufdev opened this issue Aug 4, 2017 · 14 comments
Closed

Add line numbers to all Visitees? #7

bufdev opened this issue Aug 4, 2017 · 14 comments

Comments

@bufdev
Copy link
Contributor

bufdev commented Aug 4, 2017

I'd like to write a linter based on this library, and line numbers for all Visitees would be great. I can put together a PR to this effect if this is something you'd be open to.

@emicklei
Copy link
Owner

emicklei commented Aug 4, 2017

yes sure.

the scanner knows the line so hopefully without much effort, you could add e.g. LineNumber to each node type.

@bufdev
Copy link
Contributor Author

bufdev commented Aug 4, 2017 via email

@emicklei
Copy link
Owner

do you expect to finish this in the near future? Otherwise, I will put some time to it

@bufdev
Copy link
Contributor Author

bufdev commented Oct 13, 2017

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

@emicklei
Copy link
Owner

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

@bufdev
Copy link
Contributor Author

bufdev commented Oct 24, 2017

Hey, sorry about the delay. You may want to just continue on his work, Robbert is held up on a few things.

@robbertvanginkel
Copy link
Contributor

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.

@bufdev
Copy link
Contributor Author

bufdev commented Oct 26, 2017

Hey @emicklei how does that look as a start? We could do column after.

@emicklei
Copy link
Owner

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.

@bufdev
Copy link
Contributor Author

bufdev commented Oct 26, 2017

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).

@emicklei
Copy link
Owner

I like to proceed with the branch proposed and rewrite it to use the Position type instead.

@emicklei
Copy link
Owner

@emicklei
Copy link
Owner

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.

@emicklei
Copy link
Owner

emicklei commented Nov 30, 2017

@peter-edge @robbertvanginkel thank you for contributing. I just merged the changes

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants