summaryrefslogtreecommitdiff
path: root/internal/lsp/document_handlers_test.go
diff options
context:
space:
mode:
Diffstat (limited to 'internal/lsp/document_handlers_test.go')
-rw-r--r--internal/lsp/document_handlers_test.go5
1 files changed, 2 insertions, 3 deletions
diff --git a/internal/lsp/document_handlers_test.go b/internal/lsp/document_handlers_test.go
index 1fdd0da..efe6e30 100644
--- a/internal/lsp/document_handlers_test.go
+++ b/internal/lsp/document_handlers_test.go
@@ -6,7 +6,6 @@ import (
"io"
"log"
"testing"
- "time"
)
func TestDidOpenChangeClose_UpdateDocs(t *testing.T) {
@@ -67,8 +66,8 @@ func TestDeferShowDocument_WritesLater(t *testing.T) {
uri := "file:///x.go"
out.Reset()
s.deferShowDocument(uri, Range{Start: Position{Line: 0}, End: Position{Line: 0}})
- // wait >120ms per implementation
- time.Sleep(160 * time.Millisecond)
+ // Wait for the background goroutine to finish.
+ s.inflight.Wait()
req := captureRequest(t, &out)
if req.Method != "window/showDocument" {
t.Fatalf("expected showDocument, got %s", req.Method)