-
-
Notifications
You must be signed in to change notification settings - Fork 391
Don't use completions for cabal file codeactions #4357
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
Comments
Hi! I’m very new to Haskell and to contributing to open source. I came across this issue and thought it would be a great opportunity to learn more about the ecosystem. I’ve implemented a version of the Smith-Waterman algorithm for fuzzy matching under Text.Fuzzy.Parallel, and I’m interested in exploring how it could help improve code actions in cabal files, as suggested in this issue. However, I’m not sure which part of the codebase is responsible for the in-editor highlighting of the matched string (as shown in the image below). Could someone point me to the relevant modules or files I should look into? Since this is both my first time working with a functional language and contributing to a Haskell project, any advice or suggestions on how to approach this issue would be very much appreciated! |
Hi, thank you for your interest!
I believe the highlighting is done automatically by VSCode, so it is not something you can control. |
Yeah, I would like to know which function produces the final result that
shows in the suggested completion
2025年5月13日(火) 午後3:02 fendor ***@***.***>:
… *fendor* left a comment (haskell/haskell-language-server#4357)
<#4357 (comment)>
Hi, thank you for your interest!
However, I’m not sure which part of the codebase is responsible for the
in-editor highlighting of the matched string (as shown in the image below).
Could someone point me to the relevant modules or files I should look into?
I believe the highlighting is done automatically by VSCode, so it is not
something you can control.
Or are you asking for the location where these strings are produced?
—
Reply to this email directly, view it on GitHub
<#4357 (comment)>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/AOZLJ4L4S6AD3O5ZITFRWZT26GKIHAVCNFSM6AAAAAB47UMO2WVHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMZDQNZVGI3TSMJZGU>
.
You are receiving this because you commented.Message ID:
***@***.***>
|
This is the entry point for the completions https://github.com/haskell/haskell-language-server/blob/master/plugins/hls-cabal-plugin/src/Ide/Plugin/Cabal.hs#L133 (which is what you see in the screenshot, which is not what this issue is about) and https://github.com/haskell/haskell-language-server/blob/master/plugins/hls-cabal-plugin/src/Ide/Plugin/Cabal.hs#L135 is the entry point for code actions that correct typos in field names. |
Ok, I would take a look inside those functions.
Also, do you have any suggestions on how to debug while the language server
is running? I would like to see a list of suggested keywords with their
score. I am using Windows 11 + vscode
…On Tue, May 13, 2025 at 5:43 PM fendor ***@***.***> wrote:
*fendor* left a comment (haskell/haskell-language-server#4357)
<#4357 (comment)>
This is the entry point for the completions
https://github.com/haskell/haskell-language-server/blob/master/plugins/hls-cabal-plugin/src/Ide/Plugin/Cabal.hs#L133
(which is what you see in the screenshot, which is not what this issue is
about) and
https://github.com/haskell/haskell-language-server/blob/master/plugins/hls-cabal-plugin/src/Ide/Plugin/Cabal.hs#L135
is the entry point for code actions that correct typos in field names.
—
Reply to this email directly, view it on GitHub
<#4357 (comment)>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/AOZLJ4LQHIWUMGT7XY47RL326G5EBAVCNFSM6AAAAAB47UMO2WVHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMZDQNZVG43TQMZRGA>
.
You are receiving this because you commented.Message ID:
***@***.***>
|
The easiest way to debug is Another good way is to run a single test, for example That's often much faster than the manual testing. Same tips apply though, logging and |
At the moment, codeactions (PR: #3273) in cabal files put a cursor at the end of the misspelled word and then suggest any possible completions.
This is not ideal, since words that have a typo early on will not trigger the correct codeaction.
We should use a different algorithm for the fuzzy matching than completions to better support the semantics of the codeactions.
The text was updated successfully, but these errors were encountered: