From 291416b1312b1304dc0d7e35c0bae24742bdc875 Mon Sep 17 00:00:00 2001 From: Zubin Duggal Date: Tue, 30 Aug 2022 17:31:38 +0530 Subject: [PATCH] Fix benchmarks --- bench/config.yaml | 5 +++-- ghcide-bench/src/Experiments.hs | 14 ++++++++------ 2 files changed, 11 insertions(+), 8 deletions(-) diff --git a/bench/config.yaml b/bench/config.yaml index 19e014a4852..4e99f1c8dbf 100644 --- a/bench/config.yaml +++ b/bench/config.yaml @@ -108,12 +108,13 @@ configurations: - ghcide-type-lenses - pragmas - Ghcide: + - ghcide-completions + - ghcide-type-lenses +- Refactor: - ghcide-code-actions-bindings - ghcide-code-actions-fill-holes - ghcide-code-actions-imports-exports - ghcide-code-actions-type-signatures - - ghcide-completions - - ghcide-type-lenses - All: - alternateNumberFormat - callHierarchy diff --git a/ghcide-bench/src/Experiments.hs b/ghcide-bench/src/Experiments.hs index 2d756d73fdc..1d8d6f6c5b4 100644 --- a/ghcide-bench/src/Experiments.hs +++ b/ghcide-bench/src/Experiments.hs @@ -139,7 +139,7 @@ experiments = not . null <$> getCompletions doc (fromJust identifierP), --------------------------------------------------------------------------------------- benchWithSetup - "code lens" + "code actions" ( \docs -> do unless (any (isJust . identifierP) docs) $ error "None of the example modules is suitable for this experiment" @@ -148,12 +148,13 @@ experiments = waitForProgressStart waitForProgressDone ) - ( \docs -> not . null <$> forM docs (\DocumentPositions{..} -> - getCodeLenses doc) + ( \docs -> not . null . catMaybes <$> forM docs (\DocumentPositions{..} -> + forM identifierP $ \p -> + getCodeActions doc (Range p p)) ), --------------------------------------------------------------------------------------- benchWithSetup - "code lens after edit" + "code actions after edit" ( \docs -> do unless (any (isJust . identifierP) docs) $ error "None of the example modules is suitable for this experiment" @@ -165,8 +166,9 @@ experiments = changeDoc doc [charEdit stringLiteralP] waitForProgressStart waitForProgressDone - not . null <$> forM docs (\DocumentPositions{..} -> do - getCodeLenses doc) + not . null . catMaybes <$> forM docs (\DocumentPositions{..} -> do + forM identifierP $ \p -> + getCodeActions doc (Range p p)) ), --------------------------------------------------------------------------------------- benchWithSetup