You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Support for `.cabal` files was implemented in HLS 2.0.0.0.
But the vscode-haskell extension does not enable this Language Server
support, because it would break for older HLS binaries, as these were
unable to handle file updates for `.cabal` files.
To work-around, we had a pre-release of the vscode-haskell plugin, which
enabled support for `.cabal` plugins in an opt-in fashion.
It's been a while, and we want to enable language server support for
`.cabal` files unconditionally. There are still HLS binaries around that
can't handle `.cabal` files, but it much less.
For the unfortunate souls left behind with GHC versions such as 8.6.5,
we add a new vscode-haskell option:
haskell.supportCabalFiles
This option is `true` by default, but if set to `false` it will
unconditionally **disable** sending File Notifications for `.cabal`
files, which allows us to keep working for older HLS binaries.
This change would be difficult to test, and incur an, in my opinion,
unreasonable price on our CI times.
I manually tested the changes, by using HLS 1.8.0.0 (last released
binary for GHC 8.6.5) on a project with `haskell.supportCabalFiles` set
to `true` and `false` respectively.
HLS seemed to behave correctly, showing Diagnostics for Haskell files,
but not show any logs for `.cabal` files.
The only potential change in behaviour is that vscode-haskell now also
activates when a `.cabal` file has been opened. This may be overly eager to
some, but since no Haskell files are typechecked, the impact on memory
usage is negligible in my opinion.
Copy file name to clipboardExpand all lines: package.json
+6Lines changed: 6 additions & 0 deletions
Original file line number
Diff line number
Diff line change
@@ -234,6 +234,12 @@
234
234
"Prefer a multiple component session, if the build tool supports it. At the moment, only `cabal` supports multiple components session loading. If the `cabal` version does not support loading multiple components at once, we gracefully fall back to \"singleComponent\" mode."
235
235
]
236
236
},
237
+
"haskell.supportCabalFiles": {
238
+
"scope": "resource",
239
+
"default": true,
240
+
"type": "boolean",
241
+
"description": "Enable Language Server support for `.cabal` files. Requires Haskell Language Server version >= 2.0.0.0."
0 commit comments