Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

IllegalStateException: Synchronizer should apply to only a single document, which is the one it was instantiated for #752

Closed
gastaldi opened this issue Mar 16, 2023 · 5 comments · Fixed by #1081
Assignees
Labels
bug Something isn't working lsp4ij LSP client for IJ
Milestone

Comments

@gastaldi
Copy link
Contributor

When switching between branches in the http://github.com/quarkusio/quarkus project, I get an error from the plugin:

java.lang.IllegalStateException: Synchronizer should apply to only a single document, which is the one it was instantiated for
	at com.redhat.devtools.intellij.quarkus.lsp4ij.DocumentContentSynchronizer.checkEvent(DocumentContentSynchronizer.java:211)
	at com.redhat.devtools.intellij.quarkus.lsp4ij.DocumentContentSynchronizer.beforeDocumentChange(DocumentContentSynchronizer.java:108)
	at com.intellij.openapi.editor.impl.DocumentImpl.lambda$beforeChangedUpdate$1(DocumentImpl.java:881)
	at com.intellij.openapi.progress.impl.CoreProgressManager.lambda$executeNonCancelableSection$3(CoreProgressManager.java:222)
	at com.intellij.openapi.progress.impl.CoreProgressManager.registerIndicatorAndRun(CoreProgressManager.java:679)
	at com.intellij.openapi.progress.impl.CoreProgressManager.computeUnderProgress(CoreProgressManager.java:635)
	at com.intellij.openapi.progress.impl.CoreProgressManager.lambda$computeInNonCancelableSection$4(CoreProgressManager.java:230)
	at com.intellij.openapi.progress.Cancellation.computeInNonCancelableSection(Cancellation.java:99)
	at com.intellij.openapi.progress.impl.CoreProgressManager.computeInNonCancelableSection(CoreProgressManager.java:230)
	at com.intellij.openapi.progress.impl.CoreProgressManager.executeNonCancelableSection(CoreProgressManager.java:221)
	at com.intellij.openapi.editor.impl.DocumentImpl.beforeChangedUpdate(DocumentImpl.java:878)
	at com.intellij.openapi.editor.impl.DocumentImpl.updateText(DocumentImpl.java:818)
	at com.intellij.openapi.editor.impl.DocumentImpl.deleteString(DocumentImpl.java:580)
	at com.intellij.psi.impl.source.tree.injected.DocumentWindowImpl.deleteString(DocumentWindowImpl.java:305)
	at com.intellij.openapi.editor.EditorModificationUtilEx.deleteSelectedText(EditorModificationUtilEx.java:34)
	at com.intellij.codeInsight.editorActions.TypedHandler.lambda$doExecute$2(TypedHandler.java:185)
	at com.intellij.openapi.editor.impl.CaretModelImpl.lambda$runForEachCaret$3(CaretModelImpl.java:310)
	at com.intellij.openapi.editor.impl.CaretModelImpl.doWithCaretMerging(CaretModelImpl.java:419)
	at com.intellij.openapi.editor.impl.CaretModelImpl.runForEachCaret(CaretModelImpl.java:319)
	at com.intellij.openapi.editor.impl.CaretModelImpl.runForEachCaret(CaretModelImpl.java:296)
	at com.intellij.codeInsight.editorActions.TypedHandler.doExecute(TypedHandler.java:156)
	at com.intellij.codeInsight.editorActions.TypedHandler.lambda$execute$0(TypedHandler.java:135)
	at com.intellij.util.SlowOperations.allowSlowOperations(SlowOperations.java:167)
	at com.intellij.codeInsight.editorActions.TypedHandler.execute(TypedHandler.java:135)
	at com.intellij.codeInsight.lookup.impl.LookupTypedHandler.execute(LookupTypedHandler.java:73)
	at com.intellij.codeInsight.template.emmet.EmmetPreviewTypedHandler.execute(EmmetPreviewTypedHandler.java:39)
	at com.intellij.execution.impl.ConsoleViewImpl$MyTypedHandler.execute(ConsoleViewImpl.java:1154)
	at com.intellij.openapi.editor.impl.DefaultRawTypedHandler$1.run(DefaultRawTypedHandler.java:55)
	at com.intellij.openapi.application.impl.ApplicationImpl.runWriteAction(ApplicationImpl.java:980)
	at com.intellij.openapi.editor.impl.DefaultRawTypedHandler.execute(DefaultRawTypedHandler.java:49)
	at com.intellij.openapi.editor.impl.EditorFactoryImpl$MyRawTypedHandler.execute(EditorFactoryImpl.java:295)
	at com.intellij.openapi.editor.actionSystem.TypedAction.lambda$actionPerformed$2(TypedAction.java:200)
	at com.intellij.reporting.FreezeLoggerImpl.runUnderPerformanceMonitor(FreezeLoggerImpl.java:28)
	at com.intellij.openapi.editor.actionSystem.TypedAction.lambda$actionPerformed$3(TypedAction.java:199)
	at com.intellij.util.SlowOperations.allowSlowOperations(SlowOperations.java:167)
	at com.intellij.openapi.editor.actionSystem.TypedAction.actionPerformed(TypedAction.java:199)
	at com.intellij.openapi.editor.impl.EditorImpl.processKeyTypedNormally(EditorImpl.java:1333)
	at com.intellij.openapi.editor.impl.EditorImpl.processKeyTyped(EditorImpl.java:1315)
	at com.intellij.openapi.editor.impl.EditorImpl.processKeyTyped(EditorImpl.java:3492)
	at com.intellij.openapi.editor.impl.EditorImpl$7.keyTyped(EditorImpl.java:1148)
	at java.desktop/java.awt.AWTEventMulticaster.keyTyped(AWTEventMulticaster.java:247)
	at java.desktop/java.awt.Component.processKeyEvent(Component.java:6603)
	at java.desktop/javax.swing.JComponent.processKeyEvent(JComponent.java:2899)
	at java.desktop/java.awt.Component.processEvent(Component.java:6425)
	at java.desktop/java.awt.Container.processEvent(Container.java:2266)
	at java.desktop/java.awt.Component.dispatchEventImpl(Component.java:5022)
	at java.desktop/java.awt.Container.dispatchEventImpl(Container.java:2324)
	at java.desktop/java.awt.Component.dispatchEvent(Component.java:4854)
	at java.desktop/java.awt.KeyboardFocusManager.redispatchEvent(KeyboardFocusManager.java:1953)
	at java.desktop/java.awt.DefaultKeyboardFocusManager.dispatchKeyEvent(DefaultKeyboardFocusManager.java:886)
	at java.desktop/java.awt.DefaultKeyboardFocusManager.preDispatchKeyEvent(DefaultKeyboardFocusManager.java:1166)
	at java.desktop/java.awt.DefaultKeyboardFocusManager.typeAheadAssertions(DefaultKeyboardFocusManager.java:1023)
	at java.desktop/java.awt.DefaultKeyboardFocusManager.dispatchEvent(DefaultKeyboardFocusManager.java:849)
	at com.intellij.ide.IdeKeyboardFocusManager.lambda$dispatchEvent$0(IdeKeyboardFocusManager.java:32)
	at com.intellij.openapi.application.TransactionGuardImpl.performActivity(TransactionGuardImpl.java:105)
	at com.intellij.ide.IdeEventQueue.performActivity(IdeEventQueue.java:615)
	at com.intellij.ide.IdeKeyboardFocusManager.dispatchEvent(IdeKeyboardFocusManager.java:32)
	at java.desktop/java.awt.Component.dispatchEventImpl(Component.java:4903)
	at java.desktop/java.awt.Container.dispatchEventImpl(Container.java:2324)
	at java.desktop/java.awt.Window.dispatchEventImpl(Window.java:2802)
	at java.desktop/java.awt.Component.dispatchEvent(Component.java:4854)
	at java.desktop/java.awt.EventQueue.dispatchEventImpl(EventQueue.java:781)
	at java.desktop/java.awt.EventQueue$4.run(EventQueue.java:730)
	at java.desktop/java.awt.EventQueue$4.run(EventQueue.java:724)
	at java.base/java.security.AccessController.doPrivileged(AccessController.java:399)
	at java.base/java.security.ProtectionDomain$JavaSecurityAccessImpl.doIntersectionPrivilege(ProtectionDomain.java:86)
	at java.base/java.security.ProtectionDomain$JavaSecurityAccessImpl.doIntersectionPrivilege(ProtectionDomain.java:97)
	at java.desktop/java.awt.EventQueue$5.run(EventQueue.java:754)
	at java.desktop/java.awt.EventQueue$5.run(EventQueue.java:752)
	at java.base/java.security.AccessController.doPrivileged(AccessController.java:399)
	at java.base/java.security.ProtectionDomain$JavaSecurityAccessImpl.doIntersectionPrivilege(ProtectionDomain.java:86)
	at java.desktop/java.awt.EventQueue.dispatchEvent(EventQueue.java:751)
	at com.intellij.ide.IdeEventQueue.defaultDispatchEvent(IdeEventQueue.java:909)
	at com.intellij.ide.IdeEventQueue.dispatchKeyEvent(IdeEventQueue.java:818)
	at com.intellij.ide.IdeEventQueue._dispatchEvent(IdeEventQueue.java:750)
	at com.intellij.ide.IdeEventQueue.lambda$dispatchEvent$5(IdeEventQueue.java:437)
	at com.intellij.openapi.progress.impl.CoreProgressManager.computePrioritized(CoreProgressManager.java:787)
	at com.intellij.ide.IdeEventQueue.lambda$dispatchEvent$6(IdeEventQueue.java:436)
	at com.intellij.openapi.application.TransactionGuardImpl.performActivity(TransactionGuardImpl.java:113)
	at com.intellij.ide.IdeEventQueue.performActivity(IdeEventQueue.java:615)
	at com.intellij.ide.IdeEventQueue.lambda$dispatchEvent$7(IdeEventQueue.java:434)
	at com.intellij.openapi.application.impl.ApplicationImpl.runIntendedWriteActionOnCurrentThread(ApplicationImpl.java:838)
	at com.intellij.ide.IdeEventQueue.dispatchEvent(IdeEventQueue.java:480)
	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)
	Suppressed: java.lang.IllegalStateException: Synchronizer should apply to only a single document, which is the one it was instantiated for
		at com.redhat.devtools.intellij.quarkus.lsp4ij.DocumentContentSynchronizer.checkEvent(DocumentContentSynchronizer.java:211)
		at com.redhat.devtools.intellij.quarkus.lsp4ij.DocumentContentSynchronizer.documentChanged(DocumentContentSynchronizer.java:81)
		at com.intellij.openapi.editor.impl.DocumentImpl.lambda$changedUpdate$2(DocumentImpl.java:922)
		at com.intellij.openapi.progress.impl.CoreProgressManager.lambda$executeNonCancelableSection$3(CoreProgressManager.java:222)
		at com.intellij.openapi.progress.impl.CoreProgressManager.registerIndicatorAndRun(CoreProgressManager.java:679)
		at com.intellij.openapi.progress.impl.CoreProgressManager.computeUnderProgress(CoreProgressManager.java:635)
		at com.intellij.openapi.progress.impl.CoreProgressManager.lambda$computeInNonCancelableSection$4(CoreProgressManager.java:230)
		at com.intellij.openapi.progress.Cancellation.computeInNonCancelableSection(Cancellation.java:99)
		at com.intellij.openapi.progress.impl.CoreProgressManager.computeInNonCancelableSection(CoreProgressManager.java:230)
		at com.intellij.openapi.progress.impl.CoreProgressManager.executeNonCancelableSection(CoreProgressManager.java:221)
		at com.intellij.openapi.editor.impl.DocumentImpl.changedUpdate(DocumentImpl.java:919)
		at com.intellij.openapi.editor.impl.DocumentImpl.updateText(DocumentImpl.java:823)
		... 77 more
