We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 95dde7c commit fc4ea30Copy full SHA for fc4ea30
plugins/hls-hlint-plugin/src/Ide/Plugin/Hlint.hs
@@ -326,6 +326,9 @@ applyHint ide nfp mhint =
326
let fp = fromNormalizedFilePath nfp
327
(_, mbOldContent) <- liftIO $ runAction "hlint" ide $ getFileContents nfp
328
oldContent <- maybe (liftIO $ T.readFile fp) return mbOldContent
329
+ -- We need to save a file with last edited contents cause `apply-refact`
330
+ -- doesn't expose a function taking directly contents instead a file path.
331
+ -- Ideally we should try to expose that function upstream and remove this.
332
res <- liftIO $ withSystemTempFile (takeFileName fp) $ \temp h -> do
333
hClose h
334
writeFileUTF8NoNewLineTranslation temp oldContent
0 commit comments