Skip to content

Commit

Permalink
[Java] Highlight template processor as method call.
Browse files Browse the repository at this point in the history
  • Loading branch information
zufuliu committed Mar 20, 2024
1 parent 48e2fa6 commit 9399a27
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 5 deletions.
2 changes: 1 addition & 1 deletion readme.md
Original file line number Diff line number Diff line change
Expand Up @@ -81,7 +81,7 @@ Latest development builds (artifacts in Release configuration for each compiler
* INI Configuration File
* [Inno Setup](tools/lang/InnoSetup.iss), up to Inno Setup 6.2.
* [Boost Jam](tools/lang/Jamfile.jam), up to Jam 4.4.
* [Java](tools/lang/Java.java), up to Java 21. [Screenshots](https://github.com/zufuliu/notepad2/wiki/Screenshots#java)
* [Java](tools/lang/Java.java), up to Java 22. [Screenshots](https://github.com/zufuliu/notepad2/wiki/Screenshots#java)
* [BeanShell](https://github.com/beanshell/beanshell)
* [JavaScript](tools/lang/JavaScript.js), up to ECMAScript 2024 with [JSX](https://facebook.github.io/jsx/) and [Web APIs](https://developer.mozilla.org/en-US/docs/Web/API).
* [JSON](https://www.json.org) and [JSON5](https://json5.org/) Document
Expand Down
3 changes: 3 additions & 0 deletions scintilla/lexers/LexJava.cxx
Original file line number Diff line number Diff line change
Expand Up @@ -344,6 +344,9 @@ void ColouriseJavaDoc(Sci_PositionU startPos, Sci_Position lengthDoc, int initSt
sc.ChangeState(SCE_JAVA_CLASS);
}
}
} else if (sc.chNext == '\"') {
// template processor
sc.ChangeState(SCE_JAVA_FUNCTION);
}
if (sc.state != SCE_JAVA_WORD && sc.ch != '.') {
kwType = KeywordType::None;
Expand Down
10 changes: 6 additions & 4 deletions tools/lang/Java.java
Original file line number Diff line number Diff line change
@@ -1,9 +1,10 @@
// Java SE 21 https://docs.oracle.com/en/java/javase/index.html
// Java SE 22 https://docs.oracle.com/en/java/javase/index.html
// JDK https://openjdk.org/projects/jdk/
// https://docs.oracle.com/javase/specs/index.html
// https://github.com/beanshell/beanshell/wiki/Basic-syntax

//! keywords ===========================================================
// https://docs.oracle.com/javase/specs/jls/se22/html/jls-3.html#jls-3.9
abstract assert
break
case catch
Expand Down Expand Up @@ -45,7 +46,7 @@ else enum extends

//! directive ===========================================================
// Module Declarations
// https://docs.oracle.com/javase/specs/jls/se21/html/jls-7.html#jls-7.7
// https://docs.oracle.com/javase/specs/jls/se22/html/jls-7.html#jls-7.7
open module
requires
exports to
Expand All @@ -55,7 +56,7 @@ else enum extends
transitive static

//! API ===========================================================
// https://docs.oracle.com/en/java/javase/21/docs/api/index.html
// https://docs.oracle.com/en/java/javase/22/docs/api/index.html

module java.base {

Expand Down Expand Up @@ -590,7 +591,7 @@ class JavaCompile
}

//! Javadoc ===========================================================
// https://docs.oracle.com/en/java/javase/21/docs/specs/javadoc/doc-comment-spec.html
// https://docs.oracle.com/en/java/javase/22/docs/specs/javadoc/doc-comment-spec.html
/**
* @author name-text
* {@code text}
Expand All @@ -601,6 +602,7 @@ class JavaCompile
* {@index word description } JDK 9
* {@index "phrase" description } JDK 9
* {@inheritDoc}
* {@inheritDoc supertype} JDK 22
* {@link module/package.class#member label}
* {@linkplain module/package.class#member label}
* {@literal text}
Expand Down

0 comments on commit 9399a27

Please sign in to comment.