CodeGPT icon indicating copy to clipboard operation
CodeGPT copied to clipboard

java.lang.AssertionError: Wrong line separators

Open jessejii opened this issue 1 year ago • 0 comments

When selecting the code, an error occurs when opening the chat window. but V2.6.0 does not have this issue.

Relevant log output or stack trace

java.lang.AssertionError: Wrong line separators: '...        ];\r\n' at offset 216
	at com.intellij.openapi.util.text.StringUtil.assertValidSeparators(StringUtil.java:2485)
	at com.intellij.openapi.editor.impl.DocumentImpl.assertValidSeparators(DocumentImpl.java:710)
	at com.intellij.openapi.editor.impl.DocumentImpl.insertString(DocumentImpl.java:538)
	at com.intellij.openapi.editor.ex.util.LayeredLexerEditorHighlighter$LightMapper.finish(LayeredLexerEditorHighlighter.java:94)
	at com.intellij.openapi.editor.ex.util.LayeredLexerEditorHighlighter$1.finish(LayeredLexerEditorHighlighter.java:150)
	at com.intellij.openapi.editor.ex.util.LexerEditorHighlighter.doSetText(LexerEditorHighlighter.java:448)
	at com.intellij.openapi.editor.ex.util.LexerEditorHighlighter.setText(LexerEditorHighlighter.java:410)
	at com.intellij.openapi.editor.ex.util.LayeredLexerEditorHighlighter.setText(LayeredLexerEditorHighlighter.java:124)
	at com.intellij.openapi.editor.impl.EditorImpl.lambda$setHighlighter$25(EditorImpl.java:1387)
	at com.intellij.openapi.application.WriteIntentReadAction.lambda$run$0(WriteIntentReadAction.java:24)
	at com.intellij.openapi.application.impl.RwLockHolder.runWriteIntentReadAction(RwLockHolder.kt:70)
	at com.intellij.openapi.application.impl.ApplicationImpl.runWriteIntentReadAction(ApplicationImpl.java:903)
	at com.intellij.openapi.application.WriteIntentReadAction.compute(WriteIntentReadAction.java:55)
	at com.intellij.openapi.application.WriteIntentReadAction.run(WriteIntentReadAction.java:23)
	at com.intellij.openapi.editor.impl.EditorImpl.setHighlighter(EditorImpl.java:1379)
	at com.intellij.openapi.editor.impl.EditorFactoryImpl.createEditor(EditorFactoryImpl.java:197)
	at ee.carlrobert.codegpt.util.EditorUtil.createEditor(EditorUtil.kt:37)
	at ee.carlrobert.codegpt.toolwindow.chat.editor.ResponseEditorPanel.<init>(ResponseEditorPanel.java:57)
	at ee.carlrobert.codegpt.toolwindow.chat.ui.ChatMessageResponseBody.prepareProcessingCode(ChatMessageResponseBody.java:220)
	at ee.carlrobert.codegpt.toolwindow.chat.ui.ChatMessageResponseBody.processCode(ChatMessageResponseBody.java:197)
	at ee.carlrobert.codegpt.toolwindow.chat.ui.ChatMessageResponseBody.processResponse(ChatMessageResponseBody.java:183)
	at ee.carlrobert.codegpt.toolwindow.chat.ui.ChatMessageResponseBody.withResponse(ChatMessageResponseBody.java:78)
	at ee.carlrobert.codegpt.toolwindow.chat.ui.UserMessagePanel.createResponseBody(UserMessagePanel.java:62)
	at ee.carlrobert.codegpt.toolwindow.chat.ui.UserMessagePanel.<init>(UserMessagePanel.java:42)
	at ee.carlrobert.codegpt.toolwindow.chat.ChatToolWindowTabPanel.lambda$sendMessage$2(ChatToolWindowTabPanel.java:137)
	at java.desktop/java.awt.event.InvocationEvent.dispatch(InvocationEvent.java:318)
	at java.desktop/java.awt.EventQueue.dispatchEventImpl(EventQueue.java:792)
	at java.desktop/java.awt.EventQueue$3.run(EventQueue.java:739)
	at java.desktop/java.awt.EventQueue$3.run(EventQueue.java:733)
	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:761)
	at com.intellij.ide.IdeEventQueue.defaultDispatchEvent(IdeEventQueue.kt:698)
	at com.intellij.ide.IdeEventQueue._dispatchEvent$lambda$12(IdeEventQueue.kt:593)
	at com.intellij.openapi.application.impl.RwLockHolder.runWithoutImplicitRead(RwLockHolder.kt:105)
	at com.intellij.ide.IdeEventQueue._dispatchEvent(IdeEventQueue.kt:593)
	at com.intellij.ide.IdeEventQueue.access$_dispatchEvent(IdeEventQueue.kt:77)
	at com.intellij.ide.IdeEventQueue$dispatchEvent$processEventRunnable$1$1$1.compute(IdeEventQueue.kt:362)
	at com.intellij.ide.IdeEventQueue$dispatchEvent$processEventRunnable$1$1$1.compute(IdeEventQueue.kt:361)
	at com.intellij.openapi.progress.impl.CoreProgressManager.computePrioritized(CoreProgressManager.java:843)
	at com.intellij.ide.IdeEventQueue$dispatchEvent$processEventRunnable$1$1.invoke(IdeEventQueue.kt:361)
	at com.intellij.ide.IdeEventQueue$dispatchEvent$processEventRunnable$1$1.invoke(IdeEventQueue.kt:356)
	at com.intellij.ide.IdeEventQueueKt.performActivity$lambda$1(IdeEventQueue.kt:1021)
	at com.intellij.openapi.application.TransactionGuardImpl.performActivity(TransactionGuardImpl.java:106)
	at com.intellij.ide.IdeEventQueueKt.performActivity(IdeEventQueue.kt:1021)
	at com.intellij.ide.IdeEventQueue.dispatchEvent$lambda$7(IdeEventQueue.kt:356)
	at com.intellij.openapi.application.impl.RwLockHolder.runIntendedWriteActionOnCurrentThread(RwLockHolder.kt:209)
	at com.intellij.openapi.application.impl.ApplicationImpl.runIntendedWriteActionOnCurrentThread(ApplicationImpl.java:830)
	at com.intellij.ide.IdeEventQueue.dispatchEvent(IdeEventQueue.kt:398)
	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)

Steps to reproduce

No response

CodeGPT version

2.6.3

Operating System

windows 11, idea 2024.1

jessejii avatar Apr 22 '24 20:04 jessejii