Skip to content

Commit 83d26ec

Browse files
authored
add to hlint known limitations in features doc, fix wrong comment in hlint plugin (#2685)
1 parent 9d75cc5 commit 83d26ec

File tree

2 files changed

+4
-2
lines changed

2 files changed

+4
-2
lines changed

docs/features.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -144,6 +144,8 @@ Uses [apply-refact](https://github.com/mpickering/apply-refact).
144144
Known limitations:
145145

146146
- May have strange behaviour in files with CPP, since `apply-refact` does not support CPP.
147+
- The `hlint` executable by default turns on many extensions when parsing a file because it is not certain about the exact extensions that apply to the file (they may come from project files). This differs from HLS which uses only the extensions the file needs to parse the file. Hence it is possible for the `hlint` executable to report a parse error on a file, but the `hlint` plugin to work just fine on the same file. This does mean that the turning on/off of extensions in the hlint config may be ignored by the `hlint` plugin.
148+
- Hlint restrictions do not work (yet). This [PR](https://github.com/ndmitchell/hlint/pull/1340) should enable that functionality, but this requires a newer version of hlint to be used in HLS.
147149

148150
### Make import lists fully explicit
149151

plugins/hls-hlint-plugin/src/Ide/Plugin/Hlint.hs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -288,12 +288,12 @@ getIdeas nfp = do
288288
return $ flags { enabledExtensions = hlintExts }
289289

290290
-- Gets extensions from ModSummary dynflags for the file.
291-
-- Previously this would concatenate extensions from both hlint's parsedFlags
291+
-- Previously this would union extensions from both hlint's parsedFlags
292292
-- and the ModSummary dynflags. However using the parsedFlags extensions
293293
-- can sometimes interfere with the hlint parsing of the file.
294294
-- See https://github.com/haskell/haskell-language-server/issues/1279
295295
--
296-
-- Note: this is used when HLINT_ON_GHC_LIB is not defined. We seem to need
296+
-- Note: this is used when HLINT_ON_GHC_LIB is defined. We seem to need
297297
-- these extensions to construct dynflags to parse the file again. Therefore
298298
-- using hlint default extensions doesn't seem to be a problem when
299299
-- HLINT_ON_GHC_LIB is not defined because we don't parse the file again.

0 commit comments

Comments
 (0)