@willbooster/tree-sitter-java 0.0.0-placeholder.0 → 1.0.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/package.json CHANGED
@@ -1,13 +1,73 @@
1
1
  {
2
2
  "name": "@willbooster/tree-sitter-java",
3
- "version": "0.0.0-placeholder.0",
4
- "description": "Placeholder for WillBooster's fork of tree-sitter-java; the first release is 1.0.0",
3
+ "version": "1.0.0",
4
+ "description": "Java grammar for tree-sitter",
5
+ "keywords": [
6
+ "incremental",
7
+ "parsing",
8
+ "tree-sitter",
9
+ "java"
10
+ ],
5
11
  "repository": {
6
12
  "type": "git",
7
13
  "url": "git+https://github.com/WillBooster/tree-sitter-java.git"
8
14
  },
9
15
  "license": "MIT",
10
16
  "author": "WillBooster Inc.",
17
+ "files": [
18
+ "grammar.js",
19
+ "queries/*.scm",
20
+ "src/node-types.json",
21
+ "tree-sitter.json",
22
+ "*.wasm"
23
+ ],
24
+ "scripts": {
25
+ "build-wasm": "script/generate --build-wasm",
26
+ "build/ci": "bun run build-wasm",
27
+ "cleanup": "bun wb lint --fix --format",
28
+ "format": "bun wb lint --format",
29
+ "generate": "script/generate",
30
+ "lint": "bun wb lint",
31
+ "lint-fix": "bun wb lint --fix",
32
+ "prepare": "(bun lefthook install || true) && (test ! -f .lefthook/normalize-bun-lockfile.sh || bash .lefthook/normalize-bun-lockfile.sh)",
33
+ "release": "wb release",
34
+ "prestart": "bun run build-wasm",
35
+ "start": "script/tree-sitter playground",
36
+ "test": "bun wb test",
37
+ "test/ci": "bun wb test-on-ci",
38
+ "test/ci-setup": "playwright install --with-deps chromium",
39
+ "typecheck": "bun wb typecheck",
40
+ "verify": "bun wb verify",
41
+ "verify-full": "bun wb verify --full"
42
+ },
43
+ "devDependencies": {
44
+ "@tsconfig/bun": "1.0.11",
45
+ "@types/bun": "1.4.2",
46
+ "@vitest/browser-playwright": "5.0.3",
47
+ "@willbooster/oxfmt-config": "1.2.2",
48
+ "@willbooster/oxlint-config": "1.4.8",
49
+ "@willbooster/wb": "22.24.0",
50
+ "@willbooster/web-tree-sitter": "1.4.7",
51
+ "conventional-changelog-conventionalcommits": "10.4.0",
52
+ "lefthook": "2.1.16",
53
+ "oxfmt": "0.71.0",
54
+ "oxlint": "1.86.0",
55
+ "oxlint-tsgolint": "7.0.2003",
56
+ "playwright": "1.63.0",
57
+ "semantic-release": "25.0.9",
58
+ "sort-package-json": "4.0.0",
59
+ "typescript": "7.0.2",
60
+ "vitest": "5.0.3",
61
+ "wrangler": "4.147.0"
62
+ },
63
+ "peerDependencies": {
64
+ "@willbooster/web-tree-sitter": "^1.4.3"
65
+ },
66
+ "peerDependenciesMeta": {
67
+ "@willbooster/web-tree-sitter": {
68
+ "optional": true
69
+ }
70
+ },
11
71
  "publishConfig": {
12
72
  "access": "public",
13
73
  "registry": "https://registry.npmjs.org/"
@@ -0,0 +1,149 @@
1
+ ; Variables
2
+
3
+ (identifier) @variable
4
+
5
+ ; Methods
6
+
7
+ (method_declaration
8
+ name: (identifier) @function.method)
9
+ (method_invocation
10
+ name: (identifier) @function.method)
11
+ (super) @function.builtin
12
+
13
+ ; Annotations
14
+
15
+ (annotation
16
+ name: (identifier) @attribute)
17
+ (marker_annotation
18
+ name: (identifier) @attribute)
19
+
20
+ "@" @operator
21
+
22
+ ; Types
23
+
24
+ (type_identifier) @type
25
+
26
+ (interface_declaration
27
+ name: (identifier) @type)
28
+ (class_declaration
29
+ name: (identifier) @type)
30
+ (enum_declaration
31
+ name: (identifier) @type)
32
+
33
+ ((field_access
34
+ object: (identifier) @type)
35
+ (#match? @type "^[A-Z]"))
36
+ ((scoped_identifier
37
+ scope: (identifier) @type)
38
+ (#match? @type "^[A-Z]"))
39
+ ((method_invocation
40
+ object: (identifier) @type)
41
+ (#match? @type "^[A-Z]"))
42
+ ((method_reference
43
+ . (identifier) @type)
44
+ (#match? @type "^[A-Z]"))
45
+
46
+ (constructor_declaration
47
+ name: (identifier) @type)
48
+
49
+ [
50
+ (boolean_type)
51
+ (integral_type)
52
+ (floating_point_type)
53
+ (floating_point_type)
54
+ (void_type)
55
+ ] @type.builtin
56
+
57
+ ; Constants
58
+
59
+ ((identifier) @constant
60
+ (#match? @constant "^_*[A-Z][A-Z\\d_]+$"))
61
+
62
+ ; Builtins
63
+
64
+ (this) @variable.builtin
65
+
66
+ ; Literals
67
+
68
+ [
69
+ (hex_integer_literal)
70
+ (decimal_integer_literal)
71
+ (octal_integer_literal)
72
+ (decimal_floating_point_literal)
73
+ (hex_floating_point_literal)
74
+ ] @number
75
+
76
+ [
77
+ (character_literal)
78
+ (string_literal)
79
+ ] @string
80
+ (escape_sequence) @string.escape
81
+
82
+ [
83
+ (true)
84
+ (false)
85
+ (null_literal)
86
+ ] @constant.builtin
87
+
88
+ [
89
+ (line_comment)
90
+ (block_comment)
91
+ ] @comment
92
+
93
+ ; Keywords
94
+
95
+ [
96
+ "abstract"
97
+ "assert"
98
+ "break"
99
+ "case"
100
+ "catch"
101
+ "class"
102
+ "continue"
103
+ "default"
104
+ "do"
105
+ "else"
106
+ "enum"
107
+ "exports"
108
+ "extends"
109
+ "final"
110
+ "finally"
111
+ "for"
112
+ "if"
113
+ "implements"
114
+ "import"
115
+ "instanceof"
116
+ "interface"
117
+ "module"
118
+ "native"
119
+ "new"
120
+ "non-sealed"
121
+ "open"
122
+ "opens"
123
+ "package"
124
+ "permits"
125
+ "private"
126
+ "protected"
127
+ "provides"
128
+ "public"
129
+ "requires"
130
+ "record"
131
+ "return"
132
+ "sealed"
133
+ "static"
134
+ "strictfp"
135
+ "switch"
136
+ "synchronized"
137
+ "throw"
138
+ "throws"
139
+ "to"
140
+ "transient"
141
+ "transitive"
142
+ "try"
143
+ "uses"
144
+ "volatile"
145
+ "when"
146
+ "while"
147
+ "with"
148
+ "yield"
149
+ ] @keyword
@@ -0,0 +1,20 @@
1
+ (class_declaration
2
+ name: (identifier) @name) @definition.class
3
+
4
+ (method_declaration
5
+ name: (identifier) @name) @definition.method
6
+
7
+ (method_invocation
8
+ name: (identifier) @name
9
+ arguments: (argument_list) @reference.call)
10
+
11
+ (interface_declaration
12
+ name: (identifier) @name) @definition.interface
13
+
14
+ (type_list
15
+ (type_identifier) @name) @reference.implementation
16
+
17
+ (object_creation_expression
18
+ type: (type_identifier) @name) @reference.class
19
+
20
+ (superclass (type_identifier) @name) @reference.class