@@ -103,8 +103,9 @@ rules = do
103
103
diagnostics :: NormalizedFilePath -> Either ParseError [Idea ] -> [FileDiagnostic ]
104
104
diagnostics file (Right ideas) =
105
105
[(file, ShowDiag , ideaToDiagnostic i) | i <- ideas, ideaSeverity i /= Ignore ]
106
- diagnostics file (Left parseErr) =
107
- [(file, ShowDiag , parseErrorToDiagnostic parseErr)]
106
+ -- We don't return parse errors as diagnostics cause they match the emitted ones
107
+ -- by ghc and they would be duplicated
108
+ diagnostics file (Left parseErr) = []
108
109
109
110
ideaToDiagnostic :: Idea -> Diagnostic
110
111
ideaToDiagnostic idea =
@@ -118,17 +119,6 @@ rules = do
118
119
, _tags = Nothing
119
120
}
120
121
121
- parseErrorToDiagnostic :: ParseError -> Diagnostic
122
- parseErrorToDiagnostic (Hlint. ParseError l msg contents) =
123
- LSP. Diagnostic {
124
- _range = srcSpanToRange l
125
- , _severity = Just LSP. DsInfo
126
- , _code = Just (LSP. StringValue " parser" )
127
- , _source = Just " hlint"
128
- , _message = T. unlines [T. pack msg,T. pack contents]
129
- , _relatedInformation = Nothing
130
- , _tags = Nothing
131
- }
132
122
-- This one is defined in Development.IDE.GHC.Error but here
133
123
-- the types could come from ghc-lib or ghc
134
124
srcSpanToRange :: SrcSpan -> LSP. Range
0 commit comments