Improved smart completion.

This commit is contained in:
Rik van der Kleij 2019-01-28 18:19:07 +01:00
parent 01710eb865
commit 57cf47b9d9

View File

@ -257,7 +257,7 @@ class HaskellCompletionContributor extends CompletionContributor {
val typedHoleLines = message.split("\n").
map(_.replaceAll(s"$LayoutSpaceChar{2,}", "").
replaceAll(s"$LayoutSpaceChar", " "))
val typedHoleSuggestionsWithHeader = typedHoleLines.dropWhile(_ != "Valid substitutions include")
val typedHoleSuggestionsWithHeader = typedHoleLines.dropWhile(l => l != "Valid substitutions include" && l != "Valid hole fits include")
if (typedHoleSuggestionsWithHeader.nonEmpty) {
val typedHoleSuggestionLines = typedHoleSuggestionsWithHeader.tail
val typedHoleSuggestions = typedHoleSuggestionLines.filterNot(_.trim.startsWith("("))