Skip to content

Fix #3847#3854

Merged
mergify[bot] merged 5 commits into
haskell:masterfrom
BurningLutz:fix-3847
Nov 14, 2023
Merged

Fix #3847#3854
mergify[bot] merged 5 commits into
haskell:masterfrom
BurningLutz:fix-3847

Conversation

@BurningLutz

Copy link
Copy Markdown
Contributor

No description provided.

@fendor fendor left a comment

Copy link
Copy Markdown
Collaborator

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
Copy Markdown
Contributor Author

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

@fendor fendor left a comment

Copy link
Copy Markdown
Collaborator

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
Comment thread hls-plugin-api/src/Ide/PluginUtils.hs Outdated
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
Copy Markdown
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
Copy Markdown
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
Copy Markdown
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
Copy Markdown
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
Copy Markdown
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
@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