Skip to content

Commit 4073c79

Browse files
committed
Add benchmarks for hole fits
1 parent c78363f commit 4073c79

File tree

2 files changed

+16
-1
lines changed

2 files changed

+16
-1
lines changed

ghcide/bench/config.yaml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -48,6 +48,7 @@ experiments:
4848
- "code actions after edit"
4949
- "code actions after cradle edit"
5050
- "documentSymbols after edit"
51+
- "hole fit suggestions"
5152

5253
# An ordered list of versions to analyze
5354
versions:

ghcide/bench/lib/Experiments.hs

Lines changed: 15 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -170,8 +170,22 @@ experiments =
170170
List [ FileEvent (filePathToUri "hie.yaml") FcChanged ]
171171
flip allWithIdentifierPos docs $ \DocumentPositions{..} -> isJust <$> getHover doc (fromJust identifierP)
172172
)
173+
---------------------------------------------------------------------------------------
174+
benchWithSetup
175+
"hole fit suggestions"
176+
( mapM_ $ \DocumentPositions{..} -> do
177+
let edit :: TextDocumentContentChangeEvent =TextDocumentContentChangeEvent
178+
{_range = Just Range {_start = bottom, _end = bottom}, _rangeLength = Nothing, _text = t}
179+
t = "\nf :: [Int] -> [Int]\nf = _"
180+
changeDoc doc [edit]
181+
)
182+
(\docs -> do
183+
forM_ docs $ \DocumentPositions{..} ->
184+
changeDoc doc [charEdit bottom]
185+
waitForKickDone
186+
return True
187+
)
173188
]
174-
175189
---------------------------------------------------------------------------------------------
176190

177191
examplesPath :: FilePath

0 commit comments

Comments
 (0)