Skip to content

Conversation

crtschin
Copy link
Contributor

@crtschin crtschin commented Sep 5, 2025

Closes #4357.

This adds a pretty simple function for calculating the edit distance between two strings and uses it to score suggestions in completion lists. Some

  • I increased the cost of substitutions, otherwise the suggestions would very often lean towards nonsense.
  • Kind of hackily injected the Matcher that's used in scoring texts into CompleterData. Couldn't really massage that into the weightedConstantCompleter that's used for licenses.
  • This new scoring function doesn't do any filtering, so I had to adjust the cabal codeaction golden test to pick the top action per diagnostic.

@crtschin crtschin force-pushed the crtschin/codeaction-cabal-fix-typos branch from 3c4d9d8 to 53bf792 Compare September 6, 2025 10:29
@crtschin crtschin marked this pull request as ready for review September 6, 2025 12:07
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.

LGTM, thank you for taking care of this!

@fendor fendor added the status: needs review This PR is ready for review label Sep 15, 2025
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.

LGTM, thank you very much!

@fendor fendor added merge me Label to trigger pull request merge and removed status: needs review This PR is ready for review labels Sep 23, 2025
Copy link
Contributor

mergify bot commented Sep 23, 2025

This pull request has been removed from the queue for the following reason: pull request branch update failed.

The pull request can't be updated.

You should update or rebase your pull request manually. If you do, this pull request will automatically be requeued once the queue conditions match again.
If you think this was a flaky issue, you can requeue the pull request, without updating it, by posting a @mergifyio requeue comment.

@crtschin crtschin force-pushed the crtschin/codeaction-cabal-fix-typos branch from 201c9b7 to d74eb5c Compare September 23, 2025 09:10
@fendor
Copy link
Collaborator

fendor commented Sep 23, 2025

@Mergifyio requeue

Copy link
Contributor

mergify bot commented Sep 23, 2025

requeue

✅ The queue state of this pull request has been cleaned. It can be re-embarked automatically

@crtschin
Copy link
Contributor Author

I'm not sure I understand why the test is failing. It doesn't look related to my changes. I can reproduce this locally, but the same test also fails on master on my machine.

I tried checking the failing test, but also don't see why it could be flaky though (if flaky tests are a thing in this repository). I might need some pointers.

@fendor
Copy link
Collaborator

fendor commented Sep 24, 2025

@crtschin Don't worry about it, most of our tests are unfortunately flaky one way or another :) I restarted the job, should be fine.

@mergify mergify bot merged commit 91d2b48 into haskell:master Sep 24, 2025
50 of 52 checks passed
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
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Don't use completions for cabal file codeactions
3 participants