[英]IntelliJ community edition JSP Syntax highlighting
我剛剛下載了IntelliJ 15.0.1社區版,因為我厭倦了Eclipse,它在我的筆記本電腦上看起來很糟糕(Ubuntu 14.04 LTS)。 在我看到JSP文件中的語法突出顯示無效之前,一切都進展順利。
我去了設置/編輯/文件類型
在識別文件類型中,除了其他選項之外,我還有以下選項:
JSP文件(僅限語法高亮顯示)
當我選擇它時,我可以在注冊的模式中看到:* .jsp,* .tag這正是我想要的......但它不起作用......任何想法?
謝謝
IntelliJ IDEA允許在“設置>文件類型”中手動添加語法突出顯示設置,即使在Community Edition中也是如此, 但重啟后它會忽略這些設置 。
這些設置存儲在用戶的主目錄中,例如〜/ .IdeaIC2016.1 / config / filetypes / * .xml。 不幸的是,重新啟動IDE后,這些設置無法讀取,因此配置任何設置似乎都無用:-(
<filetype binary="false" description="JSP files (syntax highlighting only)" name="JSP">
<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" />
<option name="HAS_BRACKETS" value="true" />
<option name="HAS_PARENS" value="true" />
<option name="HAS_STRING_ESCAPES" value="true" />
</options>
<keywords keywords="%>;<%!;<%@;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)
IntelliJ Community Edition也忽略了CSS文件的任何文件類型設置,如下所示:
<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 /配置/文件類型/ CSS.xml)
您必須創建自己的JSP文件類型,例如“我的JSP”。 注冊的文件模式必須是:
*。J.P
* .J?PF
(* .jsp保留)
在默認文件類型:“JSP文件(僅限語法突出顯示)”中,您必須刪除文件模式* .jsp。 將其設置為例如*.jjj
。
然后IntelliJ Idea保存此文件類型,重啟后設置仍然可用。
聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.