@@ -30,7 +30,7 @@ To include this project into your project:
3030## How to customize your language for editor
3131* Make a lexer for the language (Use JFlex or ANTLR,etc. you can also modify my Tokenizer)
3232* Implement CodeAnalyzer:
33- ```
33+ ``` Java
3434public class XxxCodeAnalyzer {
3535 public void analyze (CharSequence content , TextColorProvider .TextColors colors , TextColorProvider .AnalyzeThread .Delegate delegate );{
3636 // Analyze code here(Use your Lexer)
@@ -48,7 +48,7 @@ public class XxxCodeAnalyzer {
4848* Create a AutoCompleteProvider:
4949You have two choice:
5050A.Implement a AutoCompleteProvider by your self
51- ```
51+ ``` Java
5252public class XxxAutoComplete {
5353 public List<ResultItem > getAutoCompleteItems (String prefix , boolean isInCodeBlock , TextColorProvider .TextColors colors , int line ); {
5454 // Match items here
@@ -66,14 +66,14 @@ B.Use a simple AutoCompleteProvider implementation -- IdentifierAutoComplete
6666This can only match your given word case insensitively by using startsWith().
6767And you should use IdentifierAutoComplete.Identifiers as extra data from CodeAnalyzer or there will not be any effect.
6868Sample:
69- ```
69+ ``` Java
7070IdentifierAutoComplete autoComplete = new IdentifierAutoComplete ();
7171String [] keywords = new String []{" public" ," private" ," protected" };
7272// True if your all of keywords are in small case
7373autoComplete. setKeywords(keywords,true );
7474```
7575And in your CodeAnalyzer:
76- ```
76+ ``` Java
7777public class XxxCodeAnalyzer {
7878 public void analyze (CharSequence content , TextColorProvider .TextColors colors , TextColorProvider .AnalyzeThread .Delegate delegate );{
7979 XxxTokenizer tokenizer = ... ;
@@ -102,7 +102,7 @@ Remember to call finish() after all addIdentifier() actions done.(This will free
102102* Implement your formatter (Optional)
103103Use lexer/tokenizer to create a formatter for your language.
104104* Implement EditorLanguage:
105- ```
105+ ``` Java
106106public class MyLanguage implements EditorLanguage {
107107
108108 public CodeAnalyzer createAnalyzer () {
@@ -147,7 +147,7 @@ public class MyLanguage implements EditorLanguage {
147147```
148148* Apply your language
149149It's very simple:
150- ```
150+ ``` Java
151151editor. setEditorLanguage(yourLanguage);
152152```
153- All things after will be done in a minute by editor
153+ All things after will be done in a minute by editor
0 commit comments