Java Reference
In-Depth Information
on a Java file. All the standard error stripe features and navigation are supported.
Fo r
HTML
and
XHTML
files, you can use the
Tools | Validate
action (also available
by right-clicking inside the document) to validate the file for proper
XML
syntax.
Here are some of the types of problems
IDEA
spots:
Missing or invalid closing tags and braces
■
References to invalid or missing directories, files, or local anchors by
src
and
href
attributes
■
Duplicate attributes
■
Invalid
CSS
selector format and tag references
■
Missing required attributes or parameters
■
Invalid
HTML
attributes and
CSS
properties
■
Illegal attribute and property values
■
Unused
CSS
class definitions
■
Many of these problems can be corrected for you automatically through
IDEA
's
intention system, just as they are for other file types. Click the lightbulb icon or
press
Alt+Enter
to accept the suggested fix. For example, if you assign an
HTML
tag a style class that hasn't been defined,
IDEA
ask if you would like to add an
appropriate
CSS
selector. You can selectively enable and disable intention actions
in the
Intentions
settings panel.
A new feature of 5.0 is the ability to convert an
HTML
document into a valid and
well-formed
XHTML
document. This makes it easy to move from the older
HTML
standard to a more rigid
XML
-based system.
Support for comments
All the appropriate comment designators are supported in the new file types,
including C-style block comments, double slash line comments, and
HTML
style
comment tags. You can use the
Code | Comment with Line Comment
(
Ctrl+/
)
and
Code | Comment with Block Comment
(
Ctrl+Shift+/
) actions to comment
out the current selection. If the current selection is already commented, the
command reverses the process, removing the comments. As it is in Java and
JSP
files, comments have their own code style and coloring.