File tree Expand file tree Collapse file tree 5 files changed +9
-7
lines changed
ghcide/src/Development/IDE Expand file tree Collapse file tree 5 files changed +9
-7
lines changed Original file line number Diff line number Diff line change @@ -165,7 +165,6 @@ computePackageDeps env pkg = do
165
165
[ ideErrorText
166
166
(toNormalizedFilePath' noFilePath)
167
167
(T. pack $ " unknown package: " ++ show pkg)
168
- Nothing
169
168
]
170
169
Just pkgInfo -> return $ Right $ unitDepends pkgInfo
171
170
Original file line number Diff line number Diff line change @@ -142,7 +142,7 @@ getModificationTimeImpl missingFileDiags file = do
142
142
`catch` \ (e :: IOException ) -> do
143
143
let err | isDoesNotExistError e = " File does not exist: " ++ file'
144
144
| otherwise = " IO error while reading " ++ file' ++ " , " ++ displayException e
145
- diag = ideErrorText file (T. pack err) Nothing
145
+ diag = ideErrorText file (T. pack err)
146
146
if isDoesNotExistError e && not missingFileDiags
147
147
then return (Nothing , ([] , Nothing ))
148
148
else return (Nothing , ([diag], Nothing ))
Original file line number Diff line number Diff line change @@ -1248,7 +1248,7 @@ defineEarlyCutoff' doDiagnostics cmp key file mbOld mode action = do
1248
1248
(mbBs, (diags, mbRes)) <- actionCatch
1249
1249
(do v <- action staleV; liftIO $ evaluate $ force v) $
1250
1250
\ (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 ))
1252
1252
1253
1253
ver <- estimateFileVersionUnsafely key mbRes file
1254
1254
(bs, res) <- case mbRes of
Original file line number Diff line number Diff line change @@ -76,9 +76,12 @@ type IdeResult v = ([FileDiagnostic], Maybe v)
76
76
-- | an IdeResult with a fingerprint
77
77
type IdeResultNoDiagnosticsEarlyCutoff v = (Maybe ByteString , Maybe v )
78
78
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
+
82
85
83
86
ideErrorFromLspDiag
84
87
:: LSP. Diagnostic
Original file line number Diff line number Diff line change @@ -89,7 +89,7 @@ genericConfigTests = testGroup "generic plugin config"
89
89
files <- getFilesOfInterestUntracked
90
90
void $ uses_ GetTestDiagnostics $ HM. keys files
91
91
define mempty $ \ GetTestDiagnostics file -> do
92
- let diags = [ideErrorText file " testplugin" Nothing ]
92
+ let diags = [ideErrorText file " testplugin" ]
93
93
return (diags,Nothing )
94
94
}
95
95
-- A config that disables the plugin initially
You can’t perform that action at this time.
0 commit comments