【问题标题】:How can I create a custom Eclipse Syntax Highlighter如何创建自定义 Eclipse 语法荧光笔
【发布时间】:2010-10-19 06:19:26
【问题描述】:

我一直在为一种新语言开发编译器。我认为能够在语法感知环境中展示它的开发会很好。该语言有不少自定义关键字,其结构与Java或C/C++等常见语言有很大不同。

如何为 Eclipse 开发自定义语法高亮?我看过一些对一些插件的引用,但文档对于我初学者的需求来说不够全面。

我有我的语言的语法/RE,以及相关关键字的列表。

【问题讨论】:

    标签: eclipse eclipse-plugin syntax-highlighting


    【解决方案1】:

    听起来您正在处理 DSL(领域特定语言)。您正在寻找的内容与XText 完全一样。以下是该页面的摘录:

    Xtext 是用于开发外部文本 DSL 的框架/工具。只需使用 Xtext 的简单 EBNF 语法语言描述您自己的 DSL,生成器就会创建一个解析器、一个 AST 元模型(在 EMF 中实现)以及一个功能齐全的 Eclipse 文本编辑器。

    另外,请查看this video,这是对其中一位幕后人员的采访。我相信你会从这里拿走它:-)

    您可能还想查看this plugin。不完全是您想要的,但可能是一个不错的开始。

    【讨论】:

    • Blip 上不再提供该视频。
    • 我能否将 XText 与 CDT Parser 结合使用,以便 CDT Parser 突出显示纯 C++ 代码,而 XText 突出显示我的 DSL 部分?
    【解决方案2】:

    Eclipse 框架使用一个相当复杂的文档模型来进行语法着色(他们称之为着色,而不是高亮),它并不像在其他编辑器中那样简单。

    如果你真的想试试看,可以阅读the following from the Eclipse plug-in developer guide

    (以上链接现已失效。This may be a similar documentthis。)

    【讨论】:

    • 看起来很复杂,但会生产出高质量的产品。在我继续开发我的语言时,我会牢记这个工具。谢谢!
    • 该链接已损坏。这是同一件事吗? help.eclipse.org/indigo/…
    • 链接已恢复? =v 但较新的有所不同,但仍然是很好的参考,谢谢!
    【解决方案3】:

    这正是 LiClipse (http://www.liclipse.com/) 的目标之一:轻松地做一个针对 Eclipse 的具有语法高亮、基本代码完成、大纲等的编辑器——请注意,它的核心(允许创建自定义语言)变成了近期开源:http://liclipse.blogspot.com.br/2016/05/liclipse-303-providing-back-to-open.html.

    添加新语言不需要任何 Java 技能(主要是在适当的位置创建一个新的 .liclipse ——它是一个 YAML 文件——并创建一些基本规则来说明如何划分你的语言——即:通常只是将代码与 cmets 与字符串分开 -- 并指定分区中的关键字已经为您提供了正确的语法突出显示)。

    如果您下载它,plugins\com.brainwy.liclipse.editor\languages 中有许多示例,http://www.liclipse.com/text/supported_languages.htmlhttp://www.liclipse.com/text/scope_definition.html 有一些基本文档说明如何操作。

    【讨论】:

    • 我确实觉得这个想法不错,但请记住,LiClipse 并不是真正免费的In short terms, the license alows anyone to evaluate LiClipse for 30 days, but it must be bought for continued use.
    • @Anton:独立的 LiClipse 应用程序不是免费的,而是 LiClipseText Eclipse 插件apparently is。它可以从http://www.liclipse.com/text/updates 的 LiClipse 更新站点安装。
    • @Lii 是的,从 LiClipse 处理的核心语言作为 LiClipseText 开源(参见:liclipse.blogspot.com.br/2016/05/…
    【解决方案4】:

    我刚刚试用了 Eclipse Colorer,它真的很棒(例如,用于突出显示、处理 VBA 文件(当然是在受限上下文中)否则不受支持)。

    它支持例如

    • 折叠(如您所见)
    • 支持括号匹配(打开/关闭)
    • 200 多个文件扩展名(见下文)

    更多screenshots on their site

    这里是支持的扩展的完整列表:

    (很难获得这些信息,因为它们没有被索引或发布在网络的某个地方,但现在应该也可以被 Google 和 co 找到。
    我使用此正则表达式 ^\s+<(?!(!--|prototype|filename)).+>$ 删除了所有行,以压缩完整和 copy of eclipse\plugins\net.sf.colorer_0.9.9\colorer\hrc\proto.hrc 文件的内容。
    随时更新更新)

      <!--  main languages  -->
      <prototype name="c" group="main" description="C">
    
        <filename>/\.c$/i</filename>
    
      <prototype name="cpp" group="main" description="C++">
    
        <filename>/\.(cpp|cxx|cc|hpp|h)$/i</filename>
    
      <prototype name="d" group="main" description="D">
    
        <filename>/\.(d|di)$/i</filename>
    
    
      <prototype name="asm" group="main" description="ASM">
    
        <filename>/\.(mac|asm|inc|i32|cod)$/i</filename>
    
      <prototype name="perl" group="main" description="Perl">
    
        <filename>/\.(pl[sx]?|pm|pod|t)$/i</filename>
    
      <prototype name="java" group="main" description="Java">
    
        <filename>/\.(java|jav|jad)$/i</filename>
    
      <prototype name="idl" group="main" description="IDL">
    
        <filename>/\.(hvs|(i|o)dl)$/i</filename>
    
      <prototype name="pascal" group="main" description="Pascal">
    
        <filename>/\.(\~?pas|dpr|dpk|inc|int|pp)$/i</filename>
    
      <prototype name="csharp" group="main" description="C#">
    
        <filename>/\.cs$/i</filename>
    
      <prototype name="jsnet" group="main" description="JS.NET">
    
        <filename weight="0.5">/\.js$/i</filename>
    
      <prototype name="vbnet" group="main" description="VB.NET">
    
        <filename>/\.vb$/i</filename>
    
      <!-- warning!! extensions conflict with Fortran -->
      <prototype name="forth" group="main" description="Forth">
    
        <filename>/\.(fth|f32|f|spf)$/i</filename>
    
      <prototype name="fortran" group="main" description="Fortran">
    
        <filename>/\.(for|f(90)?)$/i</filename>
    
      <prototype name="vbasic" group="main" description="Visual Basic">
    
        <filename>/\.(bas|vbp|frm|cls)$/i</filename>
    
      <prototype name="python" group="main" description="Python">
    
        <filename>/\.(py|pyw|pys)$/i</filename>
    
      <prototype name="lua" group="main" description="Lua">
    
        <filename>/\.(lua)$/i</filename>
      </prototype>  
      <prototype name="ruby" group="main" description="Ruby">
    
        <filename>/\.(rb|rbw|ruby|rake)$/i</filename>
        <filename>/Rakefile$/i</filename>
    
      <prototype name="scala" group="main" description="Scala">
    
        <filename>/\.(scala)$/i</filename>
    
      <prototype name="tcltk" group="main" description="Tcl/Tk/Expect">
    
        <filename>/\.(tcl|tk|exp)$/i</filename>
    
    
      <!--  inet languages  -->
    
      <prototype name="html" group="inet" description="html">
    
        <filename>/\.[^ptr]??html?$/i</filename>
    
    
      <prototype name="css" group="inet" description="css">
    
        <filename>/\.(css)$/i</filename>
    
      <prototype name="html-css" group="inet" description="css for html">
    
        <filename weight="0">/\.(css)$/i</filename>
    
      <prototype name="svg-css" group="inet" description="css for svg">
    
        <filename weight="0">/\.(css)$/i</filename>
    
      <prototype name="sass" group="inet" description="SASS">
    
        <filename>/\.(sass)$/i</filename>
    
    
      <prototype name="haml" group="inet" description="HAML">
    
        <filename>/\.(haml)$/i</filename>
    
      <prototype name="erb" group="inet" description="ERB">
    
        <filename weight='4'>/\.(erb|rhtml|html\.erb)$/i</filename>
    
    
      <prototype name="jsp" group="inet" description="jsp">
    
        <filename>/\.(jspf?|tag)$/i</filename>
    
    
      <prototype name="php" group="inet" description="php">
    
        <filename>/\.(php\d?|phtml|thtml|inc)$/i</filename>
    
    
      <prototype name="xhtml-trans" group="inet" description="xhtml transitional" targetNamespace="http://www.w3.org/1999/xhtml">
    
        <filename>/\.html?/ix</filename>
        <filename>/\.xhtml?/ix</filename>
    
      <prototype name="xhtml-strict" group="inet" description="xhtml strict" targetNamespace="http://www.w3.org/1999/xhtml">
    
        <filename>/\.html?/ix</filename>
        <filename>/\.xhtml?/ix</filename>
    
      <prototype name="xhtml-frameset" group="inet" description="xhtml frameset" targetNamespace="http://www.w3.org/1999/xhtml">
    
        <filename>/\.html?/ix</filename>
        <filename>/\.xhtml?/ix</filename>
    
      <prototype name="asp.vb" group="inet" description="asp - VBScript">
    
        <filename>/\.(as(p|a)|ht(r|x|a)|inc)$/i</filename>
    
      <prototype name="asp.js" group="inet" description="asp - JavaScript">
    
        <filename>/\.(as(p|a)|ht(r|x|a)|inc)$/i</filename>
    
      <prototype name="asp.ps" group="inet" description="asp - PerlScript">
    
        <filename>/\.(as(p|a)|ht(r|x|a)|inc)$/i</filename>
    
      <prototype name="adp" group="inet" description="AOLserver Dynamic Pages">
    
        <filename>/\.(adp)$/i</filename>
    
      <prototype name="svg" group="inet" description="SVG 1.0" targetNamespace="http://www.w3.org/2000/svg">
    
        <filename>/\.svg/ix</filename>
    
      <prototype name="coldfusion" group="inet" description="ColdFusion">
    
        <filename>/\.(cfm|cfc)$/i</filename>
    
      <prototype name="jScript" group="inet" description="JavaScript">
    
        <filename>/\.(js|mocha)$/i</filename>
    
      <prototype name="actionscript" group="inet" description="ActionScript">
    
        <filename>/\.(as)$/i</filename>
    
      <prototype name="vbScript" group="inet" description="VBScript">
    
        <filename>/\.(vbs)$/i</filename>
    
    
      <prototype name="rss" group="inet" description="rss" targetNamespace="http://purl.org/rss/1.0/">
    
        <filename>/\.(rss)$/i</filename>
        <filename weight='1.5'>/^rss/i</filename>
    
      <prototype name="htc" group="inet" description="HTC">
    
        <filename weight='3'>/\.(htc)$/i</filename>
    
      <prototype name="xbl" group="inet" description="Mozilla XBL" targetNamespace="http://www.mozilla.org/xbl">
    
        <filename weight='0.5'>/\.(xml)/i</filename>
    
      <prototype name="wml" group="inet" description="wml" targetNamespace="http://www.wapforum.org/2001/wml">
    
        <filename>/\.wml$/i</filename>
    
    
    
      <!--  xml types  -->
      <prototype name="xml" group="xml" description="xml">
    
        <filename>/\.(xml|gi2|gpr|ui)$/i</filename>
        <filename>/\.(wxs|fb2)$/i</filename>
    
    
    
      <prototype name="dtd" group="xml" description="dtd">
    
        <filename>/\.(dtd|ent|mod)$/i</filename>
    
      <prototype name="dtdcatalog" group="xml" description="dtd/sgml catalog">
    
        <filename>/\.(cat|soc)$/i</filename>
    
    
      <prototype name="xslt" group="xml" description="xslt 1.0" targetNamespace="http://www.w3.org/1999/XSL/Transform">
    
        <filename>/\.(xslt?)$/i</filename>
    
    
      <prototype name="xslt2" group="xml" description="xslt 2.0" targetNamespace="http://www.w3.org/1999/XSL/Transform">
    
        <filename>/\.(xslt?2?)$/i</filename>
    
      <prototype name="xquery" group="xml" description="xquery 1.0">
    
        <filename>/\.(xq)$/i</filename>
    
      <prototype name="xslfo" group="xml" description="xslfo 1.0" targetNamespace="http://www.w3.org/1999/XSL/Transform">
    
        <filename>/\.(xslfo?|fo)$/i</filename>
    
    
      <prototype name="xmlschema" group="xml" description="XML Schema" targetNamespace="http://www.w3.org/2001/XMLSchema">
    
        <filename>/\.(xsd?)$/i</filename>
    
    
      <prototype name="relaxng" group="xml" description="Relax NG" targetNamespace="http://relaxng.org/ns/structure/1.0">
    
        <filename>/\.rng/ix</filename>
    
      <prototype name="schematron" group="xml" description="schematron" targetNamespace="http://www.ascc.net/xml/schematron">
    
        <filename>/\.sch$/ix</filename>
    
      <prototype name="wsdl" group="xml" description="wsdl 1.1" targetNamespace="http://schemas.xmlsoap.org/wsdl/">
    
        <filename>/\.wsdl$/ix</filename>
    
      <prototype name="rdf" group="xml" description="RDF" targetNamespace="http://www.w3.org/1999/02/22-rdf-syntax-ns#">
    
        <filename>/\.rdf$/ix</filename>
    
    
    
      <prototype name="xmlcatalog" group="xml" description="XML Catalog" targetNamespace="urn:oasis:names:tc:entity:xmlns:xml:catalog">
    
        <filename>/\.xml$/ix</filename>
    
      </prototype>  
      <prototype name="docbook" group="xml" description="DocBook 4.2">
    
        <filename>/\.(dbk?|docbook)$/i</filename>
    
      <prototype name="mathml" group="xml" description="MathML2">
    
        <filename>/\.(math?|mml)$/i</filename>
    
    
    
      <!--  database languages  -->
      <prototype name="clarion" group="database" description="Clarion">
    
        <filename>/\.(cla|clw)$/i</filename>
    
      <!-- warning!! extensions conflict with Clipper -->
      <prototype name="Clipper" group="database" description="Clipper">
    
        <filename>/\.(ch|prg)$/i</filename>
    
      <prototype name="foxpro" group="database" description="FoxPro">
    
        <filename>/\.(prg|spr|mpr)$/i</filename>
    
      <prototype name="sqlj" group="database" description="SQLJ (Java sql)">
    
        <filename>/\.sqlj$/i</filename>
    
      <prototype name="paradox" group="database" description="Paradox">
    
        <filename>/\.sc$/i</filename>
    
      <prototype name="sql" group="database" description="SQL, PL/SQL">
    
        <filename>/\.sql$/i</filename>
    
      <prototype name="mysql" group="database" description="MySQL">
    
       <filename>/\.sql$/i</filename>
    
    
      <prototype name="Batch" group="scripts" description="Batch/Config.sys/NTcmd">
    
        <filename>/\.(Cmd|Bat|nt|btm|sys)$/i</filename>
    
      <prototype name="apache" group="scripts" description="Apache httpd.conf">
    
        <filename>/(httpd\.conf|srm\.conf|access\.conf|\.htaccess|apache\.conf)$/i</filename>
    
      <prototype name="shell" group="scripts" description="sh/ksh/bash script">
    
        <filename>/\.(sh|spec)$|^\./i</filename>
        <filename>/^PKGBUILD$/i</filename>
    
      <prototype name="avisynth" group="scripts" description="AviSynth">
    
        <filename>/\.(avs|avsi)$/i</filename>
    
      <prototype name="config" group="scripts" description="Config, INI and CTL">
    
        <filename>/\.(ctl|tpl|ini|cfg|inf|srg|conf|types|tab|dof|dsk|lng)$/i</filename>
    
      <prototype name="awk" group="scripts" description="AWK">
    
        <filename weight='5'>/\.awk$/i</filename>
    
    
      <prototype name="makefile" group="scripts" description="makefile">
    
        <filename>/(makefile | tools\.ini) | \.(mak|gmk|ds(p|w)|bp(k|r|g)$)/ix</filename>
        <filename weight='3'>/(android|application)\.mk/i</filename>
    
      <prototype name="qmake" group="scripts" description="Qt qmake">
    
        <filename>/\.pr[oif]$/i</filename>
    
    
      <prototype name="mkb" group="scripts" description="Project build file for Airplay SDK">
        <filename>/\.(mkb|mkf)$/i</filename>
    
      <prototype name="ant" group="scripts" description="Ant's build.xml" targetNamespace="http://jakarta.apache.org/ant/">
    
        <filename weight='4'>/\bbuild\.xml$/ix</filename>
    
    
      <prototype name="acapella" group="scripts" description="Acapella">
    
        <filename>/\.(script|proc|param|parameter)$/i</filename>
    
    
      <prototype name="qrc" group="scripts" description="qrc">
    
        <filename>/\.qrc$/ix</filename>
    
    
     <prototype name="m4" group="scripts" description="M4">
    
        <filename>/\.m4$/i</filename>
    
      <prototype name="linkdef" group="scripts" description="Link Defines">
    
        <filename weight='3'>/\.def$/i</filename>
    
      <prototype name="resources" group="scripts" description="Resources">
    
        <filename>/\.(rc|dlg)$/i</filename>
    
    
      <prototype name="javacc" group="scripts" description="Java Compiler Compiler">
    
        <filename>/\.(jjt?)$/i</filename>
    
      <prototype name="javaProperties" group="scripts" description="Java properties">
    
        <filename>/\.pro(p(erties)?)?$/i</filename>
    
      <prototype name="javapolicy" group="scripts" description="Java policy">
    
        <filename>/\.policy$/i</filename>
    
      <prototype name="asn1" group="scripts" description="ASN.1/ECN">
    
        <filename>/\.(asn|asn1|ecn|edm|elm|mib)$/i</filename>
        <filename>/-mib$/i</filename>
    
      <prototype name="lex" group="scripts" description="Lex">
    
        <filename>/\.(l|f?lex)+$/i</filename>
    
      <prototype name="yacc" group="scripts" description="YACC">
    
        <filename>/\.y+$/i</filename>
    
    
    
      <prototype name="delphiform" group="scripts" description="Delphi form">
    
        <filename>/\.dfm$/i</filename>
    
      <prototype name="pnuts" group="scripts" description="Java: Pnuts">
    
        <filename>/\.(pnut)$/i</filename>
    
    
        <prototype name="scons" group="scripts" description="SCons">
    
        <filename>/(SConstruct|SConscript)$/i</filename>
    
      <prototype name="rtf" group="scripts" description="RTF text">
    
        <filename>/\.rtf$/i</filename>
    
      <prototype name="TeX" group="scripts" description="TeX">
    
        <filename>/\.(tex|cls|sty|ltx|ltr|dtx)$/i</filename>
    
      <prototype name="graphviz" group="scripts" description="GraphViz dot">
    
        <filename>/\.dot+$/i</filename>
    
      <prototype name="dcl" group="scripts" description="OpenVMS DCL">
    
        <filename>/\.com$/i</filename>
    
      <prototype name="vrml" group="scripts" description="VRML">
    
        <filename>/\.wrl$/i</filename>
    
    
      <prototype name="wsc" group="scripts" description="wsc" targetNamespace="uri:wsc">
        <!-- NOTE! 'targetNamespace' is fictive, used only for xsd2hrc -->
    
        <filename>/\.wsc$/i</filename>
    
      <prototype name="wsf" group="scripts" description="wsf">
    
        <filename>/\.wsf$/i</filename>
    
    
    
      <prototype name="rarscript" group="scripts.install" description="RAR Install Script">
    
        <filename>/\.s$/i</filename>
    
      <prototype name="nsi" group="scripts.install" description="Nullsoft Install Script">
    
        <filename>/\.ns(i|h)$/i</filename>
    
      <prototype name="iss" group="scripts.install" description="InnoSetup script">
    
        <filename>/\.iss$/i</filename>
    
      <prototype name="isScripts" group="scripts.install" description="IS script">
    
        <filename>/\.rul$/i</filename>
    
    
      <!--  rare languages  -->
    
      <prototype name="c1c" group="rare" description="1C">
    
        <filename>/\.1c$/i</filename>
    
      <prototype name="ada" group="rare" description="Ada">
    
        <filename>/\.(ads|adb|adc)$/i</filename>
    
      <prototype name="abap4" group="rare" description="ABAP/4">
    
        <filename>/\.(abap4|abap)$/i</filename>
    
      <prototype name="AutoIt" group="rare" description="AutoIt 2.x">
    
        <filename>/\.aut$/i</filename>
    
    
      <!--  !! you may wish to swap next two types
      because of collision with extensions  -->
      <prototype name="dssp" group="rare" description="Dssp">
    
        <filename>/\.dsp$/i</filename>
    
      <prototype name="adsp" group="rare" description="ADSP-21xx Asm">
    
        <filename>/\.(dsp|sys)$/i</filename>
    
      <prototype name="Baan" group="rare" description="Baan">
    
        <filename>/\.cln$/i</filename>
    
      <prototype name="cobol" group="rare" description="Cobol Fixed format">
    
        <filename>/\.(cob|cbl)$/i</filename>
    
      <prototype name="cobolfr" group="rare" description="Cobol Free format">
    
        <filename>/\.(cob|cbl)$/i</filename>
    
      <prototype name="cache" group="rare" description="Cache/Open-M">
    
        <filename>/\.(rsa|ro|rtn|inc|int|mac|cdl)$/i</filename>
    
      <prototype name="cup" group="rare" description="CUP">
    
        <filename>/\.(cup)$/i</filename>
    
      <prototype name="eiffel" group="rare" description="Eiffel">
    
        <filename>/\.e$/i</filename>
    
      <prototype name="erlang" group="rare" description="Erlang">
    
        <filename>/\.[eh]rl$/i</filename>
    
      <prototype name="icon" group="rare" description="Icon">
    
        <filename>/\.icn$/i</filename>
    
      <prototype name="lisp" group="rare" description="Lisp">
    
        <filename>/\.(lsp|lisp|scm|elc|el)$/i</filename>
    
      <prototype name="mako" group="rare" description="Mako templates">
    
        <!-- extension conflicts with Makefile, hence weight is less than 2 -->
        <filename weight="1.5">/\.(mako|mak)$/i</filename>
    
      <prototype name="matlab" group="rare" description="MatLab">
    
        <filename>/\.m$/i</filename>
    
      <!-- warning!! extensions conflict with link defines -->
      <prototype name="modula2" group="rare" description="Modula2 and Oberon2">
    
        <filename>/\.(mod|ob2|odf|def)$/i</filename>
    
      <prototype name="nesc" group="rare" description="nesC">
    
        <filename>/\.nc$/i</filename>
    
      <prototype name="picasm" group="rare" description="PicAsm">
    
        <filename>/\.(asm|pic)$/i</filename>
    
      <prototype name="pl1" group="rare" description="PL1">
    
        <filename>/\.(pl1|pli)$/i</filename>
    
      <prototype name="rexx" group="rare" description="Rexx">
    
        <filename>/\.(rex|cmd)$/i</filename>
    
     <prototype name="jcl" group="rare" description="JCL">
    
        <filename>/\.(jcl)$/i</filename>
    
    
      <prototype name="sml" group="rare" description="Standard ML">
    
        <filename>/\.(sml|sig)$/i</filename>
    
      <prototype name="ocaml" group="rare" description="OCaml">
    
        <filename>/\.ml[ilpy]?$/i</filename>
    
      <prototype name="sicstusProlog" group="rare" description="Sicstus Prolog">
    
        <filename>/\.pl$/i</filename>
    
      <prototype name="stata" group="rare" description="STATA">
    
        <filename>/\.a?do$/i</filename>
    
      <prototype name="turboProlog" group="rare" description="Turbo Prolog">
    
        <filename>/\.tpl$/i</filename>
    
      <prototype name="verilog" group="rare" description="Verilog HDL">
    
        <filename weight='3'>/\.g?v$/i</filename>
    
      <prototype name="vhdl" group="rare" description="VHDL">
    
        <filename>/\.vhdl?$/i</filename>
    
     <prototype name="ahdl" group="rare" description="AHDL">
    
       <filename>/\.(tdf|tdo|ahdl)$/i</filename>
    
      <prototype name="z80" group="rare" description="z80asm">
    
        <filename>/\.za$/i</filename>
    
      <prototype name="asm80" group="rare" description="asm80">
    
        <filename>/\.a80$/i</filename>
    
      <prototype name="a51" group="rare" description="8051 asm">
    
        <filename>/\.a5(1|2)$/i</filename>
    
      <prototype name="avr" group="rare" description="AVR asm">
    
        <filename>/\.(asm|inc|avr)$/i</filename>
    
      <prototype name="mason" group="rare" description="mason">
    
        <filename>/\.(mc)$/i</filename>
    
      <prototype name="postscript" group="rare" description="PostScript">
    
        <filename>/\.((e)?ps|pfa|gsf)$/i</filename>
    
      <!-- flex extension conflicts -->
      <prototype name="flex" group="rare" description="FlexScript">
    
        <filename>/\.(src|inc|inf)$/i</filename>
    
    
    
      <!--  other types  -->
    
      <prototype name="ass" group="other" description="(Advanced) SubStation Alpha script">
    
        <filename>/\.(ssa|ass)$/</filename>
    
      <prototype name="cue" group="other" description="Cue sheet">
    
        <filename>/\.cue$/</filename>
    
      <prototype name="filesbbs" group="other" description="files.bbs">
    
        <filename>/(files\.bbs|descript\.ion|file_id.diz)/i</filename>
    
      <prototype name="diff" group="other" description="Diff/Patch">
    
        <filename>/\.(diff.*|patch|rej(ect)?)$/i</filename>
    
      <prototype name="text" group="other" description="plain text">
    
        <filename>/(read\.?me|\.txt$|\.rus|\.nfo|\.log|install*|*ChangeLog*|AUTHORS|COPYING|FAQ|LICENSE|TODO$)/i</filename>
        <filename>/\.spo/ix</filename>
    
    
      <prototype name="default" group="other" description="default type">
        <filename weight='1'>//</filename>
    

    【讨论】:

      【解决方案5】:

      您可以改用 Notepad++ 的用户定义语言功能。对于这种用例,我们通常使用 Notepad++。因为它只是一个 XML。 notepad++ 还提供基于 UI 的编辑功能,用于定义您的语言特定语法。

      【讨论】:

        猜你喜欢
        • 1970-01-01
        • 2010-11-12
        • 2010-10-23
        • 1970-01-01
        • 2022-11-20
        • 2017-11-27
        • 2011-02-22
        • 1970-01-01
        • 2016-02-07
        相关资源
        最近更新 更多