Open VeryMilkyJoe opened 2 weeks ago
Do we need to change the Context
then?
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.
@dyniec is taking a stab at this :confetti_ball:
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:
Here, the exposed modules values should be completed instead of the default vscode completions:
![image](https://github.com/haskell/haskell-language-server/assets/22590431/3c6102ca-42dd-454b-bb31-a7b2129e6e86)
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.