Show errors in project view

Hi, I'm developing a plugin to support a custom language. In Java if a file has an error the file is also underlined red in the project view, I'm trying to do a similar thing with this langauge. I can detect errors, but how would I go about highlighting files in the project view?

Thanks.

8 comments
Comment actions Permalink

You need to provide an extension for the problemFileHighlightFilter extension point. See PyProblemFileHighlightFilter in the Community Edition source code for a simple example.

0
Comment actions Permalink

That worked, thanks. All I had to do is filter to my specific file type, IntelliJ suprisingly handled checking for errors and highlighting the file in the project view all automatically.

0
Comment actions Permalink

Hi,

I'm following the tutorial to create a DSL plugin in IntelliJ Community IDEA.

Actually, I have the same question as mentioned in the topic but I can not well understand Dmitry's instruction and Zarwan's confirmation . I've also studied the PyProblemFileHighlightFilter.java in the C.E. source code but still not know how to use it (extension?) to my project.

Can you please give me an example showing how to "filter to my specific file type" ?

Thanks a lot,

 

0
Comment actions Permalink

In my plugin, annotator highlighted errors show up in the project view as file errors while inspection highlighted errors do not.

Is there something in the inspection error problem descriptor that should be set to make the error propagate to the project view?

0
Comment actions Permalink

No. The project view highlights only files with errors produced by GeneralHighlightingPass (it runs annotators but not inspections).

0
Comment actions Permalink

Thanks, Am I right to guess that both annotator highlights and inspections are needed to give the user ability to search for a specific problems and have the files highlighted?

But then how to make inspection only run at user request since annotator will do the job on open files?

 

0
Comment actions Permalink

The user can run the "Annotator" inspection manually using Analyze | Run Inspection by Name... and use the results view to search for specific problems.

0
Comment actions Permalink

Thanks Dmitry. I was under the mistaken impression that inspections give user more flexibility since they can be turned off and can change severity.

On the other hand I can achieve the same thing by providing configuration for annotations and having the errors propagate to the project view is an advantage.

What are the thumb rules for deciding between inspection and annotation? Like: If it is an error then annotation, if it is passable then an inspection?

 

0

Please sign in to leave a comment.