4

Scintilla コントロールのラッパーとして ScintillaNET を使用しています。特定の言語のキーワード (構文の強調表示用) を変更したいので、そのために独自のバージョンの SciLexer.dll を作成する必要があると想定しています。しかし、できません。 Scintilla プロジェクトで言語のキーワード ファイルを見つけてください。それらはどこにあり、どうすれば変更できますか?

4

1 に答える 1

9

独自の SciLexer.dll を作成する必要はありません。ScintillaNET は XML 構成ファイルをサポートしています。Scintilla のプロパティを次のように設定します。

// Relative to your running directory
scintilla1.ConfigurationManager.CustomLocation = "Config.xml"; 
//Name of the language as defined in the file
scintilla1.ConfigurationManager.Language = "MyLanguage";

次に、lua に基づいた次のような構成ファイルを作成します。

<?xml version="1.0" encoding="utf-8"?>
<ScintillaNET>
  <!--This is what you set the Language property to-->
  <Language Name="lua">

    <!--These are characters after which autocomplete will open-->
    <AutoComplete FillUpCharacters=".([" SingleLineAccept="True" IsCaseSensitive="False">
      <List>
          <!--Insert autocomplete keywords here-->
          and break do else elseif end false for function
          if in local nil not or repeat return then true until while
      </List>
    </AutoComplete>

     <!--Indentation width and indentation type-->
    <Indentation TabWidth="4" SmartIndentType="cpp" />

     <!--Comment characters and the lexer to use-->
    <Lexer LexerName="lua" LineCommentPrefix="--" StreamCommentPrefix="--[[ " StreamCommentSuffix=" ]]" >
      <Keywords List="0" Inherit="False">
        <!--Insert highlighted keywords here-->
         and break do else elseif end false for function
         if in local nil not or repeat return then true until while
      </Keywords>
    </Lexer>
  </Language>
</ScintillaNET>
于 2010-12-04T05:21:46.730 に答える