Skip to content

Commit ce74f12

Browse files
committed
Add some comments
1 parent 4ef3904 commit ce74f12

File tree

1 file changed

+5
-2
lines changed

1 file changed

+5
-2
lines changed

plugins/hls-change-type-signature-plugin/src/Ide/Plugin/ChangeTypeSignature.hs

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -135,6 +135,7 @@ diagnosticToChangeSig
135135
-> FileDiagnostic
136136
-> HandlerM Config (Maybe ChangeSignature)
137137
diagnosticToChangeSig recorder decls diagnostic = runMaybeT $ do
138+
-- Extract expected, actual, and extra error info
138139
(expectedType, actualType, errInfo) <- hoistMaybe $ do
139140
msg <- diagnostic ^. fdStructuredMessageL ^? _SomeStructuredMessage
140141
tcRnMsg <- msg ^. msgEnvelopeErrorL ^? _TcRnMessage
@@ -146,15 +147,17 @@ diagnosticToChangeSig recorder decls diagnostic = runMaybeT $ do
146147

147148
pure (showType expectedType, showType actualType, errInfo)
148149

149-
logWith recorder Development.IDE.Warning (LogErrInfoCtxt errInfo)
150+
logWith recorder Debug (LogErrInfoCtxt errInfo)
150151

152+
-- Extract the declName from the extra error text
151153
declName <- hoistMaybe (matchingDiagnostic errInfo)
152154

155+
-- Look up location of declName. If it fails, log it
153156
declSrcSpan <-
154157
case findSigLocOfStringDecl decls expectedType (T.unpack declName) of
155158
Just x -> pure x
156159
Nothing -> do
157-
logWith recorder Development.IDE.Warning (LogFindSigLocFailure declName)
160+
logWith recorder Debug (LogFindSigLocFailure declName)
158161
hoistMaybe Nothing
159162

160163
pure ChangeSignature{..}

0 commit comments

Comments
 (0)