Skip to content

ShuguangSun/tree-sitter-ess-r

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

26 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

MELPA MELPA Stable Build Status License

tree-sitter-ess-r

R with Tree-sitter support.

Installation

Clone this repository, or install from MELPA. Add the following to your init.el:

(require 'tree-sitter-ess-r)
(add-hook 'ess-r-mode-hook 'tree-sitter-ess-r-mode-activate)

If you use use-package you can install and configure with :

(use-package tree-sitter-ess-r
  :ensure t
  :after (ess)
  :hook (ess-r-mode . tree-sitter-ess-r-mode-activate))

or call interactively M-x tree-sitter-ess-r-using-r-faces

Make tree-sitter to support R

You can install the tree-sitter-langs which includes support for R along with a number of other languages. Alternatively if you want to only add support for tree-sitter-ess-r to your existing Tree-sitter languages you can install manually.

In the following /path/to/tree-sitter-langs/ is the path of your tree-sitter-langs package.

Linux

git clone https://github.com/r-lib/tree-sitter-r.git && cd tree-sitter-r
gcc ./src/parser.c ./src/scanner.c -lstdc++ -fPIC -I./ -I./src/ -I./src/tree_sitter --shared -o r.so
cp ./r.so /path/to/tree-sitter-langs/langs/bin
mkdir /path/to/tree-sitter-langs/queries/r
cp ./queries/* /path/to/tree-sitter-langs/queries/r

Windows (MINGW64)

git clone https://github.com/r-lib/tree-sitter-r.git
gcc ./src/parser.c ./src/scanner.c -lstdc++ -fPIC -I./ -I./src/ -I./src/tree_sitter --shared -o r.dll
cp ./r.dll /path/to/tree-sitter-langs/langs/bin
mkdir /path/to/tree-sitter-langs/queries/r
cp ./queries/* /path/to/tree-sitter-langs/queries/r