Skip to main content

ELEMENT_QUERY

Constant ELEMENT_QUERY 

Source
pub const ELEMENT_QUERY: &str = r"
(function_declaration
  name: (identifier) @func_name) @function
(method_declaration
  name: (field_identifier) @method_name) @function
(type_spec
  name: (type_identifier) @type_name
  type: (struct_type)) @class
(type_spec
  name: (type_identifier) @type_name
  type: (interface_type)) @class
";
Expand description

Tree-sitter query for extracting Go elements (functions, methods, and types).