diff --git a/clients/intellij/build.gradle.kts b/clients/intellij/build.gradle.kts index fe0a424e35cd..734e6d6b00e5 100644 --- a/clients/intellij/build.gradle.kts +++ b/clients/intellij/build.gradle.kts @@ -35,7 +35,7 @@ tasks { } patchPluginXml { - sinceBuild.set("231.*") + sinceBuild.set("231") untilBuild.set("241.*") changeNotes.set(provider { changelog.renderItem( diff --git a/clients/intellij/src/main/kotlin/com/tabbyml/intellijtabby/lsp/TextDocumentSync.kt b/clients/intellij/src/main/kotlin/com/tabbyml/intellijtabby/lsp/TextDocumentSync.kt index 9c45a6c19f65..84a698f41bb4 100644 --- a/clients/intellij/src/main/kotlin/com/tabbyml/intellijtabby/lsp/TextDocumentSync.kt +++ b/clients/intellij/src/main/kotlin/com/tabbyml/intellijtabby/lsp/TextDocumentSync.kt @@ -48,11 +48,12 @@ class TextDocumentSync(private val project: Project) : Disposable { companion object { fun buildDidOpenTextDocumentParams(editor: Editor): DidOpenTextDocumentParams? { + val virtualFile = editor.virtualFile ?: return null val psiManager = editor.project?.let { PsiManager.getInstance(it) } ?: return null return DidOpenTextDocumentParams( TextDocumentItem( - editor.virtualFile.url, - editor.virtualFile.let { psiManager.findFileWithReadLock(it) }?.getLanguageId() ?: "plaintext", + virtualFile.url, + virtualFile.let { psiManager.findFileWithReadLock(it) }?.getLanguageId() ?: "plaintext", editor.document.modificationStamp.toInt(), editor.document.text, )