806c281b34
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 <lukegb@tvl.fyi> Reviewed-by: tazjin <mail@tazj.in> Reviewed-by: Profpatsch <mail@profpatsch.de> Tested-by: BuildkiteCI
16 lines
445 B
Nix
16 lines
445 B
Nix
{ 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;
|
|
}
|