Skip to content

Field and value completion does not work inside conditionals #4289

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

Closed
VeryMilkyJoe opened this issue Jun 8, 2024 · 8 comments
Closed

Field and value completion does not work inside conditionals #4289

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

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 Hackathon This issue is suitable for hackathon 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 🎊

@VeryMilkyJoe
Copy link
Collaborator Author

@dyniec are you still working on this issue?

@VeryMilkyJoe VeryMilkyJoe added the level: easy The issue is suited for beginners label Oct 10, 2024
@dyniec
Copy link
Contributor

dyniec commented Oct 10, 2024

I couldn't make it work. Please mark it as up for grabs

@VeryMilkyJoe
Copy link
Collaborator Author

Okey dokey, thank you for the response :)

@SamuelLess
Copy link
Contributor

Hi, I'll give it a try :)

@fendor
Copy link
Collaborator

fendor commented Oct 14, 2024

Implemented by #4427

@fendor fendor closed this as completed Oct 14, 2024
@github-project-automation github-project-automation bot moved this from Todo to Done in HLS & Friends Zurihac Oct 14, 2024
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 Hackathon This issue is suitable for hackathon sessions level: easy The issue is suited for beginners type: bug Something isn't right: doesn't work as intended, documentation is missing/outdated, etc..
Projects
Development

No branches or pull requests

4 participants