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

Throws exception when opening project #329

Closed
ice1000 opened this Issue Nov 19, 2018 · 10 comments

Comments

Projects
None yet
2 participants
@ice1000
Contributor

ice1000 commented Nov 19, 2018

Stacktrace:

java.lang.IllegalStateException: TextAttributeKey(name:'CABAL_COLON', fallbackAttributeKey:'DEFAULT_BRACES')  was already registered with the other fallback attribute key: DEFAULT_OPERATION_SIGN
	at com.intellij.openapi.editor.colors.TextAttributesKey.mergeKeys(TextAttributesKey.java:214)
	at com.intellij.openapi.editor.colors.TextAttributesKey.lambda$getOrCreate$4(TextAttributesKey.java:200)
	at java.util.concurrent.ConcurrentHashMap.compute(ConcurrentHashMap.java:1877)
	at com.intellij.openapi.editor.colors.TextAttributesKey.getOrCreate(TextAttributesKey.java:200)
	at com.intellij.openapi.editor.colors.TextAttributesKey.createTextAttributesKey(TextAttributesKey.java:187)
	at intellij.haskell.cabal.highlighting.CabalSyntaxHighlighter$.<init>(CabalSyntaxHighlighter.scala:15)
	at intellij.haskell.cabal.highlighting.CabalSyntaxHighlighter$.<clinit>(CabalSyntaxHighlighter.scala)
	at intellij.haskell.cabal.highlighting.CabalSyntaxHighlighter.getTokenHighlights(CabalSyntaxHighlighter.scala:28)
	at com.intellij.openapi.editor.ex.util.LexerEditorHighlighter.getAttributes(LexerEditorHighlighter.java:401)
	at com.intellij.openapi.editor.ex.util.LexerEditorHighlighter.access$200(LexerEditorHighlighter.java:39)
	at com.intellij.openapi.editor.ex.util.LexerEditorHighlighter$HighlighterIteratorImpl.getTextAttributes(LexerEditorHighlighter.java:517)
	at com.intellij.openapi.editor.impl.view.IterationState.setAttributes(IterationState.java:508)
	at com.intellij.openapi.editor.impl.view.IterationState.reinit(IterationState.java:477)
	at com.intellij.openapi.editor.impl.view.IterationState.advance(IterationState.java:296)
	at com.intellij.openapi.editor.impl.view.IterationState.<init>(IterationState.java:154)
	at com.intellij.openapi.editor.impl.view.LineLayout$Chunk.ensureLayout(LineLayout.java:607)
	at com.intellij.openapi.editor.impl.view.LineLayout$Chunk.access$2800(LineLayout.java:586)
	at com.intellij.openapi.editor.impl.view.LineLayout$VisualOrderIterator.hasNext(LineLayout.java:724)
	at com.intellij.openapi.editor.impl.view.VisualLineFragmentsIterator.hasNext(VisualLineFragmentsIterator.java:224)
	at com.intellij.openapi.editor.impl.view.EditorCoordinateMapper.logicalToVisualPosition(EditorCoordinateMapper.java:106)
	at com.intellij.openapi.editor.impl.view.EditorView.logicalToVisualPosition(EditorView.java:169)
	at com.intellij.openapi.editor.impl.EditorImpl.logicalToVisualPosition(EditorImpl.java:2159)
	at com.intellij.openapi.editor.impl.CaretImpl.calcY(CaretImpl.java:703)
	at com.intellij.openapi.editor.impl.CaretImpl.setCurrentLogicalCaret(CaretImpl.java:748)
	at com.intellij.openapi.editor.impl.CaretImpl.updateVisualPosition(CaretImpl.java:714)
	at com.intellij.openapi.editor.impl.CaretModelImpl.updateVisualPosition(CaretModelImpl.java:115)
	at com.intellij.openapi.editor.impl.EditorImpl.reinitSettings(EditorImpl.java:910)
	at com.intellij.openapi.editor.impl.EditorImpl.reinitSettings(EditorImpl.java:867)
	at com.intellij.openapi.editor.impl.EditorImpl.setHighlighter(EditorImpl.java:1271)
	at com.intellij.openapi.fileEditor.impl.text.TextEditorImpl.lambda$loadEditorInBackground$0(TextEditorImpl.java:83)
	at com.intellij.openapi.fileEditor.impl.text.PsiAwareTextEditorImpl.lambda$loadEditorInBackground$0(PsiAwareTextEditorImpl.java:60)
	at com.intellij.openapi.fileEditor.impl.text.AsyncEditorLoader.loadingFinished(AsyncEditorLoader.java:207)
	at com.intellij.openapi.fileEditor.impl.text.AsyncEditorLoader.start(AsyncEditorLoader.java:73)
	at com.intellij.openapi.fileEditor.impl.text.TextEditorImpl.<init>(TextEditorImpl.java:66)
	at com.intellij.openapi.fileEditor.impl.text.PsiAwareTextEditorImpl.<init>(PsiAwareTextEditorImpl.java:45)
	at com.intellij.openapi.fileEditor.impl.text.PsiAwareTextEditorProvider.createEditor(PsiAwareTextEditorProvider.java:36)
	at com.intellij.openapi.fileEditor.impl.FileEditorManagerImpl.lambda$openFileImpl4$8(FileEditorManagerImpl.java:856)
	at com.intellij.openapi.application.impl.ApplicationImpl.invokeAndWait(ApplicationImpl.java:670)
	at com.intellij.openapi.application.impl.ApplicationImpl.invokeAndWait(ApplicationImpl.java:683)
	at com.intellij.openapi.fileEditor.impl.FileEditorManagerImpl.openFileImpl4(FileEditorManagerImpl.java:961)
	at com.intellij.openapi.fileEditor.impl.FileEditorManagerImpl.openFileImpl3(FileEditorManagerImpl.java:781)
	at com.intellij.openapi.fileEditor.impl.FileEditorManagerImpl.lambda$openFileImpl2$4(FileEditorManagerImpl.java:763)
	at com.intellij.openapi.command.impl.CoreCommandProcessor.executeCommand(CoreCommandProcessor.java:212)
	at com.intellij.openapi.command.impl.CoreCommandProcessor.executeCommand(CoreCommandProcessor.java:178)
	at com.intellij.openapi.command.impl.CoreCommandProcessor.executeCommand(CoreCommandProcessor.java:168)
	at com.intellij.openapi.command.impl.CoreCommandProcessor.executeCommand(CoreCommandProcessor.java:154)
	at com.intellij.openapi.fileEditor.impl.FileEditorManagerImpl.openFileImpl2(FileEditorManagerImpl.java:763)
	at com.intellij.openapi.fileEditor.impl.FileEditorManagerImpl.openFileWithProviders(FileEditorManagerImpl.java:694)
	at com.intellij.openapi.fileEditor.ex.FileEditorManagerEx.openFile(FileEditorManagerEx.java:145)
	at com.intellij.openapi.fileEditor.impl.FileEditorManagerImpl.lambda$openEditor$10(FileEditorManagerImpl.java:1119)
	at com.intellij.openapi.command.impl.CoreCommandProcessor.executeCommand(CoreCommandProcessor.java:220)
	at com.intellij.openapi.command.impl.CoreCommandProcessor.executeCommand(CoreCommandProcessor.java:178)
	at com.intellij.openapi.command.impl.CoreCommandProcessor.executeCommand(CoreCommandProcessor.java:168)
	at com.intellij.openapi.command.impl.CoreCommandProcessor.executeCommand(CoreCommandProcessor.java:154)
	at com.intellij.openapi.fileEditor.impl.FileEditorManagerImpl.openEditor(FileEditorManagerImpl.java:1117)
	at com.intellij.openapi.fileEditor.OpenFileDescriptor.navigateInAnyFileEditor(OpenFileDescriptor.java:152)
	at com.intellij.openapi.fileEditor.OpenFileDescriptor.navigateInEditor(OpenFileDescriptor.java:138)
	at com.intellij.openapi.fileEditor.OpenFileDescriptor.navigateInEditorOrNativeApp(OpenFileDescriptor.java:134)
	at com.intellij.openapi.fileEditor.OpenFileDescriptor.navigate(OpenFileDescriptor.java:117)
	at com.intellij.platform.PlatformProjectOpenProcessor.lambda$null$1(PlatformProjectOpenProcessor.java:292)
	at com.intellij.openapi.application.TransactionGuardImpl$2.run(TransactionGuardImpl.java:315)
	at com.intellij.openapi.application.impl.LaterInvocator$FlushQueue.doRun(LaterInvocator.java:435)
	at com.intellij.openapi.application.impl.LaterInvocator$FlushQueue.runNextEvent(LaterInvocator.java:419)
	at com.intellij.openapi.application.impl.LaterInvocator$FlushQueue.run(LaterInvocator.java:403)
	at java.awt.event.InvocationEvent.dispatch(InvocationEvent.java:311)
	at java.awt.EventQueue.dispatchEventImpl(EventQueue.java:762)
	at java.awt.EventQueue.access$500(EventQueue.java:98)
	at java.awt.EventQueue$3.run(EventQueue.java:715)
	at java.awt.EventQueue$3.run(EventQueue.java:709)
	at java.security.AccessController.doPrivileged(Native Method)
	at java.security.ProtectionDomain$JavaSecurityAccessImpl.doIntersectionPrivilege(ProtectionDomain.java:80)
	at java.awt.EventQueue.dispatchEvent(EventQueue.java:732)
	at com.intellij.ide.IdeEventQueue.defaultDispatchEvent(IdeEventQueue.java:719)
	at com.intellij.ide.IdeEventQueue._dispatchEvent(IdeEventQueue.java:668)
	at com.intellij.ide.IdeEventQueue.dispatchEvent(IdeEventQueue.java:363)
	at java.awt.EventDispatchThread.pumpOneEventForFilters(EventDispatchThread.java:201)
	at java.awt.EventDispatchThread.pumpEventsForFilter(EventDispatchThread.java:116)
	at java.awt.EventDispatchThread.pumpEventsForHierarchy(EventDispatchThread.java:105)
	at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:101)
	at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:93)
	at java.awt.EventDispatchThread.run(EventDispatchThread.java:82)

