11import { parser } from "@lezer/java"
22import { flatIndent , continuedIndent , indentNodeProp , foldNodeProp , foldInside ,
33 LRLanguage , LanguageSupport } from "@codemirror/language"
4- import { styleTags , tags as t } from "@codemirror/highlight"
54
65/// A language provider based on the [Lezer Java
76/// parser](https://github.com/lezer-parser/java), extended with
@@ -24,42 +23,6 @@ export const javaLanguage = LRLanguage.define({
2423 [ "Block SwitchBlock ClassBody ElementValueArrayInitializer ModuleBody EnumBody " +
2524 "ConstructorBody InterfaceBody ArrayInitializer" ] : foldInside ,
2625 BlockComment ( tree ) { return { from : tree . from + 2 , to : tree . to - 2 } }
27- } ) ,
28- styleTags ( {
29- null : t . null ,
30- instanceof : t . operatorKeyword ,
31- this : t . self ,
32- "new super assert open to with void" : t . keyword ,
33- "class interface extends implements enum" : t . definitionKeyword ,
34- "module package import" : t . moduleKeyword ,
35- "switch while for if else case default do break continue return try catch finally throw" : t . controlKeyword ,
36- [ "requires exports opens uses provides public private protected static transitive abstract final " +
37- "strictfp synchronized native transient volatile throws" ] : t . modifier ,
38- IntegerLiteral : t . integer ,
39- FloatLiteral : t . float ,
40- "StringLiteral TextBlock" : t . string ,
41- CharacterLiteral : t . character ,
42- LineComment : t . lineComment ,
43- BlockComment : t . blockComment ,
44- BooleanLiteral : t . bool ,
45- PrimitiveType : t . standard ( t . typeName ) ,
46- TypeName : t . typeName ,
47- Identifier : t . variableName ,
48- "MethodName/Identifier" : t . function ( t . variableName ) ,
49- Definition : t . definition ( t . variableName ) ,
50- ArithOp : t . arithmeticOperator ,
51- LogicOp : t . logicOperator ,
52- BitOp : t . bitwiseOperator ,
53- CompareOp : t . compareOperator ,
54- AssignOp : t . definitionOperator ,
55- UpdateOp : t . updateOperator ,
56- Asterisk : t . punctuation ,
57- Label : t . labelName ,
58- "( )" : t . paren ,
59- "[ ]" : t . squareBracket ,
60- "{ }" : t . brace ,
61- "." : t . derefOperator ,
62- ", ;" : t . separator
6326 } )
6427 ]
6528 } ) ,
0 commit comments