@adietish adietish self-assigned this Apr 4, 2023
@adietish adietish moved this to 📋 Backlog in IDE Cloudaptors Apr 4, 2023
@adietish adietish removed their assignment Apr 4, 2023
@adietish adietish removed the status in IDE Cloudaptors Apr 4, 2023
@adietish adietish moved this to 📋 Backlog in IDE Cloudaptors Apr 4, 2023
@adietish adietish self-assigned this Apr 4, 2023
@adietish adietish added the bug Something isn't working label Apr 5, 2023
@angelozerr
Copy link
Contributor

I cannot reproduce the problem but as I'm newbie with IJ perhaps I don't do the proper usecase.

I have an idea about the problem but without usecase it will hard for me to test it.

@adietish could you reproduce the problem?

@angelozerr
Copy link
Contributor

@gastaldi have you every time this trouble? I tried to switch to branches but I cannot reproduce the problem.

Please help me to reproduce the problem.

angelozerr added a commit to angelozerr/intellij-quarkus that referenced this issue Apr 20, 2023
document, which is the one it was instantiated for

Fixes redhat-developer#752

Signed-off-by: azerr <[email protected]>
angelozerr added a commit to angelozerr/intellij-quarkus that referenced this issue Apr 20, 2023
document, which is the one it was instantiated for

