Skip to content

Commit 649e2ba

Browse files
committed
Remove the unused parameter from 'ideErrorText'
1 parent 65300ef commit 649e2ba

File tree

5 files changed

+9
-7
lines changed

5 files changed

+9
-7
lines changed

ghcide/src/Development/IDE/Core/Compile.hs

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -165,7 +165,6 @@ computePackageDeps env pkg = do
165165
[ ideErrorText
166166
(toNormalizedFilePath' noFilePath)
167167
(T.pack $ "unknown package: " ++ show pkg)
168-
Nothing
169168
]
170169
Just pkgInfo -> return $ Right $ unitDepends pkgInfo
171170

ghcide/src/Development/IDE/Core/FileStore.hs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -142,7 +142,7 @@ getModificationTimeImpl missingFileDiags file = do
142142
`catch` \(e :: IOException) -> do
143143
let err | isDoesNotExistError e = "File does not exist: " ++ file'
144144
| otherwise = "IO error while reading " ++ file' ++ ", " ++ displayException e
145-
diag = ideErrorText file (T.pack err) Nothing
145+
diag = ideErrorText file (T.pack err)
146146
if isDoesNotExistError e && not missingFileDiags
147147
then return (Nothing, ([], Nothing))
148148
else return (Nothing, ([diag], Nothing))

ghcide/src/Development/IDE/Core/Shake.hs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1248,7 +1248,7 @@ defineEarlyCutoff' doDiagnostics cmp key file mbOld mode action = do
12481248
(mbBs, (diags, mbRes)) <- actionCatch
12491249
(do v <- action staleV; liftIO $ evaluate $ force v) $
12501250
\(e :: SomeException) -> do
1251-
pure (Nothing, ([ideErrorText file (T.pack $ show e) Nothing | not $ isBadDependency e],Nothing))
1251+
pure (Nothing, ([ideErrorText file (T.pack $ show e) | not $ isBadDependency e],Nothing))
12521252

12531253
ver <- estimateFileVersionUnsafely key mbRes file
12541254
(bs, res) <- case mbRes of

ghcide/src/Development/IDE/Types/Diagnostics.hs

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -76,9 +76,12 @@ type IdeResult v = ([FileDiagnostic], Maybe v)
7676
-- | an IdeResult with a fingerprint
7777
type IdeResultNoDiagnosticsEarlyCutoff v = (Maybe ByteString, Maybe v)
7878

79-
ideErrorText :: NormalizedFilePath -> T.Text -> Maybe (MsgEnvelope GhcMessage) -> FileDiagnostic
80-
ideErrorText fdFilePath msg origMsg =
81-
ideErrorWithSource (Just "compiler") (Just DiagnosticSeverity_Error) fdFilePath msg origMsg
79+
-- | Produce a 'FileDiagnostic' for the given 'NormalizedFilePath'
80+
-- with an error message.
81+
ideErrorText :: NormalizedFilePath -> T.Text -> FileDiagnostic
82+
ideErrorText nfp msg =
83+
ideErrorWithSource (Just "compiler") (Just DiagnosticSeverity_Error) nfp msg Nothing
84+
8285

8386
ideErrorFromLspDiag
8487
:: LSP.Diagnostic

test/functional/Config.hs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -89,7 +89,7 @@ genericConfigTests = testGroup "generic plugin config"
8989
files <- getFilesOfInterestUntracked
9090
void $ uses_ GetTestDiagnostics $ HM.keys files
9191
define mempty $ \GetTestDiagnostics file -> do
92-
let diags = [ideErrorText file "testplugin" Nothing]
92+
let diags = [ideErrorText file "testplugin"]
9393
return (diags,Nothing)
9494
}
9595
-- A config that disables the plugin initially

0 commit comments

Comments
 (0)