Coder Social home page Coder Social logo

symex-ts's Introduction

Symex-TS

An experimental Symex.el-like package using Tree Sitter

This package defines a hydra which allows for Symex.el-like movement within a source code buffer using the buffer's Tree Sitter tree, as generated by the tree-sitter package.

The hydra also defines tree manipulation functions, however this is very much a work-in-progress (only delete node at present).

Requirements

This package requires elisp-tree-sitter as it operates directly on the tree generated by this package. There is talk of integrating Tree Sitter directly into Emacs, so if and when this work is completed then this dependency should no longer be required. However it will always depend upon a suitable Tree Sitter environment being available on the host machine.

Usage

After requiring symex-ts.el, simply bind symex-ts-launch to a key. For example: -

(global-set-key (kbd "<f2>") #'symex-ts-launch)

Visit a file containing source code that has a Tree Sitter parser available and ensure that the tree-sitter minor mode is enabled. Then use the keybinding (or M-x symex-ts-launch) to launch the hydra.

The available key-bindings should be visible within the minibuffer. Only simple movements (up, down, forward, backward) have been created so far as well as a key to delete the current node. Please refer to the Symex.el documentation for further instructions about how to use Symex.el.

While navigating, the region containing the current node will be highlighted. This is to help in identifying what the current node represents. There is also a debug (d) keybinding which prints the currently selected node as an s-expression (or should that be "as a Symex"...?) This is useful for identifying what is currently being highlighted.

Progress and next steps

This package is only experimental; it's more a proof-of-concept than a useful tool. The eventual goal would be to add Tree Sitter support directly to Symex.el rather than creating a separate package, so this project's lifespan will end if that happens.

The next step for this project is to provide tree-manipulation functionality in order to provide proper structural editing to any supported language. At that point, the purpose of this project will be complete: it will have proved that Symex.el can be extended to support Tree Sitter.

symex-ts's People

Contributors

polaris64 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.