Repository navigation
Closed
Description
IDE: GoLand 2025.1 (Build #GO-251.23774.430, built on April 14, 2025)
Version: 0.13.1-20250529-113057
- Have the Docker Language Server configured and setup for
compose.yamlfiles. - Restart with no files opened.
- Create a
compose.yamlfile. - Type some stuff and try to save immediately.
- Error is thrown.
2025-05-30-lsp4ij-save-bug.mov
java.lang.NullPointerException: Cannot invoke "org.eclipse.lsp4j.jsonrpc.messages.Either.isLeft()" because "saveOptions" is null
at com.redhat.devtools.lsp4ij.DocumentContentSynchronizer.documentSaved(DocumentContentSynchronizer.java:229)
at com.redhat.devtools.lsp4ij.LSPFileListener.contentsChanged(LSPFileListener.java:113)
at com.intellij.openapi.vfs.impl.BulkVirtualFileListenerAdapter.fireAfter(BulkVirtualFileListenerAdapter.java:47)
at com.intellij.openapi.vfs.impl.BulkVirtualFileListenerAdapter.after(BulkVirtualFileListenerAdapter.java:38)
at com.intellij.util.messages.impl.MessageBusImplKt.invokeMethod(MessageBusImpl.kt:768)
at com.intellij.util.messages.impl.MessageBusImplKt.invokeListener(MessageBusImpl.kt:708)
at com.intellij.util.messages.impl.MessageBusImplKt.executeOrAddToQueue(MessageBusImpl.kt:533)
at com.intellij.util.messages.impl.ToDirectChildrenMessagePublisher.publish$intellij_platform_core(CompositeMessageBus.kt:281)
at com.intellij.util.messages.impl.MessagePublisher.invoke(MessageBusImpl.kt:481)
at jdk.proxy2/jdk.proxy2.$Proxy179.after(Unknown Source)
at com.intellij.openapi.vfs.newvfs.persistent.PersistentFSImpl.lambda$fireAfterEvents$26(PersistentFSImpl.java:1518)
at com.intellij.openapi.vfs.newvfs.persistent.PersistentFSImpl.runSuppressing(PersistentFSImpl.java:1148)
at com.intellij.openapi.vfs.newvfs.persistent.PersistentFSImpl.fireAfterEvents(PersistentFSImpl.java:1515)
at com.intellij.openapi.vfs.newvfs.persistent.PersistentFSImpl$3.writeToDisk(PersistentFSImpl.java:1067)
at com.intellij.openapi.vfs.newvfs.persistent.PersistentFSImpl$3.close(PersistentFSImpl.java:1050)
at com.intellij.openapi.fileEditor.impl.LoadTextUtil.write(LoadTextUtil.java:430)
at com.intellij.openapi.fileEditor.impl.FileDocumentManagerImpl.lambda$doSaveDocumentInWriteAction$3(FileDocumentManagerImpl.java:445)
at com.intellij.pom.core.impl.PomModelImpl.guardPsiModificationsIn(PomModelImpl.java:332)
at com.intellij.openapi.fileEditor.impl.FileDocumentManagerImpl.doSaveDocumentInWriteAction(FileDocumentManagerImpl.java:433)
at com.intellij.openapi.fileEditor.impl.FileDocumentManagerImpl.lambda$doSaveDocument$2(FileDocumentManagerImpl.java:386)
at com.intellij.openapi.application.WriteAction.lambda$run$1(WriteAction.java:85)
at com.intellij.openapi.application.impl.AnyThreadWriteThreadingSupport.runWriteAction$lambda$15(AnyThreadWriteThreadingSupport.kt:623)
at com.intellij.openapi.application.impl.AnyThreadWriteThreadingSupport.runWithTemporaryThreadLocal(AnyThreadWriteThreadingSupport.kt:204)
at com.intellij.openapi.application.impl.AnyThreadWriteThreadingSupport.runWriteAction(AnyThreadWriteThreadingSupport.kt:623)
at com.intellij.openapi.application.impl.AnyThreadWriteThreadingSupport.runWriteAction(AnyThreadWriteThreadingSupport.kt:617)
at com.intellij.openapi.application.impl.ApplicationImpl.runWriteAction(ApplicationImpl.java:998)
at com.intellij.openapi.application.WriteAction.run(WriteAction.java:84)
at com.intellij.openapi.fileEditor.impl.FileDocumentManagerImpl.doSaveDocument(FileDocumentManagerImpl.java:386)
at com.intellij.openapi.fileEditor.impl.FileDocumentManagerImpl.saveDocuments(FileDocumentManagerImpl.java:303)
at com.intellij.openapi.fileEditor.impl.FileDocumentManagerImpl.saveAllDocuments(FileDocumentManagerImpl.java:278)
at com.intellij.openapi.fileEditor.impl.FileDocumentManagerImpl.saveAllDocuments(FileDocumentManagerImpl.java:271)
at com.intellij.ide.actions.SaveAllAction.actionPerformed(SaveAllAction.kt:25)
at com.intellij.openapi.actionSystem.ex.ActionUtil.doPerformActionOrShowPopup(ActionUtil.kt:383)
at com.intellij.openapi.keymap.impl.ActionProcessor.performAction(ActionProcessor.java:32)
at com.intellij.openapi.keymap.impl.IdeKeyEventDispatcher$actionProcessor$1.performAction(IdeKeyEventDispatcher.kt:498)
at com.intellij.openapi.keymap.impl.IdeKeyEventDispatcherKt.doPerformActionInner$lambda$8$lambda$7(IdeKeyEventDispatcher.kt:846)
at com.intellij.openapi.application.TransactionGuardImpl.performActivity(TransactionGuardImpl.java:109)
at com.intellij.openapi.application.TransactionGuardImpl.performUserActivity(TransactionGuardImpl.java:98)
at com.intellij.openapi.keymap.impl.IdeKeyEventDispatcherKt.doPerformActionInner$lambda$8(IdeKeyEventDispatcher.kt:846)
at com.intellij.openapi.actionSystem.impl.ActionManagerImpl.performWithActionCallbacks(ActionManagerImpl.kt:1167)
at com.intellij.openapi.actionSystem.ex.ActionUtil.performDumbAwareWithCallbacks(ActionUtil.kt:405)
at com.intellij.openapi.keymap.impl.IdeKeyEventDispatcherKt.doPerformActionInner(IdeKeyEventDispatcher.kt:844)
at com.intellij.openapi.keymap.impl.IdeKeyEventDispatcherKt.access$doPerformActionInner(IdeKeyEventDispatcher.kt:1)
at com.intellij.openapi.keymap.impl.IdeKeyEventDispatcher.processAction(IdeKeyEventDispatcher.kt:576)
at com.intellij.openapi.keymap.impl.IdeKeyEventDispatcher.processAction(IdeKeyEventDispatcher.kt:511)
at com.intellij.openapi.keymap.impl.IdeKeyEventDispatcher.processActionOrWaitSecondStroke(IdeKeyEventDispatcher.kt:450)
at com.intellij.openapi.keymap.impl.IdeKeyEventDispatcher.inInitState(IdeKeyEventDispatcher.kt:443)
at com.intellij.openapi.keymap.impl.IdeKeyEventDispatcher.dispatchKeyEvent(IdeKeyEventDispatcher.kt:305)
at com.intellij.ide.IdeEventQueue.dispatchKeyEvent(IdeEventQueue.kt:515)
at com.intellij.ide.IdeEventQueue._dispatchEvent$lambda$17(IdeEventQueue.kt:474)
at com.intellij.openapi.application.impl.AnyThreadWriteThreadingSupport.runWriteIntentReadAction$lambda$6(AnyThreadWriteThreadingSupport.kt:274)
at com.intellij.openapi.application.impl.AnyThreadWriteThreadingSupport.runWithTemporaryThreadLocal(AnyThreadWriteThreadingSupport.kt:204)
at com.intellij.openapi.application.impl.AnyThreadWriteThreadingSupport.runWriteIntentReadAction(AnyThreadWriteThreadingSupport.kt:274)
at com.intellij.openapi.application.impl.AnyThreadWriteThreadingSupport.runPreventiveWriteIntentReadAction(AnyThreadWriteThreadingSupport.kt:218)
at com.intellij.ide.IdeEventQueue._dispatchEvent(IdeEventQueue.kt:474)
at com.intellij.ide.IdeEventQueue.dispatchEvent$lambda$12$lambda$11$lambda$10$lambda$9(IdeEventQueue.kt:307)
at com.intellij.openapi.progress.impl.CoreProgressManager.computePrioritized(CoreProgressManager.java:864)
at com.intellij.ide.IdeEventQueue.dispatchEvent$lambda$12$lambda$11$lambda$10(IdeEventQueue.kt:306)
at com.intellij.ide.IdeEventQueueKt.performActivity$lambda$3(IdeEventQueue.kt:958)
at com.intellij.openapi.application.TransactionGuardImpl.performActivity(TransactionGuardImpl.java:117)
at com.intellij.ide.IdeEventQueueKt.performActivity(IdeEventQueue.kt:958)
at com.intellij.ide.IdeEventQueue.dispatchEvent$lambda$12(IdeEventQueue.kt:301)
at com.intellij.ide.IdeEventQueue.dispatchEvent(IdeEventQueue.kt:341)
at java.desktop/java.awt.EventDispatchThread.pumpOneEventForFilters(EventDispatchThread.java:207)
at java.desktop/java.awt.EventDispatchThread.pumpEventsForFilter(EventDispatchThread.java:128)
at java.desktop/java.awt.EventDispatchThread.pumpEventsForHierarchy(EventDispatchThread.java:117)
at java.desktop/java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:113)
at java.desktop/java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:105)
at java.desktop/java.awt.EventDispatchThread.run(EventDispatchThread.java:92)
Metadata
Metadata
Assignees
Labels
bugSomething isn't working
Type
Projects
- StatusShow more project fieldsDone

