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 range handling for code completion in interpolated strings #1133

Merged

Conversation

kojo12228
Copy link
Contributor

@kojo12228 kojo12228 commented Jul 9, 2023

WHAT

🤖 Generated by Copilot at a165188

This pull request fixes a bug in the completion logic for interpolated strings and adds tests to verify the fix. It modifies the UntypedAstUtils.fs file to handle overlapping ranges of interpolated string parts, and the CompletionTests.fs and Script.fsx files to add two test cases using the List module.

🤖 Generated by Copilot at a165188

Fix interpolated
Completion logic bug in
Autumn of F Sharp

🐛🧪📝

WHY

The range for the DiscardAfterMissingQualificationAfterDot overlaps with the rest of the string in $"{List.}", but doesn't in $"{ List. }". Potentially the real fix should be a change to that range instead, but I don't know enough about the AST to know whether that is the right call.

HOW

🤖 Generated by Copilot at a165188

  • Fix bug in completion logic for interpolated strings by adding index to parts list and checking previous part range (link)
  • Add test cases for completion in interpolated strings using testCaseAsync and Script.fsx (link, link)

Related to #962, but doesn't completely fix it.

Copy link
Contributor

@baronfel baronfel left a comment

Choose a reason for hiding this comment

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

Thanks for this! And especially thanks for adding tests :)

@TheAngryByrd TheAngryByrd merged commit d728580 into ionide:main Jul 9, 2023
@TheAngryByrd
Copy link
Member

Thank you!!

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.

3 participants