Skip to content
This repository was archived by the owner on Jan 2, 2021. It is now read-only.

Commit d50a9b0

Browse files
committed
Avoid sending top level binding delete action with no TextEdit
Happens when there is unused local binding
1 parent 56a4740 commit d50a9b0

File tree

1 file changed

+1
-0
lines changed

1 file changed

+1
-0
lines changed

src/Development/IDE/Plugin/CodeAction.hs

+1
Original file line numberDiff line numberDiff line change
@@ -191,6 +191,7 @@ suggestDeleteTopBinding ParsedModule{pm_parsed_source = L _ HsModule{hsmodDecls}
191191
. sortLocated
192192
$ hsmodDecls
193193
sameName = filter (matchesBindingName (T.unpack name) . snd) allTopLevel
194+
, length sameName /= 0
194195
= [("Delete ‘" <> name <> "", flip TextEdit "" . toNextBinding allTopLevel . fst <$> sameName )]
195196
| otherwise = []
196197
where

0 commit comments

Comments
 (0)