Activity
angelozerr commentedon May 30, 2025
You will have this problem every time since now I use capability to know if didSave must be done.
You language server returns:
with a
save, I need to take care of that, but I don't know if it means that you don't support save.rcjsuen commentedon May 30, 2025
According to the 3.17 specification, I do not think I am doing anything wrong. I have returned a valid
TextDocumentSyncOptionsobject. 🤔rcjsuen commentedon May 30, 2025
Oh, I see now. Interesting, if you search for
TextDocumentSyncOptions {in the specification I see two hits. And the other one has more content.I think it's assumed that the value is
falseif it issave?is not there.angelozerr commentedon May 30, 2025
Not sure with that because if you define only TextDocumentSynchKind, save is enabled.
[-]NPE thrown when saving too early[/-][+]NPE thrown when server returns a TextDocumentSyncOptions.save to null[/+]fix: NPE thrown when server returns a TextDocumentSyncOptions.save to
angelozerr commentedon May 30, 2025
@rcjsuen please see PR #1078 and review it. I enabled the save if not present but I don't know if it is correct. Could you try with vscode and tell me of it send didSave when you save a file
angelozerr commentedon May 30, 2025
@rcjsuen I enable the save by default (if not present), if you see that vscode have different behavior please create an issue and I will fix it.
I decided to merge the PR to avoid having NPE.
rcjsuen commentedon May 30, 2025
No, it doesn't. Based on this code, I think it relies on
savebeing in the JSON-RPC payload or not.angelozerr commentedon May 30, 2025
If I understand correctly it should not send textDocument/didSave. right?
fix: NPE thrown when server returns a TextDocumentSyncOptions.save to