-
Notifications
You must be signed in to change notification settings - Fork 13
lib: remove Syntex dependency #26
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
Conversation
It's a big dependency, slow to compile and not maintained anymore. Moving to `syn`. There is a caveat though: `version-sync` relied on span information gathered from `syntex` to provide more helpful messages. `syn` 0.11.11 doesn't have such a functionality, though there are plans to incorporate recent changes in procedural macro system to enable spans there too. Current `syn` master contains such code, but is unstable.
I have a question regarding the code that used |
@@ -1,3 +1,6 @@ | |||
/target/ | |||
Cargo.lock | |||
*~ | |||
**/*.rs.bk |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
A simple *.rs.bk
should be enough -- like the *~
pattern above.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yeah, you're right.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Well, that's just a pattern I took from .gitignore
autogenerated by cargo new foo
so I didn't give it a second thought.
@@ -1,3 +1,6 @@ | |||
/target/ | |||
Cargo.lock | |||
*~ | |||
**/*.rs.bk | |||
[._]*.sw? | |||
[._]sw? |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'm curious, what kind of files are these? Vim swap files? What is the initial +
about?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
*.rs.bk
-rustfmt
backup files, in case if you want todiff
the original and the result..*.sw?
- vim swap files that match.*.swp
,.*.swo
,.*.swn
etc. (the last letter runs backwards) and_*.sw?
for its Windows counterpart..sw?
- vim swap files for directories (just.swp
,.swo
etc., no filename part), also matches those for Windows.
And +
is just "added lines" from git diff
:D
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Great, thanks for the info!
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Actually, the (presumably complete) set of possible swap file names is even more complex: https://unix.stackexchange.com/a/326737. I just don't bother with this in my projects, though I don't know if that can be applied to yours'.
src/lib.rs
Outdated
|
||
match check_result { | ||
Ok(()) => { | ||
// FIXME |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Will you expand this comment to say that we should add line numbers again when the functionality is there?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Good idea, I'll do it.
Hey @hcpl, thanks for another well-made patch! I actually started with the However, since there are plans for adding span information to Would it be possible (with a reasonable amount of code) to have the line number information when version-sync is used with nightly Rust? Only do this if it doesn't make the whole thing super ugly with lots of conditional pieces of code. |
Oh, good question... I did not consider that :-) I guess it would be reasonable to run through all I don't actually know what will happen if you have multiple |
@mgeisler for me personally, there is also a matter of supporting code with newest features - it is much more pronounced for new nightly features because there won't ever be code in an abandoned parser that can deal with them in foreseeable future.
Since the only code in Ah, didn't know that usesr forum thread existed at all :D. Like I said before, |
Okay, last question: can you update the README to match the new output? It has an example of a |
Completely agreed! I'm happy if version-sync handles the normal cases correctly, e.g., the case where a sane developer forgets to update the
It's funny you should mention it... I was actually experimenting with that idea back in the day when I used syn to parse the files :-) It seems like an okay idea and it should work for 99% of the cases where the URL is simply written as a simple literal in the source code. It breaks down if the URL contains escaped characters in the source (which escape did the user use?) but I don't think we need to care about that. The usual normal case is enough and later we'll get proper span information from syn. |
@mgeisler hope I got it this right! Regarding temporary solution for line reporting: should I finish it off in this PR or let it be done afterwards? Also there is an option of not doing anything after this PR (if it gets merged now) just because it may not be worth it after all. |
@hcpl Yeah, I am not 100% convinced that the functionality needs to go. |
I've merged this for now. It looks like we should keep this functionality around for a little bit longer, at least until |
@mgeisler, |
Thanks for the heads up, @hcpl ! That's really cool to hear. I'll make a note of updating the dependency, but I don't think I'll get to it in the next few weeks. Feel free to beat me to it :-) |
It's a big dependency, slow to compile and not maintained anymore.
Moving to
syn
.There is a caveat though:
version-sync
relied on span informationgathered from
syntex
to provide more helpful messages.syn
0.11.11doesn't have such a functionality, though there are plans to incorporate
recent changes in procedural macro system to enable spans there too.
Current
syn
master contains such code, but is unstable.