This repository was archived by the owner on Oct 7, 2020. It is now read-only.
File tree Expand file tree Collapse file tree 1 file changed +12
-9
lines changed
src/Haskell/Ide/Engine/Plugin Expand file tree Collapse file tree 1 file changed +12
-9
lines changed Original file line number Diff line number Diff line change @@ -475,7 +475,7 @@ extractImportableTerm dirtyMsg = do
475
475
let n' = T. strip n
476
476
return (n', s)
477
477
where
478
- importMsg = head
478
+ importMsg = S. headMay
479
479
-- Get rid of the rename suggestion parts
480
480
$ T. splitOn " Perhaps you meant "
481
481
$ T. replace " \n " " "
@@ -486,11 +486,14 @@ extractImportableTerm dirtyMsg = do
486
486
$ T. replace " • " " " dirtyMsg
487
487
488
488
extractedTerm = asum
489
- [ (\ name -> (name, Import Symbol ))
490
- <$> T. stripPrefix " Variable not in scope: " importMsg
491
- , (\ name -> (T. init name, Import Type ))
492
- <$> T. stripPrefix
493
- " Not in scope: type constructor or class ‘"
494
- importMsg
495
- , (\ name -> (name, Import Constructor ))
496
- <$> T. stripPrefix " Data constructor not in scope: " importMsg]
489
+ [ importMsg
490
+ >>= T. stripPrefix " Variable not in scope: "
491
+ >>= \ name -> Just (name, Import Symbol )
492
+ , importMsg
493
+ >>= T. stripPrefix " Not in scope: type constructor or class ‘"
494
+ >>= \ name -> Just (T. init name, Import Type )
495
+ , importMsg
496
+ >>= T. stripPrefix " Data constructor not in scope: "
497
+ >>= \ name -> Just (name, Import Constructor )]
498
+
499
+
You can’t perform that action at this time.
0 commit comments