File tree 1 file changed +1
-1
lines changed
ghcide/src/Development/IDE/Plugin
1 file changed +1
-1
lines changed Original file line number Diff line number Diff line change @@ -252,7 +252,7 @@ suggestRemoveRedundantImport :: ParsedModule -> Maybe T.Text -> Diagnostic -> [(
252
252
suggestRemoveRedundantImport ParsedModule {pm_parsed_source = L _ HsModule {hsmodImports}} contents Diagnostic {_range= _range,.. }
253
253
-- The qualified import of ‘many’ from module ‘Control.Applicative’ is redundant
254
254
| Just [_, bindings] <- matchRegexUnifySpaces _message " The( qualified)? import of ‘([^’]*)’ from module [^ ]* is redundant"
255
- , Just (L _ impDecl) <- find (\ (L l _) -> srcSpanToRange l == Just _range ) hsmodImports
255
+ , Just (L _ impDecl) <- find (\ (L l _) -> _start _range `isInsideSrcSpan` l && _end _range `isInsideSrcSpan` l ) hsmodImports
256
256
, Just c <- contents
257
257
, ranges <- map (rangesForBindingImport impDecl . T. unpack) (T. splitOn " , " bindings)
258
258
, ranges' <- extendAllToIncludeCommaIfPossible False (indexedByPosition $ T. unpack c) (concat ranges)
You can’t perform that action at this time.
0 commit comments