var editID … type changeTest … var didChangeTests … // BenchmarkDidChange benchmarks modifications of a single file by making // synthetic modifications in a comment. It controls pacing by waiting for the // server to actually start processing the didChange notification before // proceeding. Notably it does not wait for diagnostics to complete. func BenchmarkDidChange(b *testing.B) { … } // makeEditFunc prepares the given file for incremental editing, by inserting a // placeholder comment that will be overwritten with a new unique value by each // call to the resulting function. While makeEditFunc awaits gopls to finish // processing the initial edit, the callback for incremental edits does not // await any gopls state. // // This is used for benchmarks that must repeatedly invalidate a file's // contents. // // TODO(rfindley): use this throughout. func makeEditFunc(env *Env, file string) func() { … } func BenchmarkDiagnoseChange(b *testing.B) { … } // TODO(rfindley): add a benchmark for with a metadata-affecting change, when // this matters. func BenchmarkDiagnoseSave(b *testing.B) { … } // runChangeDiagnosticsBenchmark runs a benchmark to edit the test file and // await the resulting diagnostics pass. If save is set, the file is also saved. func runChangeDiagnosticsBenchmark(b *testing.B, test changeTest, save bool, operation string) { … }