-
-
Notifications
You must be signed in to change notification settings - Fork 30
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
Syntax highlighted output #4
Comments
I would like to add that for me highlighted differences in the changes list would be really nice, maybe even more than syntax highlighting. Something like the removed line the changed text in red and on the added line the text in green. |
Super big thanks for prototyping that! That indeed looks much better. I looked at how you implemented it, and have the following comments. I understand you just did a quick and dirty proof of concept, but I would like to give some feedback anyway :)
I agree a more user-friendly changed-item diff would be great to have. I filed #11 for it. |
Thanks for the feedback points. But how would a custom syntax be more robust than the real Rust syntax? I would think that catching all edge cases etc would be pretty hard. I would guess that using some library would be less work, especially in the light of syntax changes/additions in upcoming versions of Rust. I would agree that pure highlighting could just as well or beter live in the wrapper. But maybe it would be nice for other uses of the I would be happy to help. I am quite interested in where this project could go. |
I base that mostly on that the following example does not highlight properly in practice: But it also is not robust in theory, since my tool (at least currently) uses non-standard syntax constructs such as
That is a very interesting idea that didn't cross my mind! I agree that has a lot of potential to be a powerful approach. I have been struggling with finding an internal representation of Edit: One more PR: Enselic/public-api#51
I couldn't be happier if you want to help out :) Feel free to ping me about anything at any time. |
Okay I got a bit carried away. I created a new file So no extra dependencies are needed for the tokenization and the colouring is as robust as it gets. Some details have to be filled in I tried to leave I will next try an implementation of Enselic/public-api#11 with this new token setup. Note: I got in a fight with git, sorry for the PR, and the history in my fork may be a bit mangled. |
Awesome. I will take a deeper look at the code as soon as I get time. Feel free to create PRs that we can use for casual discussion and early feedback. Until such PRs exists (if you are OK with creating them of course), here are some casual comments and questions on the code so far:
Overall, your changes in both |
It is all very early stages, I figured I have to change the token representation quite a bit again for Enselic/public-api#11. But I will definitively open a PR as soon as possible. Regarding your feedback, I am not using I do get the feeling of not wanting to be the sole account having the credit to change code, I have that same feeling on my crate. So if you feel like it fits I would be honoured to get maintainer access, but in the general case I would advise to wait until after a first successful PR. For my own crate I am still using my own name, I do not think moving it to an organisation is worth it until you have a set of crates with multiple maintainers and you need to gracefully handle access and such. For looking abandoned it is most important to keep working on it I guess, and creating commits/issues/prs/releases. That is more important than having an organisation or not. |
I think I don't quite understand your question, because when you change to In any case, I just added some development tips here: https://github.com/Enselic/cargo-public-items/blob/main/doc/development.md. Thanks a lot for sharing your thoughts on creating an org. We can wait with that. And I am also fine with waiting to give you admin rights until you have landed your first PR. And I want to stress that I think it is important for open source work to be voluntary and without stress, so please don't feel like you need to hurry create a (production ready) PR. But I am very much looking forward to it :) Let me know when you feel ready for an early review of any draft PR you might have. |
Those tips look nice, very handy for new collaborators. I do agree with your view on open source work, and I am really happy that you explicitly state that. I will work a bit more on the draft PR I made now, when I think its ready for a review I will tag you in there. |
Closed by Enselic/public-api#23. Thank you so much @douweschulte 🙏 |
Loop instead of recursion to get fully qualified name
It would be nice to syntax highlight the output. Should be pretty easy.
The text was updated successfully, but these errors were encountered: