Skip to content

Commit

Permalink
Fix #481 Add Rust syntax highlighting and code folding
Browse files Browse the repository at this point in the history
  • Loading branch information
bobbylight committed Oct 18, 2023
1 parent 2d7b80e commit ca5157d
Show file tree
Hide file tree
Showing 13 changed files with 3,325 additions and 24 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -70,6 70,7 @@ protected void initTokenMakerMap() {
putMapping(SYNTAX_STYLE_PROPERTIES_FILE,pkg "PropertiesFileTokenMaker");
putMapping(SYNTAX_STYLE_PYTHON, pkg "PythonTokenMaker");
putMapping(SYNTAX_STYLE_RUBY, pkg "RubyTokenMaker");
putMapping(SYNTAX_STYLE_RUST, pkg "RustTokenMaker");
putMapping(SYNTAX_STYLE_SAS, pkg "SASTokenMaker");
putMapping(SYNTAX_STYLE_SCALA, pkg "ScalaTokenMaker");
putMapping(SYNTAX_STYLE_SQL, pkg "SQLTokenMaker");
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -293,6 293,12 @@ public interface SyntaxConstants {
String SYNTAX_STYLE_RUBY = "text/ruby";


/**
* Style for highlighting Ruby.
*/
String SYNTAX_STYLE_RUST = "text/rust";


/**
* Style for highlighting SAS keywords.
*/
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -98,6 98,7 @@ private Map<String, FoldParser> createFoldParserMap() {
map.put(SYNTAX_STYLE_PHP, new HtmlFoldParser(HtmlFoldParser.LANGUAGE_PHP));
map.put(SYNTAX_STYLE_PROTO, new CurlyFoldParser());
map.put(SYNTAX_STYLE_PYTHON, new PythonFoldParser());
map.put(SYNTAX_STYLE_RUST, new CurlyFoldParser());
map.put(SYNTAX_STYLE_SCALA, new CurlyFoldParser());
map.put(SYNTAX_STYLE_TYPESCRIPT, new CurlyFoldParser());
map.put(SYNTAX_STYLE_XML, new XmlFoldParser());
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -241,7 241,7 @@ import org.fife.ui.rsyntaxtextarea.*;
* Returns the closest {@link TokenTypes} "standard" token type for a given
* "internal" token type (e.g. one whose value is <code>&lt; 0</code>).
*/
@Override
@Override
public int getClosestStandardTokenTypeForInternalType(int type) {
switch (type) {
case INTERNAL_IN_JS_MLC:
Expand Down

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Loading

0 comments on commit ca5157d

Please sign in to comment.