From 806c281b3491b165d01be561f005dada24107363 Mon Sep 17 00:00:00 2001 From: Profpatsch Date: Sat, 19 Dec 2020 19:22:55 +0100 Subject: feat(users/Profpatsch): moving around via the tree-sitter parse tree Has a little setup to get the cursor position and map it onto a tree sitter node. The current node is saved in a cursor variable, and a highlight overlay marks the range of the current node in the buffer. Change-Id: I0af56115f928732e993fbefe978a246ca7c757ee Reviewed-on: https://cl.tvl.fyi/c/depot/+/2258 Reviewed-by: lukegb Reviewed-by: tazjin Reviewed-by: Profpatsch Tested-by: BuildkiteCI --- users/Profpatsch/emacs-tree-sitter-move/shell.nix | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) create mode 100644 users/Profpatsch/emacs-tree-sitter-move/shell.nix (limited to 'users/Profpatsch/emacs-tree-sitter-move/shell.nix') diff --git a/users/Profpatsch/emacs-tree-sitter-move/shell.nix b/users/Profpatsch/emacs-tree-sitter-move/shell.nix new file mode 100644 index 000000000000..81d622ac73e5 --- /dev/null +++ b/users/Profpatsch/emacs-tree-sitter-move/shell.nix @@ -0,0 +1,16 @@ +{ pkgs ? import ../../../third_party {}, ... }: +let + inherit (pkgs) lib; + + treeSitterGrammars = pkgs.runCommandLocal "grammars" {} '' + mkdir -p $out/bin + ${lib.concatStringsSep "\n" + (lib.mapAttrsToList (name: src: "ln -s ${src}/parser $out/bin/${name}.so") pkgs.tree-sitter.builtGrammars)}; + ''; + +in pkgs.mkShell { + buildInputs = [ + pkgs.tree-sitter.builtGrammars.python + ]; + TREE_SITTER_GRAMMAR_DIR = treeSitterGrammars; +} -- cgit 1.4.1