From 31757fe507794e29dc1497de727b3a346eb2237c Mon Sep 17 00:00:00 2001 From: Joe Hermaszewski Date: Sun, 13 Jun 2021 09:36:40 +0800 Subject: [PATCH 1/3] Limit the number of valid hole fits Originally https://github.com/haskell/ghcide/pull/888 --- ghcide/src/Development/IDE/GHC/Compat.hs | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/ghcide/src/Development/IDE/GHC/Compat.hs b/ghcide/src/Development/IDE/GHC/Compat.hs index 31071421e3..f87550ef26 100644 --- a/ghcide/src/Development/IDE/GHC/Compat.hs +++ b/ghcide/src/Development/IDE/GHC/Compat.hs @@ -184,6 +184,7 @@ import Data.List (foldl') import Data.List (foldl', isSuffixOf) #endif +import Control.Applicative ((<|>)) import qualified Data.Map as M import DynamicLoading import Plugins (Plugin (parsedResultAction), @@ -303,7 +304,7 @@ setUpTypedHoles df $ df { refLevelHoleFits = Just 1 -- becomes slow at higher levels , maxRefHoleFits = Just 10 -- quantity does not impact speed - , maxValidHoleFits = Nothing -- quantity does not impact speed + , maxValidHoleFits = maxValidHoleFits df <|> Just 10 -- quantity does not impact speed } From e822724c33f2d3c0cdcd9f941568e6b6368ffad2 Mon Sep 17 00:00:00 2001 From: Joe Hermaszewski Date: Sun, 13 Jun 2021 16:02:24 +0800 Subject: [PATCH 2/3] Don't override user specified hole fitting parameters Co-authored-by: Pepe Iborra --- ghcide/src/Development/IDE/GHC/Compat.hs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/ghcide/src/Development/IDE/GHC/Compat.hs b/ghcide/src/Development/IDE/GHC/Compat.hs index f87550ef26..9984e048d3 100644 --- a/ghcide/src/Development/IDE/GHC/Compat.hs +++ b/ghcide/src/Development/IDE/GHC/Compat.hs @@ -302,8 +302,8 @@ setUpTypedHoles df $ flip gopt_unset Opt_SortValidHoleFits $ flip gopt_unset Opt_UnclutterValidHoleFits $ df - { refLevelHoleFits = Just 1 -- becomes slow at higher levels - , maxRefHoleFits = Just 10 -- quantity does not impact speed + { refLevelHoleFits = refLevelHoleFits df <|> Just 1 -- becomes slow at higher levels + , maxRefHoleFits = maxRefHoleFits df <|> Just 10 -- quantity does not impact speed , maxValidHoleFits = maxValidHoleFits df <|> Just 10 -- quantity does not impact speed } From abfcaa672cf96a8ea9fe8e53315eafc2c5f41719 Mon Sep 17 00:00:00 2001 From: Anton Latukha Date: Tue, 21 Dec 2021 06:20:45 +0200 Subject: [PATCH 3/3] m fx --- ghcide/src/Development/IDE/GHC/Compat.hs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/ghcide/src/Development/IDE/GHC/Compat.hs b/ghcide/src/Development/IDE/GHC/Compat.hs index 32e555690f..030c3f3d14 100644 --- a/ghcide/src/Development/IDE/GHC/Compat.hs +++ b/ghcide/src/Development/IDE/GHC/Compat.hs @@ -91,7 +91,6 @@ import qualified Avail import StringBuffer (hPutStringBuffer) #endif -import Control.Applicative ((<|>)) import qualified Data.Map as M import DynamicLoading import Plugins (Plugin (parsedResultAction), @@ -116,6 +115,7 @@ import Data.IORef import qualified Data.Map as Map import Data.List (foldl') +import Control.Applicative ((<|>)) #if MIN_VERSION_ghc(9,0,0) import qualified Data.Set as S