Skip to content

Commit 9bd7572

Browse files
authored
Update README.md
1 parent aa0c90b commit 9bd7572

1 file changed

Lines changed: 7 additions & 7 deletions

File tree

‎README.md‎

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -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
3434
public 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:
4949
You have two choice:
5050
A.Implement a AutoCompleteProvider by your self
51-
```
51+
```Java
5252
public 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
6666
This can only match your given word case insensitively by using startsWith().
6767
And you should use IdentifierAutoComplete.Identifiers as extra data from CodeAnalyzer or there will not be any effect.
6868
Sample:
69-
```
69+
```Java
7070
IdentifierAutoComplete autoComplete = new IdentifierAutoComplete();
7171
String[] keywords = new String[]{"public","private","protected"};
7272
//True if your all of keywords are in small case
7373
autoComplete.setKeywords(keywords,true);
7474
```
7575
And in your CodeAnalyzer:
76-
```
76+
```Java
7777
public 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)
103103
Use lexer/tokenizer to create a formatter for your language.
104104
* Implement EditorLanguage:
105-
```
105+
```Java
106106
public class MyLanguage implements EditorLanguage {
107107

108108
public CodeAnalyzer createAnalyzer() {
@@ -147,7 +147,7 @@ public class MyLanguage implements EditorLanguage {
147147
```
148148
* Apply your language
149149
It's very simple:
150-
```
150+
```Java
151151
editor.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

Comments
 (0)