Example of HTML inspection?

Is there an example of a HTML inspection available somewhere? I would like to create one but I don't know where to start.

S.

7 comments

Hello Stefan,

SA> Is there an example of a HTML inspection available somewhere? I
SA> would like to create one but I don't know where to start.

I don't think we have any examples right now, but the general framework is
the same for all kinds of inspections. You implement a class derived from
LocalInspectionTool and override the buildVisitor() method. In the visitor,
you override XML-specific methods (like visitXmlTag, visitXmlAttribute).
To check that the elements passed to the inspection are contained indeed
in an HTML file and not in some other XML, you can check the file type of
the containing file.

--
Dmitry Jemerov
Software Developer
http://www.jetbrains.com/
"Develop with Pleasure!"


0

Thanks Dmitry! I'll just start hacking and post back here when I get stuck.

S.

0

buildVisitor() is not present in the 5.x api
any way i can live without it, as i use checkFile instead
My question is what is the function of crateOptionsPanel() ,what trigger it,when it is get called?and what should i put in this panel?
please give an example from idea
thanks

0

Hello joe,

j> buildVisitor() is not present in the 5.x api
j>
j> any way i can live without it, as i use checkFile instead

Yes, in 5.x you can use checkFile().

j> My question is what is the function of crateOptionsPanel() ,what
j> trigger it,when it is get called?and what should i put in this panel?
j>
j> please give an example from idea

This options panel is shown in the Errors configuration dialog. For example,
the option panel for the "Class naming convention" inspection allows you
to specify the regex with which the class name should match.

If your inspection has some options, put them there, if it doesn't, return
null.

--
Dmitry Jemerov
Software Developer
http://www.jetbrains.com/
"Develop with Pleasure!"


0

actually what i mean is
is this showed in the setting dialog under the inspections tab or what
in other way , how did the user make this panel visible in order to set the options
thanks
joe

0

Hello joe,

j> actually what i mean is
j> is this showed in the setting dialog under the inspections tab or what
j> in other way , how did the user make this panel visible in order to
j> set the options

Settings | Errors

--
Dmitry Jemerov
Software Developer
http://www.jetbrains.com/
"Develop with Pleasure!"


0

Please sign in to leave a comment.