Closed isovector closed 3 years ago
Is it possible that you are being bitten by the bug below?
We looked further into this and the problem is that some editors, including VSCode, may refuse to include the config in the initialisation notification and instead only send it later via a WorkspaceDidChangeConfiguration notification. So we can never rely on the initialisation time config, and instead must always call Ide.PluginUtils.getClientConfig
to retrieve the current config dynamically
Closing this, since it's a client-side problem.
While working on a fix for #1873, I noticed that my plugin's configuration wasn't available when building the
IdeOptions
. But that's odd, because it's obviously getting pulled:https://github.com/haskell/haskell-language-server/blob/dee021657619c8e89174a99be63651d2fca977a5/ghcide/src/Development/IDE/Main.hs#L220
Tracing this, however, gives the following object:
which correspond exactly with the
Default
instance:https://github.com/haskell/haskell-language-server/blob/dee021657619c8e89174a99be63651d2fca977a5/hls-plugin-api/src/Ide/Plugin/Config.hs#L63-L78
What's going on here? Do we expect the config to be initialized by this point?