【问题标题】:How do you add a new language setting to ScintillaNet?如何向 ScintillaNet 添加新的语言设置?
【发布时间】:2011-05-16 20:07:26
【问题描述】:

我正在编写一个 C# 程序,它使用文本编辑器来编辑类似于使用 ScintillaNet (rbf) 编译的 lua 的文件格式。我知道您可以通过添加 Xml 文件并在 CustomDirectory 属性中引用它来向 Scintilla 添加新语言。我希望该语言具有与 lua 相同的 Lexer/Parser,但没有关键字和代码完成。有人可以发布这样的 Xml 代码,我可以用作示例吗?

目前看起来是这样的:

<?xml version="1.0" encoding="utf-8"?>
<ScintillaNET>
  <Language Name="rbf">
    <Indentation TabWidth="4" SmartIndentType="cpp" />
    <Lexer LineCommentPrefix="--" StreamCommentPrefix="[[" StreamCommentSuffix="]]" >
    </Lexer>
    <Styles>
      <Style Name="DEFAULT" FontName="Courier New" Size="10"/>
      <Style Name="COMMENT" ForeColor="Green" Size="8"/>
      <Style Name="COMMENTLINE" ForeColor="Green" Size="8"/>
      <Style Name="NUMBER" ForeColor="Orange"/>
      <Style Name="WORD" ForeColor="Blue" Bold="Yes"/>
      <Style Name="WORD3" ForeColor="DarkBlue" Bold="Yes"/>
      <Style Name="WORD4" ForeColor="DarkBlue" Bold="Yes"/>
      <Style Name="WORD5" ForeColor="LightGreen" Bold="Yes"/>
    </Styles>
  </Language>
</ScintillaNET >

如果有人能告诉我如何为不同样式(字符串、cmets、数字等)设置默认颜色,我也会有所帮助

【问题讨论】:

    标签: c# .net syntax-highlighting scintilla


    【解决方案1】:

    我已经解决了,您添加此行以从已支持的语言继承词法分析器:

    <Lexer LexerName="lua"/>
    

    现在我只需要知道如何禁用 cmets。

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2019-10-16
      • 1970-01-01
      • 2019-06-14
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      相关资源
      最近更新 更多