Getting nodes in ProjectView marked as red when there is problem in file for custom language
Hi,
We have a custom file type where we have provided a TreeStructureProvider to get our custom files to show differently in the project view.
When you have a syntax error in Java-files, you get a red marking in the class (in project view) and in the parent packages. When we have syntax error in our custom language files though, we do not get this marking. I have tried overriding hasProblemFileBeneath() in our tree node (inheriting from BasePsiNode), but it does not work.
Any pointers?
/Marcus
Please sign in to leave a comment.
Hello Marcus,
You need to implement a ) and return true for files of your language.
--
Dmitry Jemerov
Development Lead
JetBrains, Inc.
http://www.jetbrains.com/
"Develop with Pleasure!"
Am I missing something, or is the display wrong? Here's what your reply looks like on my machine (Firefox 3.5 on Linux). What does he need to implement??? a ) ?

Hello WarnerJan,
Sorry, the forum ate my XML. The extension is called problemFileHighlightFilter
and it needs to implement the Condition of VirtualFile.
--
Dmitry Jemerov
Development Lead
JetBrains, Inc.
http://www.jetbrains.com/
"Develop with Pleasure!"
I tried this, but cannot get the callback to work. I see that the groovy plugin does exactly this in the community version of IDEA, but not in Version 8.
Is this a version 9 only feature? Any version 8 workarounds?
/Marcus
Hello Marcus,
In IDEA 8, you can use the explicit registration API instead of an extension
point: WolfTheProblemSolver.getInstance().registerFileHighlightFilter()
--
Dmitry Jemerov
Development Lead
JetBrains, Inc.
http://www.jetbrains.com/
"Develop with Pleasure!"
That worked, thanks!
I had to do the following to get red marking in my ProjectViewNode that I am using to represent the file:
public TextAttributesKey getTextAttributesKey()
{
WolfTheProblemSolver theProblemSolver = WolfTheProblemSolver.getInstance(element.getProject());
if (theProblemSolver.isProblemFile(element.getContainingFile().getVirtualFile()))
{
return CodeInsightColors.ERRORS_ATTRIBUTES;
}
return null;
}
This is a method of the ItemPresentation used for the ProjectViewNode. It works, but it there a more implicit way to say that my ProjectViewNode should be marked on error?