Skip to content

Commit

Permalink
Add benchmarks for hole fits
Browse files Browse the repository at this point in the history
  • Loading branch information
pepeiborra committed Jul 19, 2021
1 parent c78363f commit 9abe89b
Show file tree
Hide file tree
Showing 2 changed files with 18 additions and 0 deletions.
1 change: 1 addition & 0 deletions ghcide/bench/config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand Down
17 changes: 17 additions & 0 deletions ghcide/bench/lib/Experiments.hs
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit 9abe89b

Please sign in to comment.