Module: TreeSitter

Extended by:
Mixins::Language
Defined in:
lib/tree_sitter.rb,
lib/tree_sitter/node.rb,
lib/tree_sitter/error.rb,
lib/tree_sitter/query.rb,
lib/tree_sitter/version.rb,
lib/tree_sitter/query_match.rb,
lib/tree_sitter/query_cursor.rb,
lib/tree_sitter/query_matches.rb,
lib/tree_sitter/query_captures.rb,
lib/tree_sitter/mixins/language.rb,
lib/tree_sitter/query_predicate.rb,
lib/tree_sitter/text_predicate_capture.rb

Overview

TreeSitter is a Ruby interface to the tree-sitter parsing library.

Defined Under Namespace

Modules: Mixins Classes: LanguageLoadError, Node, ParserNotFoundError, ParserVersionError, Query, QueryCaptures, QueryCreationError, QueryCursor, QueryMatch, QueryMatches, QueryPredicate, SymbolNotFoundError, TextPredicateCapture, TreeSitterError

Constant Summary collapse

TREESITTER_VERSION =

The version of the tree-sitter library.

'0.24.6'
VERSION =

The current version of the gem.

'1.11.1'
ENV_PARSERS =

A colon-separated list of paths pointing to directories that can contain parsers. Order matters. Takes precedence over default lookup paths.

ENV['TREE_SITTER_PARSERS']
&.split(':')
&.map { |v| Pathname(v) }
.freeze
LIBDIRS =

The default paths we use to lookup parsers. Order matters.

[
  '.vendor/parsers',
  '.vendor/tree-sitter-parsers',
  'vendor/parsers',
  'vendor/tree-sitter-parsers',
  'parsers',
  'tree-sitter-parsers',
  '.',
  '/opt/local/lib',
  '/opt/lib',
  '/usr/local/lib',
  '/usr/lib',
].map { |p| Pathname(p) }.freeze

Method Summary

Methods included from Mixins::Language

ext, language