All Projects → ubolonton → Emacs Tree Sitter

ubolonton / Emacs Tree Sitter

Licence: mit
Tree-sitter for Emacs

Programming Languages

rust
11053 projects

Projects that are alternatives of or similar to Emacs Tree Sitter

Tree Sitter
An incremental parsing system for programming tools
Stars: ✭ 7,083 (+1631.78%)
Mutual labels:  incremental, parsing
Rjsx Mode
A JSX major mode for Emacs
Stars: ✭ 604 (+47.68%)
Mutual labels:  parsing, emacs
Emacs Module Rs
Rust binding and tools for emacs-module (Emacs's dynamic module support)
Stars: ✭ 203 (-50.37%)
Mutual labels:  emacs, binding
Escaya
An blazing fast 100% spec compliant, incremental javascript parser written in Typescript
Stars: ✭ 217 (-46.94%)
Mutual labels:  incremental, parsing
Binjs Ref
Reference implementation for the JavaScript Binary AST format
Stars: ✭ 399 (-2.44%)
Mutual labels:  parsing
Emacs Racer
Racer support for Emacs
Stars: ✭ 381 (-6.85%)
Mutual labels:  emacs
Json Machine
Efficient, easy-to-use, and fast PHP JSON stream parser
Stars: ✭ 376 (-8.07%)
Mutual labels:  parsing
Nord Emacs
An arctic, north-bluish clean and elegant Emacs theme.
Stars: ✭ 379 (-7.33%)
Mutual labels:  emacs
Awesome Dotfiles
Dotfiles for awesome people using the awesomewm linux environment
Stars: ✭ 409 (+0%)
Mutual labels:  emacs
Emacs Purpose
Manage Windows and Buffers According to Purposes
Stars: ✭ 407 (-0.49%)
Mutual labels:  emacs
Org Capture Extension
A Chrome and firefox extension facilitating org-capture in emacs
Stars: ✭ 396 (-3.18%)
Mutual labels:  emacs
Jflex
The fast scanner generator for Java™ with full Unicode support
Stars: ✭ 380 (-7.09%)
Mutual labels:  parsing
Emacs Theme Gruvbox
Gruvbox is a retro groove color scheme for Emacs. Port of the Vim version.
Stars: ✭ 402 (-1.71%)
Mutual labels:  emacs
Pspnet Keras Tensorflow
TensorFlow implementation of original paper : https://github.com/hszhao/PSPNet
Stars: ✭ 381 (-6.85%)
Mutual labels:  parsing
Jdee
The JDEE is an add-on software package that turns Emacs into a comprehensive system for creating, editing, debugging, and documenting Java applications.
Stars: ✭ 409 (+0%)
Mutual labels:  emacs
Nlpnet
A neural network architecture for NLP tasks, using cython for fast performance. Currently, it can perform POS tagging, SRL and dependency parsing.
Stars: ✭ 379 (-7.33%)
Mutual labels:  parsing
Company Box
A company front-end with icons
Stars: ✭ 395 (-3.42%)
Mutual labels:  emacs
Retry
A simple, stateless, functional mechanism to perform actions repetitively until successful.
Stars: ✭ 406 (-0.73%)
Mutual labels:  incremental
Sbjson
This framework implements a strict JSON parser and generator in Objective-C.
Stars: ✭ 3,776 (+823.23%)
Mutual labels:  parsing
.emacs.d
M-EMACS, a full-featured GNU Emacs configuration "distribution"
Stars: ✭ 387 (-5.38%)
Mutual labels:  emacs

emacs-tree-sitter

Documentation Build Status

This is an Emacs Lisp binding for tree-sitter, an incremental parsing library. It requires Emacs 25.1 or above, built with dynamic module support.

It aims to be the foundation for a new breed of Emacs packages that understand code structurally. For example:

  • Faster, fine-grained code highlighting.
  • More flexible code folding.
  • Structural editing (like Paredit, or even better) for non-Lisp code.
  • More informative indexing for imenu.

The author of tree-sitter articulated its merits a lot better in this Strange Loop talk.

Installation

See the installation section in the documentation.

If you want to hack on emacs-tree-sitter itself, see the next section instead.

Setup for Development

  • Clone this repo with the --recursive flag.
  • Add 3 of its directories to load-path: core/, lisp/ and langs/.
  • Install cask.
  • Run ./bin/setup (.\bin\setup on Windows).

If you want to hack on the high-level features (in Lisp) only:

  • Make changes to the .el files.
  • Add tests to tree-sitter-tests.el and run them with ./bin/test (.\bin\test on Windows).

If you want to build additional (or all) grammars from source, or work on the core dynamic module, see the next 2 sections.

Building grammars from source

  • Install tree-sitter CLI tool (if you don't use NodeJS, you can download the binary directly from GitHub):
    # For yarn user
    yarn global add tree-sitter-cli
    
    # For npm user
    npm install -g tree-sitter-cli
    
  • Run:
    # macOS/Linux: make ensure/<lang-name>
    make ensure/rust
    
    # Windows: .\bin\ensure-lang <lang-name>
    .\bin\ensure-lang rust
    
  • You can modifytree-sitter-langs-repos if the language you need is not declared there.

Working on the dynamic module

  • Install the Rust toolchain.
  • Install clang, to generate the raw Rust binding for emacs-module.h.
  • Build:
    # macOS/Linux
    make build
    
    # Windows
    .\bin\build
    
  • Test:
    # macOS/Linux
    make test
    
    # Windows
    .\bin\test
    
  • Continuously rebuild and test on change (requires cargo-watch):
    # macOS/Linux
    make watch
    
    # Windows
    .\bin\test watch
    

To test against a different version of Emacs, set the environment variable EMACS (e.g. EMACS=/snap/bin/emacs make test).

Overall Plan

Targeting lib authors:

  • Write a guide on using the tree-sitter APIs.

Targeting end users:

  • Pick a language, make a "killer" minor mode that extends its major mode in multiple ways.
  • Make minor modes for most common languages.
  • Extract common patterns from the language minor modes into helper language-diagnostic minor modes.
  • Get a language major mode to use tree-sitter for optional features.

Alternative

Binding through C instead of Rust: https://github.com/karlotness/tree-sitter.el

Contribution

Contributions are welcomed. Please take a look at the issue list for ideas, or create a new issue to describe any idea you have for improvement.

For language-specific issues/features, please check out tree-sitter-langs instead.

Show respect and empathy towards others. Both technical empathy and general empathy are highly valued.

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].