Fixes redhat-developer#752

Signed-off-by: azerr <[email protected]>
@gastaldi
Copy link
Contributor Author

@angelozerr I don't remember exactly how I reproduced it. It may have happened once (or twice) while I was editing an Asciidoc in the docs/ and switched projects (between quarkus and registry.quarkus.io).

I'll give your PR a try and see if I can reproduce it again

@angelozerr
Copy link
Contributor

Performance and freeze problem should be fixed with #849

Please repoen if you find some again troubles

@github-project-automation github-project-automation bot moved this from 🏗 In progress to ✅ Done in IDE Cloudaptors May 19, 2023
@angelozerr angelozerr added this to the 1.19.0 milestone May 19, 2023
@angelozerr
Copy link
Contributor

I reopen this issue since @ia3andy and @wiesnery #812 (comment) have encountered the issue.

You are so lucky guys, I have never encountered this issue and I have no idea how to reproduce it -(

@angelozerr angelozerr reopened this Jul 19, 2023
@angelozerr angelozerr removed this from the 1.19.0 milestone Jul 19, 2023
@angelozerr angelozerr added this to the 1.24.0 milestone Jul 19, 2023
@angelozerr angelozerr moved this from ✅ Done to 📋 Backlog in IDE Cloudaptors Jul 19, 2023
@angelozerr angelozerr moved this from 📋 Backlog to 🏗 In progress in IDE Cloudaptors Jul 19, 2023
@angelozerr angelozerr moved this from 🏗 In progress to 📋 Backlog in IDE Cloudaptors Jul 25, 2023
angelozerr added a commit to angelozerr/intellij-quarkus that referenced this issue Aug 4, 2023
document, which is the one it was instantiated for

Fixes redhat-developer#752

Signed-off-by: azerr <[email protected]>
angelozerr added a commit to angelozerr/intellij-quarkus that referenced this issue Aug 8, 2023
document, which is the one it was instantiated for

Fixes redhat-developer#752

Signed-off-by: azerr <[email protected]>
angelozerr added a commit to angelozerr/intellij-quarkus that referenced this issue Aug 8, 2023
document, which is the one it was instantiated for

Fixes redhat-developer#752

Signed-off-by: azerr <[email protected]>
fbricon pushed a commit that referenced this issue Aug 8, 2023
document, which is the one it was instantiated for

Fixes #752

Signed-off-by: azerr <[email protected]>
@github-project-automation github-project-automation bot moved this from 📋 Backlog to ✅ Done in IDE Cloudaptors Aug 8, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment