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

Field and value completion does not work inside conditionals #4289

Open
VeryMilkyJoe opened this issue Jun 8, 2024 · 3 comments
Open

Field and value completion does not work inside conditionals #4289

VeryMilkyJoe opened this issue Jun 8, 2024 · 3 comments
Labels
component: hls-cabal-plugin Issues related to the hls-cabal-plugin type: bug Something isn't right: doesn't work as intended, documentation is missing/outdated, etc.. ZuriHac This issue is suitable for ZuriHac Hacking sessions

Comments

@VeryMilkyJoe
Copy link
Collaborator

VeryMilkyJoe commented Jun 8, 2024

Cabal completion seems to not be able to complete anything inside if statements.

Here, the default completion for vscode is suggested inside an if conditional, when it should be the library section fields:
image
Here, the exposed modules values should be completed instead of the default vscode completions:
image

The fields we are checking for completion are defined here.
I think to fix this we can check the parent sections recursively instead of simply the most direct parent to figure out the stanza the cursor is located in.

@VeryMilkyJoe VeryMilkyJoe added type: bug Something isn't right: doesn't work as intended, documentation is missing/outdated, etc.. status: needs triage component: hls-cabal-plugin Issues related to the hls-cabal-plugin labels Jun 8, 2024
@fendor
Copy link
Collaborator

fendor commented Jun 8, 2024

Do we need to change the Context then?

@fendor fendor added ZuriHac This issue is suitable for ZuriHac Hacking sessions and removed status: needs triage labels Jun 8, 2024
@VeryMilkyJoe
Copy link
Collaborator Author

Do we need to change the Context then?

I don't think it is necessary to change the type of Context for this issue, since we do not care whether we are inside a conditional for the completion.
We can simple set the StanzaContext to the nearest parent which is a Stanza.

@fendor
Copy link
Collaborator

fendor commented Jun 9, 2024

@dyniec is taking a stab at this 🎊

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
component: hls-cabal-plugin Issues related to the hls-cabal-plugin type: bug Something isn't right: doesn't work as intended, documentation is missing/outdated, etc.. ZuriHac This issue is suitable for ZuriHac Hacking sessions
Projects
Development

No branches or pull requests

2 participants