OS: Windows 10 Pro
IDE: IntelliJ IDEA Community 2018.3 RC (build 183.4284.118)
Plugin version: 1.0.0-beta12
Project opened: owo-lang/OwO@539849b

@ice1000

This comment has been minimized.

Contributor

ice1000 commented Nov 19, 2018

Ooops, I was opening the cabal file instead of the project.

@ice1000

This comment has been minimized.

Contributor

ice1000 commented Nov 19, 2018

This can't be the reason for the plugin to crash, tho.

@rikvdkleij

This comment has been minimized.

Owner

rikvdkleij commented Nov 19, 2018

You will have to open the folder of the project (which contains the stack.yaml).

And it is better to use the latest beta of the plugin. See readme how to install.

@ice1000

This comment has been minimized.

Contributor

ice1000 commented Nov 19, 2018

You will have to open the folder of the project (which contains the stack.yaml).

image

@ice1000

This comment has been minimized.

Contributor

ice1000 commented Nov 19, 2018

I'll try out the beta version.

@rikvdkleij

This comment has been minimized.

Owner

rikvdkleij commented Nov 21, 2018

This can't be the reason for the plugin to crash, tho.

That crash should be prevented in the latest betas.

@ice1000

This comment has been minimized.

Contributor

ice1000 commented Nov 21, 2018

That crash should be prevented in the latest betas.

Yes, I just installed and realized that.
Thanks for the great work!

BTW: are you interested in replacing the current icon with a more IntelliJ-styled one (placing the language icon at the right-bottom corner like this )? I'm willing to help.
BTW: any reason for not highlighting qualified and as as keywords? I'm willing to add an annotator to highlight them.

@rikvdkleij

This comment has been minimized.

Owner

rikvdkleij commented Nov 22, 2018

BTW: are you interested in replacing the current icon with a more IntelliJ-styled one (placing the language icon at the right-bottom corner like this )? I'm willing to help.

Thank you but the current icon is okay for me

BTW: any reason for not highlighting qualified and as as keywords? I'm willing to add an annotator to highlight them.

qualified and as are not highlighted as keywords because it depends on context. For example, it is allowed to create function which has name qualified. They are not defined in the lexer so I can not refer to them as token as is how the IntelliJ syntax highlighting works.

@ice1000

This comment has been minimized.

Contributor

ice1000 commented Nov 22, 2018

I know what you mean, but I know how to highlight them contextually.
Will implement and submit PR soon :)

@ice1000

This comment has been minimized.

Contributor

ice1000 commented Nov 27, 2018

Close as fixed in beta build

@ice1000 ice1000 closed this Nov 27, 2018

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment