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

rework misspelled spans to only the word. #19

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

sinistersnare
Copy link
Contributor

Right now there is a bug with /** style doc comments, but /// doc comments work perfectly. that sometimes moves the span.

Just wanted to put this up to motivate me to try and do more later, because I am good for the night now :)

closes #7

@sinistersnare sinistersnare changed the title reword misspelled spans to only the word. closes #7 reword misspelled spans to only the word. closes Nov 20, 2014

if let Some(amt) = whole.find_str(w.as_slice()) {
pos.span.lo = pos.span.lo + BytePos(amt as u32);
pos.span.hi = pos.span.lo + BytePos(w.len() as u32);
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think this needs to be amt + w.len().

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

nope, the hi of the span is the lo + the length, if you added amt, youd go way out there, and the span would be of large length

unless my math is really bad?

Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Oh, sorry, you are correct: I didn't take into account the modification on the previous line.

@sinistersnare sinistersnare changed the title reword misspelled spans to only the word. closes rework misspelled spans to only the word. Nov 21, 2014
@huonw
Copy link
Owner

huonw commented Mar 18, 2015

Hey @sinistersnare I completely forgot about this. I just updated the main code to master, so I'm happy to take this and rebase it, but I'm also happy for you to do it.

@huonw huonw self-assigned this Mar 18, 2015
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

Successfully merging this pull request may close these issues.

Extract subspans for /** doc comments
2 participants