Skip to content

Commit 5aa94da

Browse files
committed
Migrate deprecated TextDocumentContentChangeEvent constructor
1 parent d22cc7f commit 5aa94da

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

server/src/test/kotlin/org/javacs/kt/LanguageServerTestFixture.kt

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -127,8 +127,8 @@ abstract class LanguageServerTestFixture(relativeWorkspaceRoot: String) : Langua
127127
private var version = 1
128128

129129
fun replace(relativePath: String, line: Int, char: Int, oldText: String, newText: String) {
130-
val range = Range(position(line, char), Position(line - 1, char - 1 + oldText.length))
131-
val edit = TextDocumentContentChangeEvent(range, oldText.length, newText)
130+
val range = Range(position(line, char), position(line, char + oldText.length))
131+
val edit = TextDocumentContentChangeEvent(range, newText)
132132
val doc = VersionedTextDocumentIdentifier(uri(relativePath).toString(), version++)
133133

134134
languageServer.textDocumentService.didChange(DidChangeTextDocumentParams(doc, listOf(edit)))

0 commit comments

Comments
 (0)