ul / kak-tree Goto Github PK
View Code? Open in Web Editor NEWStructural selections for Kakoune
License: The Unlicense
Structural selections for Kakoune
License: The Unlicense
None of tree-*
commands respect my config, which has some blacklist for go file types.
I've tree_cmd
option set in my kakrc and it expands correctly:
set-option global tree_cmd "kak-tree -c %val{config}/kak-tree.toml"
This is content of my kak-tree.toml
:
[filetype.go]
blacklist = ["nil", "block", "identifier"]
For example, if I issue tree-node-sexp
, I still can see blacklisted items.
Use this file:
int main(void) {
printf("hello world\n");
return 0;
}
Select from p
to ;
on the printf
line. Now running tree-select-parent-node
, tree-select-next-node
, and tree-select-previous-node
are no-ops.
How can we get Clojure added? From asking around, it appears this project is the canonical Clojure Tree-sitter project: https://github.com/sogaiu/tree-sitter-clojure
Thanks!
Hi,
I have been advised to use kak-tree for a plugin I'm working on. But I have trouble getting started with it.
What are the value I can use in the variable ?
Could it be possible to have a tiny example of a basic workflow ? For example how to use kak-tree in a plugin script ?
See emacs-lsp/lsp-mode#817 :-)
...could be added leveraging https://crates.io/crates/tree-sitter-highlight
Cloning the repo:
hub clone ul/kak-tree --recurse-submodules | tail
Output:
remote: Enumerating objects: 88, done.
remote: Total 88 (delta 0), reused 0 (delta 0), pack-reused 88
Submodule path 'vendor/tree-sitter-bash/examples/bash-it/test_lib/bats-assert': checked out '9f88b4207da750093baabc4e3f41bf68f0dd3630'
Submodule path 'vendor/tree-sitter-bash/examples/bash-it/test_lib/bats-core': checked out '85388685632f85d5a1c32e6bca2deec401964cf7'
Submodule path 'vendor/tree-sitter-bash/examples/bash-it/test_lib/bats-file': checked out '2fddb2b831d65cdf2e411f3b47f4677fbb15729c'
Submodule path 'vendor/tree-sitter-bash/examples/bash-it/test_lib/bats-support': checked out '004e707638eedd62e0481e8cdc9223ad471f12ee'
error: Server does not allow request for unadvertised object 627806ec6a6109b17de8400384474395ac2afb2d
Fetched in submodule path 'vendor/tree-sitter-c', but it did not contain 627806ec6a6109b17de8400384474395ac2afb2d. Direct fetching of that commit failed.
Building the executable:
cargo install --path . --force --features "rust"
Output:
Installing kak-tree v0.1.0 (/Users/vincent/repos/ul/kak-tree)
Updating crates.io index
Compiling serde_derive v1.0.104
Compiling kak-tree v0.1.0 (/Users/vincent/repos/ul/kak-tree)
Compiling trackable_derive v0.1.2
error: failed to run custom build command for `kak-tree v0.1.0 (/Users/vincent/repos/ul/kak-tree)`
Caused by:
process didn't exit successfully: `/Users/vincent/repos/ul/kak-tree/target/release/build/kak-tree-2c230ccdf8b60dd7/build-script-build` (exit code: 1)
--- stdout
TARGET = Some("x86_64-apple-darwin")
OPT_LEVEL = Some("3")
HOST = Some("x86_64-apple-darwin")
CC_x86_64-apple-darwin = None
CC_x86_64_apple_darwin = None
HOST_CC = None
CC = None
CFLAGS_x86_64-apple-darwin = None
CFLAGS_x86_64_apple_darwin = None
HOST_CFLAGS = None
CFLAGS = None
CRATE_CC_NO_DEFAULTS = None
DEBUG = Some("false")
CARGO_CFG_TARGET_FEATURE = Some("fxsr,sse,sse2,sse3,ssse3")
running: "cc" "-O3" "-ffunction-sections" "-fdata-sections" "-fPIC" "-m64" "-I" "vendor/tree-sitter-rust/src" "-Wall" "-Wextra" "-o" "/Users/vincent/repos/ul/kak-tree/target/release/build/kak-tree-73953501e48e9377/out/vendor/tree-sitter-rust/src/parser.o" "-c" "vendor/tree-sitter-rust/src/parser.c"
cargo:warning=clang: error: no such file or directory: 'vendor/tree-sitter-rust/src/parser.c'
cargo:warning=clang: error: no input files
exit code: 1
--- stderr
error occurred: Command "cc" "-O3" "-ffunction-sections" "-fdata-sections" "-fPIC" "-m64" "-I" "vendor/tree-sitter-rust/src" "-Wall" "-Wextra" "-o" "/Users/vincent/repos/ul/kak-tree/target/release/build/kak-tree-73953501e48e9377/out/vendor/tree-sitter-rust/src/parser.o" "-c" "vendor/tree-sitter-rust/src/parser.c" with args "cc" did not execute successfully (status code exit code: 1).
warning: build failed, waiting for other jobs to finish...
error: failed to compile `kak-tree v0.1.0 (/Users/vincent/repos/ul/kak-tree)`, intermediate artifacts can be found at `/Users/vincent/repos/ul/kak-tree/target`
Caused by:
build failed
cargo -V
cargo 1.39.0 (1c6ec66d5 2019-09-30)
Sorry for the vague title, but I really do not get a clue about why, I'm loading the rc file generated when you build kak-tree with the source command, also tried in autoloads, I built it with javascript, ruby and clojure, when I check with the --do-you-understand command those languages I indeed get the 0 code return, but inside kakoune when I run tree-node-sexp I get just nothing, I also copied the config file on the readme, I'm not getting errors in the debug buffer or anything.
Maybe I forgot to do something?
I just compiled from master with rustc 1.39.0 (4560ea788 2019-11-04)
with command:
cargo install --path . --force --features "rust go"
and got following panic:
thread 'main' panicked at 'called `Result::unwrap()` on an `Err` value: "Incompatible language version 11. Expected 10."', src/libcore/result.rs:1165:5
stack backtrace:
0: <std::sys_common::backtrace::_print::DisplayBacktrace as core::fmt::Display>::fmt
1: core::fmt::write
2: std::io::Write::write_fmt
3: std::panicking::default_hook::{{closure}}
4: std::panicking::default_hook
5: std::panicking::rust_panic_with_hook
6: std::panicking::continue_panic_fmt
7: rust_begin_unwind
8: core::panicking::panic_fmt
9: core::result::unwrap_failed
10: kak_tree::main
11: std::rt::lang_start::{{closure}}
12: std::panicking::try::do_call
13: __rust_maybe_catch_panic
14: std::rt::lang_start_internal
15: main
note: Some details are omitted, run with `RUST_BACKTRACE=full` for a verbose backtrace.
Raw Kakoune has commands to add and move selections through the file's linear structure, like h
and C
and ]p
.
kak-tree has commands to add and move selections through the file's hierarchical structure, like tree-select-node
and tree-select-prev-node
and tree-select-children
.
Raw Kakoune also has commands to sub-select and filter selections based on the file's linear structure, like s
and k
.
kak-tree should have commands to sub-select and filter selections based on the file's hierarchical structure:
tree-select-nodes KIND
selects all the KIND nodes wholly contained within an existing selectiontree-split-nodes KIND
slices the KIND nodes out of existing selections
tree-keep-matching KIND
discards selections that do not wholly contain at least one KIND nodetree-kill-matching KIND
discards selections that do wholly contain at least one KIND nodeIdeally, these commands should use -shell-script-candidates
to let Kakoune auto-complete the possible kinds for the current file.
There's possible extension here for kind-paths, like arguments/string_literal
to only select string_literal
s directly inside an arguments
or /arguments//string_literal
to select string_literal
s anywhere inside whichever selections exactly cover an arguments
, but that's all polish and future extension work.
Hi, I wanted to explore what parts of the buffer the different navigation functions span in an interactive and dynamic way so I wrote this script. Wasn't sure where to post it so posting it here in case someone finds it interesting:
try %{
decl range-specs tree_first
decl range-specs tree_next
decl range-specs tree_prev
decl range-specs tree_parent
decl range-specs tree_children
}
def dyntree %{
rmhooks window tree
try %{
addhl window/ ranges tree_children
addhl window/ ranges tree_first
addhl window/ ranges tree_prev
addhl window/ ranges tree_next
addhl window/ ranges tree_parent
}
hook -group tree window NormalIdle .* %{
set window tree_children %val{timestamp}
set window tree_first %val{timestamp}
set window tree_prev %val{timestamp}
set window tree_next %val{timestamp}
set window tree_parent %val{timestamp}
eval -draft -itersel %{ try %{
tree-select-next-node
set -add window tree_next "%val{selection_desc}|default+b"
}}
eval -draft -itersel %{ try %{
tree-select-previous-node
set -add window tree_prev "%val{selection_desc}|default+i"
}}
eval -draft -itersel %{ try %{
tree-select-parent-node
set -add window tree_parent "%val{selection_desc}|default,rgb:333333"
}}
eval -draft -itersel %{ try %{
tree-select-children
eval -draft -itersel %{
set -add window tree_children "%val{selection_desc}|default+u"
}
}}
eval -draft -itersel %{ try %{
tree-select-first
set -add window tree_first "%val{selection_desc}|default,red"
}}
}
}
It looks like there's a linker error when building with Clojure support, not sure if the issue is on the kak-tree end or with tree-sitter-clojure. Building with any language other than Clojure works fine.
Installing kak-tree v0.1.0 (/tmp/kak-tree)
Updating crates.io index
Compiling libc v0.2.93
Compiling autocfg v1.0.1
Compiling proc-macro2 v1.0.26
Compiling unicode-xid v0.2.1
Compiling cfg-if v1.0.0
Compiling syn v1.0.69
Compiling slog v2.7.0
Compiling serde_derive v1.0.125
Compiling memchr v2.3.4
Compiling serde v1.0.125
Compiling lazy_static v1.4.0
Compiling log v0.4.14
Compiling crc32fast v1.2.1
Compiling regex-syntax v0.6.23
Compiling ryu v1.0.5
Compiling once_cell v1.7.2
Compiling arc-swap v1.2.0
Compiling serde_json v1.0.64
Compiling bitflags v1.2.1
Compiling take_mut v0.2.2
Compiling rle-decode-fast v1.0.1
Compiling itoa v0.4.7
Compiling crossbeam v0.2.12
Compiling adler32 v1.2.0
Compiling unicode-width v0.1.8
Compiling vec_map v0.8.2
Compiling either v1.6.1
Compiling ansi_term v0.11.0
Compiling strsim v0.8.0
Compiling num-traits v0.2.14
Compiling num-integer v0.1.44
Compiling crossbeam-utils v0.8.3
Compiling thread_local v1.1.3
Compiling textwrap v0.11.0
Compiling itertools v0.8.2
Compiling aho-corasick v0.7.15
Compiling slog-scope v4.4.0
Compiling quote v1.0.9
Compiling dirs-sys-next v0.1.2
Compiling time v0.1.43
Compiling atty v0.2.14
Compiling log v0.3.9
Compiling jobserver v0.1.21
Compiling libflate v0.1.27
Compiling dirs-next v2.0.0
Compiling clap v2.33.3
Compiling slog-stdlog v3.0.5
Compiling crossbeam-channel v0.5.0
Compiling regex v1.4.5
Compiling cc v1.0.67
Compiling term v0.7.0
Compiling slog-async v2.6.0
Compiling slog-kvfilter v0.7.0
Compiling chrono v0.4.19
Compiling tree-sitter v0.6.3
Compiling kak-tree v0.1.0 (/tmp/kak-tree)
Compiling trackable_derive v1.0.0
Compiling slog-term v2.8.0
Compiling trackable v1.2.0
Compiling trackable v0.2.24
warning: In file included from vendor/tree-sitter-rust/src/parser.c:1:
warning: vendor/tree-sitter-rust/src/parser.c: In function ‘ts_lex_keywords’:
warning: vendor/tree-sitter-rust/src/tree_sitter/parser.h:131:8: warning: variable ‘eof’ set but not used [-Wunused-but-set-variable]
warning: 131 | bool eof = false; \
warning: | ^~~
warning: vendor/tree-sitter-rust/src/parser.c:4786:3: note: in expansion of macro ‘START_LEXER’
warning: 4786 | START_LEXER();
warning: | ^~~~~~~~~~~
warning: vendor/tree-sitter-rust/src/scanner.c: In function ‘tree_sitter_rust_external_scanner_destroy’:
warning: vendor/tree-sitter-rust/src/scanner.c:12:54: warning: unused parameter ‘p’ [-Wunused-parameter]
warning: 12 | void tree_sitter_rust_external_scanner_destroy(void *p) {}
warning: | ~~~~~~^
warning: vendor/tree-sitter-rust/src/scanner.c: In function ‘tree_sitter_rust_external_scanner_reset’:
warning: vendor/tree-sitter-rust/src/scanner.c:13:52: warning: unused parameter ‘p’ [-Wunused-parameter]
warning: 13 | void tree_sitter_rust_external_scanner_reset(void *p) {}
warning: | ~~~~~~^
warning: vendor/tree-sitter-rust/src/scanner.c: In function ‘tree_sitter_rust_external_scanner_serialize’:
warning: vendor/tree-sitter-rust/src/scanner.c:14:60: warning: unused parameter ‘p’ [-Wunused-parameter]
warning: 14 | unsigned tree_sitter_rust_external_scanner_serialize(void *p, char *buffer) { return 0; }
warning: | ~~~~~~^
warning: vendor/tree-sitter-rust/src/scanner.c:14:69: warning: unused parameter ‘buffer’ [-Wunused-parameter]
warning: 14 | unsigned tree_sitter_rust_external_scanner_serialize(void *p, char *buffer) { return 0; }
warning: | ~~~~~~^~~~~~
warning: vendor/tree-sitter-rust/src/scanner.c: In function ‘tree_sitter_rust_external_scanner_deserialize’:
warning: vendor/tree-sitter-rust/src/scanner.c:15:58: warning: unused parameter ‘p’ [-Wunused-parameter]
warning: 15 | void tree_sitter_rust_external_scanner_deserialize(void *p, const char *b, unsigned n) {}
warning: | ~~~~~~^
warning: vendor/tree-sitter-rust/src/scanner.c:15:73: warning: unused parameter ‘b’ [-Wunused-parameter]
warning: 15 | void tree_sitter_rust_external_scanner_deserialize(void *p, const char *b, unsigned n) {}
warning: | ~~~~~~~~~~~~^
warning: vendor/tree-sitter-rust/src/scanner.c:15:85: warning: unused parameter ‘n’ [-Wunused-parameter]
warning: 15 | void tree_sitter_rust_external_scanner_deserialize(void *p, const char *b, unsigned n) {}
warning: | ~~~~~~~~~^
warning: vendor/tree-sitter-rust/src/scanner.c: In function ‘tree_sitter_rust_external_scanner_scan’:
warning: vendor/tree-sitter-rust/src/scanner.c:25:51: warning: unused parameter ‘payload’ [-Wunused-parameter]
warning: 25 | bool tree_sitter_rust_external_scanner_scan(void *payload, TSLexer *lexer,
warning: | ~~~~~~^~~~~~~
Compiling sloggers v0.3.6
Compiling toml v0.5.8
error: linking with `cc` failed: exit code: 1
|
= note: "cc" "-Wl,--as-needed" "-Wl,-z,noexecstack" "-m64" "-Wl,--eh-frame-hdr" "-L" "/home/adrusi/.rustup/toolchains/stable-x86_64-unknown-linux-gnu/lib/rustlib/x86_64-unknown-linux-gnu/lib" "/tmp/kak-tree/target/release/deps/kak_tree-236aa2289bc214bd.kak_tree.athnaazl-cgu.0.rcgu.o" "/tmp/kak-tree/target/release/deps/kak_tree-236aa2289bc214bd.kak_tree.athnaazl-cgu.1.rcgu.o" "/tmp/kak-tree/target/release/deps/kak_tree-236aa2289bc214bd.kak_tree.athnaazl-cgu.10.rcgu.o" "/tmp/kak-tree/target/release/deps/kak_tree-236aa2289bc214bd.kak_tree.athnaazl-cgu.11.rcgu.o" "/tmp/kak-tree/target/release/deps/kak_tree-236aa2289bc214bd.kak_tree.athnaazl-cgu.12.rcgu.o" "/tmp/kak-tree/target/release/deps/kak_tree-236aa2289bc214bd.kak_tree.athnaazl-cgu.13.rcgu.o" "/tmp/kak-tree/target/release/deps/kak_tree-236aa2289bc214bd.kak_tree.athnaazl-cgu.14.rcgu.o" "/tmp/kak-tree/target/release/deps/kak_tree-236aa2289bc214bd.kak_tree.athnaazl-cgu.15.rcgu.o" "/tmp/kak-tree/target/release/deps/kak_tree-236aa2289bc214bd.kak_tree.athnaazl-cgu.2.rcgu.o" "/tmp/kak-tree/target/release/deps/kak_tree-236aa2289bc214bd.kak_tree.athnaazl-cgu.3.rcgu.o" "/tmp/kak-tree/target/release/deps/kak_tree-236aa2289bc214bd.kak_tree.athnaazl-cgu.4.rcgu.o" "/tmp/kak-tree/target/release/deps/kak_tree-236aa2289bc214bd.kak_tree.athnaazl-cgu.5.rcgu.o" "/tmp/kak-tree/target/release/deps/kak_tree-236aa2289bc214bd.kak_tree.athnaazl-cgu.6.rcgu.o" "/tmp/kak-tree/target/release/deps/kak_tree-236aa2289bc214bd.kak_tree.athnaazl-cgu.7.rcgu.o" "/tmp/kak-tree/target/release/deps/kak_tree-236aa2289bc214bd.kak_tree.athnaazl-cgu.8.rcgu.o" "/tmp/kak-tree/target/release/deps/kak_tree-236aa2289bc214bd.kak_tree.athnaazl-cgu.9.rcgu.o" "-o" "/tmp/kak-tree/target/release/deps/kak_tree-236aa2289bc214bd" "/tmp/kak-tree/target/release/deps/kak_tree-236aa2289bc214bd.4ofns8yp5ufdmjr5.rcgu.o" "-Wl,--gc-sections" "-pie" "-Wl,-zrelro" "-Wl,-znow" "-Wl,-O1" "-nodefaultlibs" "-L" "/tmp/kak-tree/target/release/deps" "-L" "/tmp/kak-tree/target/release/build/kak-tree-ab61f15e16d32ff4/out" "-L" "/tmp/kak-tree/target/release/build/tree-sitter-306936e9b8cc66eb/out" "-L" "/home/adrusi/.rustup/toolchains/stable-x86_64-unknown-linux-gnu/lib/rustlib/x86_64-unknown-linux-gnu/lib" "-Wl,-Bstatic" "-Wl,--whole-archive" "-ltree_sitter_rust" "-Wl,--no-whole-archive" "/tmp/kak-tree/target/release/deps/libsloggers-1eeed2c6bd9a410e.rlib" "/tmp/kak-tree/target/release/deps/libslog_stdlog-5645424089bba576.rlib" "/tmp/kak-tree/target/release/deps/liblog-cee1a2d76e2c2040.rlib" "/tmp/kak-tree/target/release/deps/liblog-3217f079d39ad321.rlib" "/tmp/kak-tree/target/release/deps/libslog_scope-27523e7d6ae9f3f5.rlib" "/tmp/kak-tree/target/release/deps/libarc_swap-efd09bc77ce54347.rlib" "/tmp/kak-tree/target/release/deps/libslog_term-4a3068b01d4c8cc6.rlib" "/tmp/kak-tree/target/release/deps/libterm-dc165d97de4583d0.rlib" "/tmp/kak-tree/target/release/deps/libdirs_next-21910acbbce7f489.rlib" "/tmp/kak-tree/target/release/deps/libdirs_sys_next-0d62cf5325636b23.rlib" "/tmp/kak-tree/target/release/deps/libslog_kvfilter-79ce97abe554b79e.rlib" "/tmp/kak-tree/target/release/deps/libslog_async-43eca4efd6a2accf.rlib" "/tmp/kak-tree/target/release/deps/libthread_local-bb811fc8ce57121e.rlib" "/tmp/kak-tree/target/release/deps/libonce_cell-21e9da22f98e7d77.rlib" "/tmp/kak-tree/target/release/deps/libcrossbeam_channel-7a2069f71f26076e.rlib" "/tmp/kak-tree/target/release/deps/libcrossbeam_utils-c62ff02066b71b37.rlib" "/tmp/kak-tree/target/release/deps/liblazy_static-49b79ac062ddc731.rlib" "/tmp/kak-tree/target/release/deps/liblibflate-a0e3b73efdde4630.rlib" "/tmp/kak-tree/target/release/deps/libtake_mut-193d4ebcb9156139.rlib" "/tmp/kak-tree/target/release/deps/librle_decode_fast-6fcf494338ada9cb.rlib" "/tmp/kak-tree/target/release/deps/libcrc32fast-274d6f6356d94d49.rlib" "/tmp/kak-tree/target/release/deps/libcfg_if-b95e3d47d2a2d145.rlib" "/tmp/kak-tree/target/release/deps/libadler32-0ee79bcb36f70fa9.rlib" "/tmp/kak-tree/target/release/deps/libchrono-302881bbca6b1abe.rlib" "/tmp/kak-tree/target/release/deps/libnum_integer-2525a9e376d5a1b6.rlib" "/tmp/kak-tree/target/release/deps/libnum_traits-bd4102865d3c8970.rlib" "/tmp/kak-tree/target/release/deps/libtime-29ac76053d9df293.rlib" "/tmp/kak-tree/target/release/deps/libtrackable-6bb424b4fbf54565.rlib" "/tmp/kak-tree/target/release/deps/libtrackable-65fbadd61b6dbd0d.rlib" "/tmp/kak-tree/target/release/deps/libslog-c0caacfe6620a2ac.rlib" "/tmp/kak-tree/target/release/deps/libitertools-e85e3838ae2fd07b.rlib" "/tmp/kak-tree/target/release/deps/libeither-a362c5c541bcdacf.rlib" "/tmp/kak-tree/target/release/deps/libtree_sitter-5db51dddabd2d7fa.rlib" "/tmp/kak-tree/target/release/deps/libserde_json-80772460659655b2.rlib" "/tmp/kak-tree/target/release/deps/libryu-3fa383024d70cfd5.rlib" "/tmp/kak-tree/target/release/deps/libitoa-8be987539cea4b1a.rlib" "/tmp/kak-tree/target/release/deps/libregex-c77882308e7405a0.rlib" "/tmp/kak-tree/target/release/deps/libregex_syntax-7ee6b1ce20264869.rlib" "/tmp/kak-tree/target/release/deps/libaho_corasick-c173c70426dfa388.rlib" "/tmp/kak-tree/target/release/deps/libmemchr-181c467024449d26.rlib" "/tmp/kak-tree/target/release/deps/libtoml-292dd52216298da8.rlib" "/tmp/kak-tree/target/release/deps/libserde-29830bcbd37a4322.rlib" "/tmp/kak-tree/target/release/deps/libclap-f4ab859b9018ac7c.rlib" "/tmp/kak-tree/target/release/deps/libvec_map-c42ec140ccfeaea4.rlib" "/tmp/kak-tree/target/release/deps/libtextwrap-62842afc18504c5d.rlib" "/tmp/kak-tree/target/release/deps/libunicode_width-3b67f6fb85ed7051.rlib" "/tmp/kak-tree/target/release/deps/libstrsim-05739d31f55d9fad.rlib" "/tmp/kak-tree/target/release/deps/libbitflags-ba348557b137d58f.rlib" "/tmp/kak-tree/target/release/deps/libatty-5172cacccb0041c5.rlib" "/tmp/kak-tree/target/release/deps/liblibc-908b86b80da34306.rlib" "/tmp/kak-tree/target/release/deps/libansi_term-441f14aa2c239a15.rlib" "-Wl,--start-group" "/home/adrusi/.rustup/toolchains/stable-x86_64-unknown-linux-gnu/lib/rustlib/x86_64-unknown-linux-gnu/lib/libstd-e12de7683a34c500.rlib" "/home/adrusi/.rustup/toolchains/stable-x86_64-unknown-linux-gnu/lib/rustlib/x86_64-unknown-linux-gnu/lib/libpanic_unwind-446a53c2e468675f.rlib" "/home/adrusi/.rustup/toolchains/stable-x86_64-unknown-linux-gnu/lib/rustlib/x86_64-unknown-linux-gnu/lib/libminiz_oxide-86fef9fb252a2d33.rlib" "/home/adrusi/.rustup/toolchains/stable-x86_64-unknown-linux-gnu/lib/rustlib/x86_64-unknown-linux-gnu/lib/libadler-3bed9bfd30304751.rlib" "/home/adrusi/.rustup/toolchains/stable-x86_64-unknown-linux-gnu/lib/rustlib/x86_64-unknown-linux-gnu/lib/libobject-0e38eeb474a7b386.rlib" "/home/adrusi/.rustup/toolchains/stable-x86_64-unknown-linux-gnu/lib/rustlib/x86_64-unknown-linux-gnu/lib/libaddr2line-a846ed547b824740.rlib" "/home/adrusi/.rustup/toolchains/stable-x86_64-unknown-linux-gnu/lib/rustlib/x86_64-unknown-linux-gnu/lib/libgimli-c9540f0a4fb9265d.rlib" "/home/adrusi/.rustup/toolchains/stable-x86_64-unknown-linux-gnu/lib/rustlib/x86_64-unknown-linux-gnu/lib/librustc_demangle-7d2ca66c92c356eb.rlib" "/home/adrusi/.rustup/toolchains/stable-x86_64-unknown-linux-gnu/lib/rustlib/x86_64-unknown-linux-gnu/lib/libhashbrown-147e2c808f949493.rlib" "/home/adrusi/.rustup/toolchains/stable-x86_64-unknown-linux-gnu/lib/rustlib/x86_64-unknown-linux-gnu/lib/librustc_std_workspace_alloc-bd2a4369506670e9.rlib" "/home/adrusi/.rustup/toolchains/stable-x86_64-unknown-linux-gnu/lib/rustlib/x86_64-unknown-linux-gnu/lib/libunwind-74bfdd0ce7d0ed48.rlib" "/home/adrusi/.rustup/toolchains/stable-x86_64-unknown-linux-gnu/lib/rustlib/x86_64-unknown-linux-gnu/lib/libcfg_if-6777f47f1c491841.rlib" "/home/adrusi/.rustup/toolchains/stable-x86_64-unknown-linux-gnu/lib/rustlib/x86_64-unknown-linux-gnu/lib/liblibc-b104f1790174f2be.rlib" "/home/adrusi/.rustup/toolchains/stable-x86_64-unknown-linux-gnu/lib/rustlib/x86_64-unknown-linux-gnu/lib/liballoc-db37898996f45c13.rlib" "/home/adrusi/.rustup/toolchains/stable-x86_64-unknown-linux-gnu/lib/rustlib/x86_64-unknown-linux-gnu/lib/librustc_std_workspace_core-25b7435131fc4938.rlib" "/home/adrusi/.rustup/toolchains/stable-x86_64-unknown-linux-gnu/lib/rustlib/x86_64-unknown-linux-gnu/lib/libcore-9d4b6f3c097e876e.rlib" "-Wl,--end-group" "/home/adrusi/.rustup/toolchains/stable-x86_64-unknown-linux-gnu/lib/rustlib/x86_64-unknown-linux-gnu/lib/libcompiler_builtins-3f953ad652ab829a.rlib" "-Wl,-Bdynamic" "-lgcc_s" "-lutil" "-lrt" "-lpthread" "-lm" "-ldl" "-lc"
= note: /usr/bin/ld: /tmp/kak-tree/target/release/deps/kak_tree-236aa2289bc214bd.kak_tree.athnaazl-cgu.5.rcgu.o: in function `kak_tree::main':
kak_tree.athnaazl-cgu.5:(.text._ZN8kak_tree4main17hc00e256c4b715222E+0x6fb): undefined reference to `tree_sitter_clojure'
/usr/bin/ld: kak_tree.athnaazl-cgu.5:(.text._ZN8kak_tree4main17hc00e256c4b715222E+0x2381): undefined reference to `tree_sitter_clojure'
collect2: error: ld returned 1 exit status
error: aborting due to previous error
The following warnings were emitted during compilation:
warning: In file included from vendor/tree-sitter-rust/src/parser.c:1:
warning: vendor/tree-sitter-rust/src/parser.c: In function ‘ts_lex_keywords’:
warning: vendor/tree-sitter-rust/src/tree_sitter/parser.h:131:8: warning: variable ‘eof’ set but not used [-Wunused-but-set-variable]
warning: 131 | bool eof = false; \
warning: | ^~~
warning: vendor/tree-sitter-rust/src/parser.c:4786:3: note: in expansion of macro ‘START_LEXER’
warning: 4786 | START_LEXER();
warning: | ^~~~~~~~~~~
warning: vendor/tree-sitter-rust/src/scanner.c: In function ‘tree_sitter_rust_external_scanner_destroy’:
warning: vendor/tree-sitter-rust/src/scanner.c:12:54: warning: unused parameter ‘p’ [-Wunused-parameter]
warning: 12 | void tree_sitter_rust_external_scanner_destroy(void *p) {}
warning: | ~~~~~~^
warning: vendor/tree-sitter-rust/src/scanner.c: In function ‘tree_sitter_rust_external_scanner_reset’:
warning: vendor/tree-sitter-rust/src/scanner.c:13:52: warning: unused parameter ‘p’ [-Wunused-parameter]
warning: 13 | void tree_sitter_rust_external_scanner_reset(void *p) {}
warning: | ~~~~~~^
warning: vendor/tree-sitter-rust/src/scanner.c: In function ‘tree_sitter_rust_external_scanner_serialize’:
warning: vendor/tree-sitter-rust/src/scanner.c:14:60: warning: unused parameter ‘p’ [-Wunused-parameter]
warning: 14 | unsigned tree_sitter_rust_external_scanner_serialize(void *p, char *buffer) { return 0; }
warning: | ~~~~~~^
warning: vendor/tree-sitter-rust/src/scanner.c:14:69: warning: unused parameter ‘buffer’ [-Wunused-parameter]
warning: 14 | unsigned tree_sitter_rust_external_scanner_serialize(void *p, char *buffer) { return 0; }
warning: | ~~~~~~^~~~~~
warning: vendor/tree-sitter-rust/src/scanner.c: In function ‘tree_sitter_rust_external_scanner_deserialize’:
warning: vendor/tree-sitter-rust/src/scanner.c:15:58: warning: unused parameter ‘p’ [-Wunused-parameter]
warning: 15 | void tree_sitter_rust_external_scanner_deserialize(void *p, const char *b, unsigned n) {}
warning: | ~~~~~~^
warning: vendor/tree-sitter-rust/src/scanner.c:15:73: warning: unused parameter ‘b’ [-Wunused-parameter]
warning: 15 | void tree_sitter_rust_external_scanner_deserialize(void *p, const char *b, unsigned n) {}
warning: | ~~~~~~~~~~~~^
warning: vendor/tree-sitter-rust/src/scanner.c:15:85: warning: unused parameter ‘n’ [-Wunused-parameter]
warning: 15 | void tree_sitter_rust_external_scanner_deserialize(void *p, const char *b, unsigned n) {}
warning: | ~~~~~~~~~^
warning: vendor/tree-sitter-rust/src/scanner.c: In function ‘tree_sitter_rust_external_scanner_scan’:
warning: vendor/tree-sitter-rust/src/scanner.c:25:51: warning: unused parameter ‘payload’ [-Wunused-parameter]
warning: 25 | bool tree_sitter_rust_external_scanner_scan(void *payload, TSLexer *lexer,
warning: | ~~~~~~^~~~~~~
error: failed to compile `kak-tree v0.1.0 (/tmp/kak-tree)`, intermediate artifacts can be found at `/tmp/kak-tree/target`
Caused by:
could not compile `kak-tree`
To learn more, run the command again with --verbose.
Hi ul, I'm a bit puzzled why the python tree sitter does not go from expressions to statements. In the code below the parent nodes of the ones become 1 + 1
but the parent for that is not return 1 + 1
.
def test():
return 1 + 1
I am expecting return 1 + 1
to be the parent of 1 + 1
, but right now nothing happens with tree-select-parent-node
.
Could you help me to solve a compilation problem.
$ cargo install --path . --force --features "python"
Installing kak-tree v0.1.0 (/home/user/kak-tree)
Updating crates.io index
warning: In file included from vendor/tree-sitter-python/src/parser.c:1:
warning: vendor/tree-sitter-python/src/parser.c: In function ‘ts_lex_keywords’:
warning: vendor/tree-sitter-python/src/tree_sitter/parser.h:131:8: warning: variable ‘eof’ set but not used [-Wunused-but-set-variable]
warning: 131 | bool eof = false; \
warning: | ^~~
warning: vendor/tree-sitter-python/src/parser.c:2803:3: note: in expansion of macro ‘START_LEXER’
warning: 2803 | START_LEXER();
warning: | ^~~~~~~~~~~
warning: vendor/tree-sitter-rust/src/scanner.c: In function ‘tree_sitter_rust_external_scanner_destroy’:
warning: vendor/tree-sitter-rust/src/scanner.c:12:54: warning: unused parameter ‘p’ [-Wunused-parameter]
warning: 12 | void tree_sitter_rust_external_scanner_destroy(void *p) {}
warning: | ~~~~~~^
warning: vendor/tree-sitter-rust/src/scanner.c: In function ‘tree_sitter_rust_external_scanner_reset’:
warning: vendor/tree-sitter-rust/src/scanner.c:13:52: warning: unused parameter ‘p’ [-Wunused-parameter]
warning: 13 | void tree_sitter_rust_external_scanner_reset(void *p) {}
warning: | ~~~~~~^
warning: vendor/tree-sitter-rust/src/scanner.c: In function ‘tree_sitter_rust_external_scanner_serialize’:
warning: vendor/tree-sitter-rust/src/scanner.c:14:60: warning: unused parameter ‘p’ [-Wunused-parameter]
warning: 14 | unsigned tree_sitter_rust_external_scanner_serialize(void *p, char *buffer) { return 0; }
warning: | ~~~~~~^
warning: vendor/tree-sitter-rust/src/scanner.c:14:69: warning: unused parameter ‘buffer’ [-Wunused-parameter]
warning: 14 | unsigned tree_sitter_rust_external_scanner_serialize(void *p, char *buffer) { return 0; }
warning: | ~~~~~~^~~~~~
warning: vendor/tree-sitter-rust/src/scanner.c: In function ‘tree_sitter_rust_external_scanner_deserialize’:
warning: vendor/tree-sitter-rust/src/scanner.c:15:58: warning: unused parameter ‘p’ [-Wunused-parameter]
warning: 15 | void tree_sitter_rust_external_scanner_deserialize(void *p, const char *b, unsigned n) {}
warning: | ~~~~~~^
warning: vendor/tree-sitter-rust/src/scanner.c:15:73: warning: unused parameter ‘b’ [-Wunused-parameter]
warning: 15 | void tree_sitter_rust_external_scanner_deserialize(void *p, const char *b, unsigned n) {}
warning: | ~~~~~~~~~~~~^
warning: vendor/tree-sitter-rust/src/scanner.c:15:85: warning: unused parameter ‘n’ [-Wunused-parameter]
warning: 15 | void tree_sitter_rust_external_scanner_deserialize(void *p, const char *b, unsigned n) {}
warning: | ~~~~~~~~~^
warning: vendor/tree-sitter-rust/src/scanner.c: In function ‘tree_sitter_rust_external_scanner_scan’:
warning: vendor/tree-sitter-rust/src/scanner.c:25:51: warning: unused parameter ‘payload’ [-Wunused-parameter]
warning: 25 | bool tree_sitter_rust_external_scanner_scan(void *payload, TSLexer *lexer,
warning: | ~~~~~~^~~~~~~
warning: In file included from vendor/tree-sitter-rust/src/parser.c:1:
warning: vendor/tree-sitter-rust/src/parser.c: In function ‘ts_lex_keywords’:
warning: vendor/tree-sitter-rust/src/tree_sitter/parser.h:131:8: warning: variable ‘eof’ set but not used [-Wunused-but-set-variable]
warning: 131 | bool eof = false; \
warning: | ^~~
warning: vendor/tree-sitter-rust/src/parser.c:4786:3: note: in expansion of macro ‘START_LEXER’
warning: 4786 | START_LEXER();
warning: | ^~~~~~~~~~~
Compiling kak-tree v0.1.0 (/home/user/kak-tree)
error: linking with `cc` failed: exit status: 1
Not sure if it's kak-tree issue , probably of tree-sitter-python
hello! Thanks for this lovely plugin!
I wonder if you're open to adding other languages, and what your standards of completeness are for them? Specifically I'm thinking about https://github.com/Razzeee/tree-sitter-elm, which http://tree-sitter.github.io/tree-sitter/ says is "fairly complete."
If it's super easy for you to add, would you mind? Otherwise, I'm happy to submit a patch but I'll be a bit. 😄
I'm using rust 1.33.0-nightly.
When I do cargo build --release --features "bash c cpp julia php python rust"
I get a binary in ./target/release
that works with all those languages.
However, if I run cargo install --path .
the installed binary and the binary in ./target/release
only work for rust. Note that I cannot simply run cargo install
in this version of rust because of
error: Using `cargo install` to install the binaries for the package in current working directory is no longer supported, use `cargo install --path .` instead. Use `cargo build` if you want to simply build the package.
This might be an issue with a newer rust version.
Hi!
kak-tree
is panicking when trying to set the language (in this current case, to Rust, but it also happens for any other language I've tested) with the following message:
thread 'main' panicked at src/main.rs:88:35:
called `Result::unwrap()` on an `Err` value: LanguageError { version: 13 }
You can reproduce it by building kak-tree
using the instructions on README and only the Rust language as a feature (cargo install --path . --force --features rust
), then running any plugin's command (e.g. tree-node-sexp
).
Rust version: 1.76
on Linux. But I'm sure it has happen for a while, since I tried it several times in the last year.
I've edited the code to print the debug information of the language
variable, and it shows: Language(0x000055955bd6fa40)
. Not sure if it can be useful.
Hello
I was surprised not to find kak-tree on http://kakoune.org/plugins.html
Could you add the kakoune
and plugin
GitHub topics so it can be list there?
Thanks.
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.