Class#

class scubatrace.Class(node: Node, file: File | BlockStatement)#

Bases: BlockStatement

A class in the source code.

static create(node: Node, parent: File | BlockStatement)#

Factory function to create a Class instance based on the language of the file.

Parameters:
  • node (Node) – The tree-sitter node representing the class.

  • file (File) – The file containing the class.

Returns:

An instance of a language-specific Class subclass corresponding to the file’s language.

Return type:

Class

property fields: list[Field]#

Fields (attributes or member variables) in the class.

property functions: list[Function]#

functions in the class.

property name: str#

The name of the class.

property name_node: Node#

The tree-sitter node representing the name of the class.