Skip to content
This repository was archived by the owner on Sep 9, 2025. It is now read-only.

Commit c256b6e

Browse files
committed
📝 classes.
1 parent ef8076d commit c256b6e

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

languages/tree-sitter-stack-graphs-java/src/stack-graphs.tsg

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -86,6 +86,10 @@ attribute node_symbol = node => symbol = (source-text node), source_n
8686
;;;;;;;;;;;;;;;;;;;;
8787
;; Class Expressions
8888

89+
; Classes (and other declarations with members, e.g. records, enums, interfaces) define a name in their enclosing scope as well as names belonging to the class itself (i.e. statics) and instances of the class.
90+
;
91+
; They additionally implicitly define `this` available in the bodies of instance methods, and subclasses further define `super`. The nodes defining these point at the types of the class and superclass, respectively.
92+
8993
(class_declaration
9094
name: (identifier) @name
9195
body: (class_body) @class_body) @class {
@@ -1110,7 +1114,7 @@ attribute node_symbol = node => symbol = (source-text node), source_n
11101114
] @type
11111115
{
11121116
node @type.lexical_scope
1113-
node @type.type
1117+
node @type.type ; FIXME: is this actually needed?
11141118
}
11151119

11161120
[

0 commit comments

Comments
 (0)