IntelliJ社区版JSP语法突出显示 [英] IntelliJ community edition JSP Syntax highlighting

查看:263
本文介绍了IntelliJ社区版JSP语法突出显示的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我刚刚下载了IntelliJ 15.0.1 Community Edition,因为我已经厌倦了Eclipse,而且在我的笔记本电脑(Ubuntu 14.04 LTS)上它看上去也很恐怖.一切都进行得很顺利,直到我看到JSP文件中的语法高亮不起作用为止.

I just downloaded IntelliJ 15.0.1 Community Edition because i'm sick of Eclipse and it looks horrible on my laptop (Ubuntu 14.04 LTS). Everything was going pretty well until I saw that syntax highlighting in JSP files was not working.

我转到设置/编辑器/文件类型

I went to Settings/Editor/File Types

在识别的文件类型"中,还有其他选项:

In the Recognized File Types,among other options, I have this one:

JSP文件(仅语法突出显示)

JSP Files (syntax Highlighting Only)

当我选择它时,我可以在注册的模式中看到:* .jsp,*.tag正是我想要的...但是它不起作用...任何想法?

When I select it I can see in the registered patterns: *.jsp, *.tag which is exactly what I want ... but it doesn't work ...any ideas?

谢谢

推荐答案

即使在Community Edition中,IntelliJ IDEA仍可以在设置>文件类型"中手动添加语法突出显示设置,但在重新启动后它会忽略这些设置.

IntelliJ IDEA allows to manually add syntax highlighting settings in "Settings > File Types" even in the Community Edition BUT it ignores these settings after a restart.

这些设置存储在用户的主目录中,例如, 〜/.IdeaIC2016.1/config/filetypes/*.xml.不幸的是,在IDE重新启动后,这些设置不会被读取,因此配置任何设置似乎都没用:-(

These settings are stored in the user's home directory at e.g. ~/.IdeaIC2016.1/config/filetypes/*.xml. Unfortunately, after a restart of the IDE, these settings are NOT read, therefore it seems useless to configure any settings :-(

<filetype binary="false" description="JSP files (syntax highlighting only)" name="JSP">
  <highlighting>
    <options>
      <option name="LINE_COMMENT" value="" />
      <option name="COMMENT_START" value="&lt;%--" />
      <option name="COMMENT_END" value="--%&gt;" />
      <option name="HEX_PREFIX" value="#" />
      <option name="NUM_POSTFIXES" value="" />
      <option name="HAS_BRACES" value="true" />
      <option name="HAS_BRACKETS" value="true" />
      <option name="HAS_PARENS" value="true" />
      <option name="HAS_STRING_ESCAPES" value="true" />
    </options>
    <keywords keywords="%&gt;;&lt;%!;&lt;%@;include;page;taglib" ignore_case="false" />
    <keywords2 keywords="c:choose;c:if;c:otherwise;c:set;c:url;c:when;fmt:message;fmt:setBundle;fmt:setLocale;s:eval;s:message;sec:authorize" />
    <keywords3 keywords="html;head;title;meta;header;nav;section;footer;body;a;br;hr;div;form;input;button;submit;textarea;p;script;noscript;span;style;table;td;th;tr;ol;ul;li;label;i;h1;h2;h3;h4;h5;img" />
    <keywords4 keywords="if;else;function;for;do;let;this;while;with;thows;true;false;char;case;continue;alert;confirm;console;length;return;var;boolean;forms;" />
  </highlighting>
</filetype>

(〜/.IdeaIC2016.1/config/filetypes/JSP.xml)

(~/.IdeaIC2016.1/config/filetypes/JSP.xml )

IntelliJ社区版还忽略了CSS文件的任何文件类型设置,如下所示:

IntelliJ Community Edition also ignores any file-type settings for CSS-files that could look like this:

<filetype binary="false" description="CSS files (syntax highlighting only)" name="CSS">
  <highlighting>
    <options>
      <option name="LINE_COMMENT" value="" />
      <option name="COMMENT_START" value="/*" />
      <option name="COMMENT_END" value="*/" />
      <option name="HEX_PREFIX" value="#" />
      <option name="NUM_POSTFIXES" value="" />
      <option name="HAS_BRACES" value="true" />
    </options>
    <keywords keywords="a;body;button;div;font;font-face;form;frame;h1;h2;h3;h4;iframe;img;import;input;li;link;media;nav;ol;option;p;select;span;table;td;th;title;tr;u;ul;video" ignore_case="false" />
    <keywords2 keywords="  box-shadow;background;background-color;border;border-radius;bottom;box-shadow;color;content;cursor;display;float;font-family;font-size;font-weight;height;left;line-height;list-style-type;margin;margin-bottom;margin-left;margin-right;margin-top;outline;overflow;padding;padding-bottom;padding-left;padding-right;padding-top;position;right;text-align;text-decoration;text-transform;top;vertical-align;white-space;width;z-index;zoom" />
    <keywords3 keywords="em;pt;px;rgb;rgba" />
    <keywords4 keywords="!important;active;after;before;hover;none;visited" />
  </highlighting>
</filetype>

(〜/.IdeaIC2016.1/config/filetypes/CSS.xml)

(~/.IdeaIC2016.1/config/filetypes/CSS.xml)

这篇关于IntelliJ社区版JSP语法突出显示的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