Skip to content

Commit

Permalink
Migrate deprecated TextDocumentContentChangeEvent constructor
Browse files Browse the repository at this point in the history
  • Loading branch information
fwcd committed Oct 4, 2023
1 parent d22cc7f commit 5aa94da
Showing 1 changed file with 2 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -127,8 +127,8 @@ abstract class LanguageServerTestFixture(relativeWorkspaceRoot: String) : Langua
private var version = 1

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

languageServer.textDocumentService.didChange(DidChangeTextDocumentParams(doc, listOf(edit)))
Expand Down

0 comments on commit 5aa94da

Please sign in to comment.