diff --git a/ghcide/bench/config.yaml b/ghcide/bench/config.yaml index 8977f57106..c3142f60c3 100644 --- a/ghcide/bench/config.yaml +++ b/ghcide/bench/config.yaml @@ -48,6 +48,7 @@ experiments: - "code actions after edit" - "code actions after cradle edit" - "documentSymbols after edit" + - "hole fit suggestions" # An ordered list of versions to analyze versions: diff --git a/ghcide/bench/lib/Experiments.hs b/ghcide/bench/lib/Experiments.hs index 955df3e5d5..6a7e25bf1f 100644 --- a/ghcide/bench/lib/Experiments.hs +++ b/ghcide/bench/lib/Experiments.hs @@ -169,9 +169,26 @@ experiments = sendNotification SWorkspaceDidChangeWatchedFiles $ DidChangeWatchedFilesParams $ List [ FileEvent (filePathToUri "hie.yaml") FcChanged ] flip allWithIdentifierPos docs $ \DocumentPositions{..} -> isJust <$> getHover doc (fromJust identifierP) + ), + --------------------------------------------------------------------------------------- + benchWithSetup + "hole fit suggestions" + ( mapM_ $ \DocumentPositions{..} -> do + let edit :: TextDocumentContentChangeEvent =TextDocumentContentChangeEvent + {_range = Just Range {_start = bottom, _end = bottom}, _rangeLength = Nothing, _text = t} + t = "\nf :: [Int] -> [Int]\nf = _" + changeDoc doc [edit] + ) + (\docs -> do + forM_ docs $ \DocumentPositions{..} -> + changeDoc doc [charEdit bottom] + waitForProgressDone + return True ) ] +bottom :: Position +bottom = Position maxBound 0 --------------------------------------------------------------------------------------------- examplesPath :: FilePath