-
-
Notifications
You must be signed in to change notification settings - Fork 367
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
Fix #3847 #3854
Fix #3847 #3854
Conversation
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.
Hi, thank you for the fix!
Could you include a unit test for extractTextInRange
that demonstrates the issue?
@fendor Sure! I'll do it this weekend. |
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.
Thanks, this looks good to me!
@@ -236,7 +236,13 @@ usePropertyLsp kn pId p = do | |||
extractTextInRange :: Range -> T.Text -> T.Text | |||
extractTextInRange (Range (Position sl sc) (Position el ec)) s = newS | |||
where | |||
focusLines = take (fromIntegral $ el - sl + 1) $ drop (fromIntegral sl) $ T.lines s | |||
-- NOTE: Always append an empty line to the end to ensure there are |
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.
This is a little short - it's okay but it would be helpful to say why we don't have enough lines otherwise. You did all that reasoning in the ticket but now we're losing it all!
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.
@michaelpj
Oh yes, I thought the ticket could be enough. Should I simply give a link to that ticket or briefly describe the issue in the NOTE?
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, how would someone find the ticket? The way I think about it is: what would you want to read if you were encountering this code for the first time and you had no idea about the history?
As @michaelpj suggested, I described the issue briefly in the comment, and gave a link to the ticket for details. |
Great, thanks! |
No description provided.