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

Fix #3847 #3854

Merged
merged 5 commits into from
Nov 14, 2023
Merged

Fix #3847 #3854

merged 5 commits into from
Nov 14, 2023

Conversation

BurningLutz
Copy link
Contributor

No description provided.

Copy link
Collaborator

@fendor fendor left a 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?

@BurningLutz
Copy link
Contributor Author

@fendor Sure! I'll do it this weekend.

Copy link
Collaborator

@fendor fendor left a 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!

@fendor fendor added the status: needs review This PR is ready for review label Oct 28, 2023
@@ -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
Copy link
Collaborator

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!

Copy link
Contributor Author

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?

Copy link
Collaborator

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?

@BurningLutz
Copy link
Contributor Author

As @michaelpj suggested, I described the issue briefly in the comment, and gave a link to the ticket for details.

@michaelpj
Copy link
Collaborator

Great, thanks!

@michaelpj michaelpj added the merge me Label to trigger pull request merge label Nov 8, 2023
@mergify mergify bot merged commit afac9b1 into haskell:master Nov 14, 2023
43 of 48 checks passed
@BurningLutz BurningLutz deleted the fix-3847 branch November 15, 2023 06:13
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
merge me Label to trigger pull request merge status: needs review This PR is ready for review
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants