CssReferenceProvider not working with JSP tag attribute?
I'm trying to register above provider with attributes from Tags but always get the following exception:
No message
java.lang.NullPointerException
at com.intellij.psi.impl.source.resolve.ResolveUtil.getReferencesFromProviders(ResolveUtil.java:28)
at com.intellij.psi.impl.source.xml.XmlAttributeValueImpl.getReferences(XmlAttributeValueImpl.java:4)
at com.intellij.psi.css.actions.CreateStyleAction.a(CreateStyleAction.java:12)
at com.intellij.psi.css.actions.CreateStyleAction.isAvailable(CreateStyleAction.java:8)
at com.intellij.codeInsight.daemon.impl.ShowIntentionsPass.a(ShowIntentionsPass.java:136)
at com.intellij.codeInsight.daemon.impl.ShowIntentionsPass.doApplyInformationToEditor(ShowIntentionsPass.java:47)
at com.intellij.codeInsight.daemon.impl.TextEditorHighlightingPass.applyInformationToEditor(TextEditorHighlightingPass.java:4)
at com.intellij.codeInsight.daemon.impl.DaemonCodeAnalyzerImpl$7$1.run(DaemonCodeAnalyzerImpl.java:1)
at com.intellij.openapi.application.impl.LaterInvocatorEx$FlushQueue.run(LaterInvocatorEx.java:16)
at java.awt.event.InvocationEvent.dispatch(InvocationEvent.java:209)
at java.awt.EventQueue.dispatchEvent(EventQueue.java:461)
at com.intellij.ide.IdeEventQueue.defaultDispatchEvent(IdeEventQueue.java:19)
at com.intellij.ide.IdeEventQueue.a(IdeEventQueue.java:30)
at com.intellij.ide.IdeEventQueue.dispatchEvent(IdeEventQueue.java:37)
at java.awt.EventDispatchThread.pumpOneEventForHierarchy(EventDispatchThread.java:242)
at java.awt.EventDispatchThread.pumpEventsForHierarchy(EventDispatchThread.java:163)
at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:157)
at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:149)
at java.awt.EventDispatchThread.run(EventDispatchThread.java:110)
Am I doing something wrong or is it not possible?
Thanks,
Yann
请先登录再写评论。
Hello Yann,
YC> I'm trying to register above provider with attributes from Tags but
YC> always get the following exception:
YC>
YC> No message
YC> java.lang.NullPointerException
YC> at
YC> com.intellij.psi.impl.source.resolve.ResolveUtil.getReferencesFromPr
YC> oviders(ResolveUtil.java:28)
When posting stacktraces to newsgroups, please, always specify the build
on which the stacktrace was generated.
--
Dmitry Jemerov
Software Developer
JetBrains, Inc.
http://www.jetbrains.com
"Develop with pleasure!"
sorry, #3496
still in #4055, is that possible at all??
any comments?
Stack trace from recent build please.
Yann Cebron wrote:
--
Best regards,
Maxim Mossienko
IntelliJ Labs / JetBrains Inc.
http://www.intellij.com
"Develop with pleasure!"
#4109:
No message
java.lang.NullPointerException
at com.intellij.psi.impl.source.resolve.ResolveUtil.getReferencesFromProviders(ResolveUtil.java:70)
at com.intellij.psi.impl.source.xml.XmlAttributeValueImpl.getReferences(XmlAttributeValueImpl.java:5)
at com.intellij.psi.impl.SharedPsiElementImplUtil.a(SharedPsiElementImplUtil.java:47)
at com.intellij.psi.impl.SharedPsiElementImplUtil.findReferenceAt(SharedPsiElementImplUtil.java:42)
at com.intellij.psi.impl.source.TreeWrapperPsiElement.findReferenceAt(TreeWrapperPsiElement.java:36)
at com.intellij.psi.impl.source.jsp.JspxFileImpl.findReferenceAt(JspxFileImpl.java:58)
at com.intellij.codeInsight.completion.CompletionContext.init(CompletionContext.java:68)
at com.intellij.codeInsight.completion.CompletionContext.]]>(CompletionContext.java:55)
at com.intellij.codeInsight.completion.CodeCompletionHandlerBase.invoke(CodeCompletionHandlerBase.java:29)
at com.intellij.codeInsight.actions.BaseCodeInsightAction$1$1.run(BaseCodeInsightAction.java:2)
at com.intellij.openapi.application.impl.ApplicationImpl.runWriteAction(ApplicationImpl.java:410)
at com.intellij.codeInsight.actions.BaseCodeInsightAction$1.run(BaseCodeInsightAction.java:6)
at com.intellij.openapi.command.impl.CommandProcessorImpl.executeCommand(CommandProcessorImpl.java:114)
at com.intellij.openapi.command.impl.CommandProcessorImpl.executeCommand(CommandProcessorImpl.java:34)
at com.intellij.codeInsight.actions.BaseCodeInsightAction.actionPerformedImpl(BaseCodeInsightAction.java:14)
at com.intellij.codeInsight.completion.actions.CodeCompletionAction.actionPerformedImpl(CodeCompletionAction.java:8)
at com.intellij.codeInsight.actions.BaseCodeInsightAction.actionPerformed(BaseCodeInsightAction.java:37)
at com.intellij.openapi.keymap.impl.IdeKeyEventDispatcher.a(IdeKeyEventDispatcher.java:106)
at com.intellij.openapi.keymap.impl.IdeKeyEventDispatcher.b(IdeKeyEventDispatcher.java:50)
at com.intellij.openapi.keymap.impl.IdeKeyEventDispatcher.dispatchKeyEvent(IdeKeyEventDispatcher.java:52)
at com.intellij.ide.IdeEventQueue.a(IdeEventQueue.java:69)
at com.intellij.ide.IdeEventQueue.dispatchEvent(IdeEventQueue.java:113)
at java.awt.EventDispatchThread.pumpOneEventForHierarchy(EventDispatchThread.java:242)
at java.awt.EventDispatchThread.pumpEventsForHierarchy(EventDispatchThread.java:163)
at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:157)
at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:149)
at java.awt.EventDispatchThread.run(EventDispatchThread.
Some reference provider (probably, plugins) return 'null' as reference
array.
Yann Cebron wrote:
--
Best regards,
Maxim Mossienko
IntelliJ Labs / JetBrains Inc.
http://www.intellij.com
"Develop with pleasure!"
You should check for null and print logger error saying that.
Maxim Mossienko (JetBrains) wrote:
>> #4109:
>> No message
>> java.lang.NullPointerException
>> at
>> com.intellij.psi.impl.source.resolve.ResolveUtil.getReferencesFromProviders(ResolveUtil.java:70)
>>
>> at
>> com.intellij.psi.impl.source.xml.XmlAttributeValueImpl.getReferences(XmlAttributeValueImpl.java:5)
>>
>> at
>> com.intellij.psi.impl.SharedPsiElementImplUtil.a(SharedPsiElementImplUtil.java:47)
>>
>> at
>> com.intellij.psi.impl.SharedPsiElementImplUtil.findReferenceAt(SharedPsiElementImplUtil.java:42)
>>
>> at
>> com.intellij.psi.impl.source.TreeWrapperPsiElement.findReferenceAt(TreeWrapperPsiElement.java:36)
>>
>> at
>> com.intellij.psi.impl.source.jsp.JspxFileImpl.findReferenceAt(JspxFileImpl.java:58)
>>
>> at
>> com.intellij.codeInsight.completion.CompletionContext.init(CompletionContext.java:68)
>>
>> at
>> com.intellij.codeInsight.completion.CompletionContext.(CompletionContext.java:55) >> >> at >> com.intellij.codeInsight.completion.CodeCompletionHandlerBase.invoke(CodeCompletionHandlerBase.java:29) >> >> at >> com.intellij.codeInsight.actions.BaseCodeInsightAction$1$1.run(BaseCodeInsightAction.java:2) >> >> at >> com.intellij.openapi.application.impl.ApplicationImpl.runWriteAction(ApplicationImpl.java:410) >> >> at >> com.intellij.codeInsight.actions.BaseCodeInsightAction$1.run(BaseCodeInsightAction.java:6) >> >> at >> com.intellij.openapi.command.impl.CommandProcessorImpl.executeCommand(CommandProcessorImpl.java:114) >> >> at >> com.intellij.openapi.command.impl.CommandProcessorImpl.executeCommand(CommandProcessorImpl.java:34) >> >> at >> com.intellij.codeInsight.actions.BaseCodeInsightAction.actionPerformedImpl(BaseCodeInsightAction.java:14) >> >> at >> com.intellij.codeInsight.completion.actions.CodeCompletionAction.actionPerformedImpl(CodeCompletionAction.java:8) >> >> at >> com.intellij.codeInsight.actions.BaseCodeInsightAction.actionPerformed(BaseCodeInsightAction.java:37) >> >> at >> com.intellij.openapi.keymap.impl.IdeKeyEventDispatcher.a(IdeKeyEventDispatcher.java:106) >> >> at >> com.intellij.openapi.keymap.impl.IdeKeyEventDispatcher.b(IdeKeyEventDispatcher.java:50) >> >> at >> com.intellij.openapi.keymap.impl.IdeKeyEventDispatcher.dispatchKeyEvent(IdeKeyEventDispatcher.java:52) >> >> at com.intellij.ide.IdeEventQueue.a(IdeEventQueue.java:69) >> at >> com.intellij.ide.IdeEventQueue.dispatchEvent(IdeEventQueue.java:113) >> at >> java.awt.EventDispatchThread.pumpOneEventForHierarchy(EventDispatchThread.java:242) >> >> at >> java.awt.EventDispatchThread.pumpEventsForHierarchy(EventDispatchThread.java:163) >> >> at >> java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:157) >> at >> java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:149) >>]]> at java.awt.EventDispatchThread.run(EventDispatchThread.
Too much for non public API :)
Keith Lea wrote:
>> Some reference provider (probably, plugins) return 'null' as reference
>> array.
>>
>> Yann Cebron wrote:
>>
>>> #4109:
>>> No message
>>> java.lang.NullPointerException
>>> at
>>> com.intellij.psi.impl.source.resolve.ResolveUtil.getReferencesFromProviders(ResolveUtil.java:70)
>>>
>>> at
>>> com.intellij.psi.impl.source.xml.XmlAttributeValueImpl.getReferences(XmlAttributeValueImpl.java:5)
>>>
>>> at
>>> com.intellij.psi.impl.SharedPsiElementImplUtil.a(SharedPsiElementImplUtil.java:47)
>>>
>>> at
>>> com.intellij.psi.impl.SharedPsiElementImplUtil.findReferenceAt(SharedPsiElementImplUtil.java:42)
>>>
>>> at
>>> com.intellij.psi.impl.source.TreeWrapperPsiElement.findReferenceAt(TreeWrapperPsiElement.java:36)
>>>
>>> at
>>> com.intellij.psi.impl.source.jsp.JspxFileImpl.findReferenceAt(JspxFileImpl.java:58)
>>>
>>> at
>>> com.intellij.codeInsight.completion.CompletionContext.init(CompletionContext.java:68)
>>>
>>> at
>>> com.intellij.codeInsight.completion.CompletionContext.(CompletionContext.java:55) >>> >>> at >>> com.intellij.codeInsight.completion.CodeCompletionHandlerBase.invoke(CodeCompletionHandlerBase.java:29) >>> >>> at >>> com.intellij.codeInsight.actions.BaseCodeInsightAction$1$1.run(BaseCodeInsightAction.java:2) >>> >>> at >>> com.intellij.openapi.application.impl.ApplicationImpl.runWriteAction(ApplicationImpl.java:410) >>> >>> at >>> com.intellij.codeInsight.actions.BaseCodeInsightAction$1.run(BaseCodeInsightAction.java:6) >>> >>> at >>> com.intellij.openapi.command.impl.CommandProcessorImpl.executeCommand(CommandProcessorImpl.java:114) >>> >>> at >>> com.intellij.openapi.command.impl.CommandProcessorImpl.executeCommand(CommandProcessorImpl.java:34) >>> >>> at >>> com.intellij.codeInsight.actions.BaseCodeInsightAction.actionPerformedImpl(BaseCodeInsightAction.java:14) >>> >>> at >>> com.intellij.codeInsight.completion.actions.CodeCompletionAction.actionPerformedImpl(CodeCompletionAction.java:8) >>> >>> at >>> com.intellij.codeInsight.actions.BaseCodeInsightAction.actionPerformed(BaseCodeInsightAction.java:37) >>> >>> at >>> com.intellij.openapi.keymap.impl.IdeKeyEventDispatcher.a(IdeKeyEventDispatcher.java:106) >>> >>> at >>> com.intellij.openapi.keymap.impl.IdeKeyEventDispatcher.b(IdeKeyEventDispatcher.java:50) >>> >>> at >>> com.intellij.openapi.keymap.impl.IdeKeyEventDispatcher.dispatchKeyEvent(IdeKeyEventDispatcher.java:52) >>> >>> at com.intellij.ide.IdeEventQueue.a(IdeEventQueue.java:69) >>> at >>> com.intellij.ide.IdeEventQueue.dispatchEvent(IdeEventQueue.java:113) >>> at >>> java.awt.EventDispatchThread.pumpOneEventForHierarchy(EventDispatchThread.java:242) >>> >>> at >>> java.awt.EventDispatchThread.pumpEventsForHierarchy(EventDispatchThread.java:163) >>> >>> at >>> java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:157) >>> at >>> java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:149) >>> at java.awt.EventDispatchThread.run(EventDispatchThread. >> >> >> >>]]>
--
Best regards,
Maxim Mossienko
IntelliJ Labs / JetBrains Inc.
http://www.intellij.com
"Develop with pleasure!"
Let's make a deal, release IDEA source to customers, I'll add it myself. :)
Maxim Mossienko (JetBrains) wrote:
>> You should check for null and print logger error saying that.
>>
>> Maxim Mossienko (JetBrains) wrote:
>>
>>> Some reference provider (probably, plugins) return 'null' as
>>> reference array.
>>>
>>> Yann Cebron wrote:
>>>
>>>> #4109:
>>>> No message
>>>> java.lang.NullPointerException
>>>> at
>>>> com.intellij.psi.impl.source.resolve.ResolveUtil.getReferencesFromProviders(ResolveUtil.java:70)
>>>>
>>>> at
>>>> com.intellij.psi.impl.source.xml.XmlAttributeValueImpl.getReferences(XmlAttributeValueImpl.java:5)
>>>>
>>>> at
>>>> com.intellij.psi.impl.SharedPsiElementImplUtil.a(SharedPsiElementImplUtil.java:47)
>>>>
>>>> at
>>>> com.intellij.psi.impl.SharedPsiElementImplUtil.findReferenceAt(SharedPsiElementImplUtil.java:42)
>>>>
>>>> at
>>>> com.intellij.psi.impl.source.TreeWrapperPsiElement.findReferenceAt(TreeWrapperPsiElement.java:36)
>>>>
>>>> at
>>>> com.intellij.psi.impl.source.jsp.JspxFileImpl.findReferenceAt(JspxFileImpl.java:58)
>>>>
>>>> at
>>>> com.intellij.codeInsight.completion.CompletionContext.init(CompletionContext.java:68)
>>>>
>>>> at
>>>> com.intellij.codeInsight.completion.CompletionContext.(CompletionContext.java:55) >>>> >>>> at >>>> com.intellij.codeInsight.completion.CodeCompletionHandlerBase.invoke(CodeCompletionHandlerBase.java:29) >>>> >>>> at >>>> com.intellij.codeInsight.actions.BaseCodeInsightAction$1$1.run(BaseCodeInsightAction.java:2) >>>> >>>> at >>>> com.intellij.openapi.application.impl.ApplicationImpl.runWriteAction(ApplicationImpl.java:410) >>>> >>>> at >>>> com.intellij.codeInsight.actions.BaseCodeInsightAction$1.run(BaseCodeInsightAction.java:6) >>>> >>>> at >>>> com.intellij.openapi.command.impl.CommandProcessorImpl.executeCommand(CommandProcessorImpl.java:114) >>>> >>>> at >>>> com.intellij.openapi.command.impl.CommandProcessorImpl.executeCommand(CommandProcessorImpl.java:34) >>>> >>>> at >>>> com.intellij.codeInsight.actions.BaseCodeInsightAction.actionPerformedImpl(BaseCodeInsightAction.java:14) >>>> >>>> at >>>> com.intellij.codeInsight.completion.actions.CodeCompletionAction.actionPerformedImpl(CodeCompletionAction.java:8) >>>> >>>> at >>>> com.intellij.codeInsight.actions.BaseCodeInsightAction.actionPerformed(BaseCodeInsightAction.java:37) >>>> >>>> at >>>> com.intellij.openapi.keymap.impl.IdeKeyEventDispatcher.a(IdeKeyEventDispatcher.java:106) >>>> >>>> at >>>> com.intellij.openapi.keymap.impl.IdeKeyEventDispatcher.b(IdeKeyEventDispatcher.java:50) >>>> >>>> at >>>> com.intellij.openapi.keymap.impl.IdeKeyEventDispatcher.dispatchKeyEvent(IdeKeyEventDispatcher.java:52) >>>> >>>> at com.intellij.ide.IdeEventQueue.a(IdeEventQueue.java:69) >>>> at >>>> com.intellij.ide.IdeEventQueue.dispatchEvent(IdeEventQueue.java:113) >>>> at >>>> java.awt.EventDispatchThread.pumpOneEventForHierarchy(EventDispatchThread.java:242) >>>> >>>> at >>>> java.awt.EventDispatchThread.pumpEventsForHierarchy(EventDispatchThread.java:163) >>>> >>>> at >>>> java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:157) >>>> at >>>> java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:149) >>>> at java.awt.EventDispatchThread.run(EventDispatchThread. >>> >>> >>> >>> >>>]]>
:)))
Marked methods as @NotNull
Keith Lea wrote:
>> Too much for non public API :)
>>
>> Keith Lea wrote:
>>
>>> You should check for null and print logger error saying that.
>>>
>>> Maxim Mossienko (JetBrains) wrote:
>>>
>>>> Some reference provider (probably, plugins) return 'null' as
>>>> reference array.
>>>>
>>>> Yann Cebron wrote:
>>>>
>>>>> #4109:
>>>>> No message
>>>>> java.lang.NullPointerException
>>>>> at
>>>>> com.intellij.psi.impl.source.resolve.ResolveUtil.getReferencesFromProviders(ResolveUtil.java:70)
>>>>>
>>>>> at
>>>>> com.intellij.psi.impl.source.xml.XmlAttributeValueImpl.getReferences(XmlAttributeValueImpl.java:5)
>>>>>
>>>>> at
>>>>> com.intellij.psi.impl.SharedPsiElementImplUtil.a(SharedPsiElementImplUtil.java:47)
>>>>>
>>>>> at
>>>>> com.intellij.psi.impl.SharedPsiElementImplUtil.findReferenceAt(SharedPsiElementImplUtil.java:42)
>>>>>
>>>>> at
>>>>> com.intellij.psi.impl.source.TreeWrapperPsiElement.findReferenceAt(TreeWrapperPsiElement.java:36)
>>>>>
>>>>> at
>>>>> com.intellij.psi.impl.source.jsp.JspxFileImpl.findReferenceAt(JspxFileImpl.java:58)
>>>>>
>>>>> at
>>>>> com.intellij.codeInsight.completion.CompletionContext.init(CompletionContext.java:68)
>>>>>
>>>>> at
>>>>> com.intellij.codeInsight.completion.CompletionContext.(CompletionContext.java:55) >>>>> >>>>> at >>>>> com.intellij.codeInsight.completion.CodeCompletionHandlerBase.invoke(CodeCompletionHandlerBase.java:29) >>>>> >>>>> at >>>>> com.intellij.codeInsight.actions.BaseCodeInsightAction$1$1.run(BaseCodeInsightAction.java:2) >>>>> >>>>> at >>>>> com.intellij.openapi.application.impl.ApplicationImpl.runWriteAction(ApplicationImpl.java:410) >>>>> >>>>> at >>>>> com.intellij.codeInsight.actions.BaseCodeInsightAction$1.run(BaseCodeInsightAction.java:6) >>>>> >>>>> at >>>>> com.intellij.openapi.command.impl.CommandProcessorImpl.executeCommand(CommandProcessorImpl.java:114) >>>>> >>>>> at >>>>> com.intellij.openapi.command.impl.CommandProcessorImpl.executeCommand(CommandProcessorImpl.java:34) >>>>> >>>>> at >>>>> com.intellij.codeInsight.actions.BaseCodeInsightAction.actionPerformedImpl(BaseCodeInsightAction.java:14) >>>>> >>>>> at >>>>> com.intellij.codeInsight.completion.actions.CodeCompletionAction.actionPerformedImpl(CodeCompletionAction.java:8) >>>>> >>>>> at >>>>> com.intellij.codeInsight.actions.BaseCodeInsightAction.actionPerformed(BaseCodeInsightAction.java:37) >>>>> >>>>> at >>>>> com.intellij.openapi.keymap.impl.IdeKeyEventDispatcher.a(IdeKeyEventDispatcher.java:106) >>>>> >>>>> at >>>>> com.intellij.openapi.keymap.impl.IdeKeyEventDispatcher.b(IdeKeyEventDispatcher.java:50) >>>>> >>>>> at >>>>> com.intellij.openapi.keymap.impl.IdeKeyEventDispatcher.dispatchKeyEvent(IdeKeyEventDispatcher.java:52) >>>>> >>>>> at com.intellij.ide.IdeEventQueue.a(IdeEventQueue.java:69) >>>>> at >>>>> com.intellij.ide.IdeEventQueue.dispatchEvent(IdeEventQueue.java:113) >>>>> at >>>>> java.awt.EventDispatchThread.pumpOneEventForHierarchy(EventDispatchThread.java:242) >>>>> >>>>> at >>>>> java.awt.EventDispatchThread.pumpEventsForHierarchy(EventDispatchThread.java:163) >>>>> >>>>> at >>>>> java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:157) >>>>> at >>>>> java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:149) >>>>> at java.awt.EventDispatchThread.run(EventDispatchThread. >>>> >>>> >>>> >>>> >>>> >>>> >> >>]]>
--
Best regards,
Maxim Mossienko
IntelliJ Labs / JetBrains Inc.
http://www.intellij.com
"Develop with pleasure!"
not "some" provider, but com.intellij.psi.css.impl.util.CssReferenceProvider ;)
I checked twice it doesn't.
Another reason for the exception is association of null reference
provider in registry.
Yann Cebron wrote:
--
Best regards,
Maxim Mossienko
IntelliJ Labs / JetBrains Inc.
http://www.intellij.com
"Develop with pleasure!"
indeed
returns null which is probably not the way it should be ;)
now how do I get it to resolve? no variants either.. (it works in plain HTML on the JSP page though)
It is by the simple reason: the provider is not initialized yet (btw, it
provides css references in some struts attributes ("styleClass",
"errorStyleClass", "styleId", "errorStyleId")). You can override if you
wish :)
Yann Cebron wrote:
--
Best regards,
Maxim Mossienko
IntelliJ Labs / JetBrains Inc.
http://www.intellij.com
"Develop with pleasure!"
+btw, it
provides css references in some struts attributes ("styleClass",
"errorStyleClass", "styleId", "errorStyleId")+
indeed, this must be new in 5.1 ;)