diff options
author | bfredl <bjorn.linse@gmail.com> | 2024-04-29 14:12:39 +0200 |
---|---|---|
committer | bfredl <bjorn.linse@gmail.com> | 2024-04-29 16:20:46 +0200 |
commit | 0df681a91d6b86395609e6fc40efb4d8623d72c9 (patch) | |
tree | 782be8ed4e68780c14edd9912692e1bba192545b /src/nvim/main.c | |
parent | ca432069eb6f5453acab896acdb8e0363c232629 (diff) | |
download | rneovim-0df681a91d6b86395609e6fc40efb4d8623d72c9.tar.gz rneovim-0df681a91d6b86395609e6fc40efb4d8623d72c9.tar.bz2 rneovim-0df681a91d6b86395609e6fc40efb4d8623d72c9.zip |
fix(treesitter): make tests for memoize more robust
Instead of painfully messing with timing to determine if queries were
reparsed, we can simply keep a counter next to the call to ts_query_new
Also memoization had a hidden dependency on the garbage collection of
the the key, a hash value which never is kept around in memory. this was
done intentionally as the hash does not capture all relevant state for the
query (external included files) even if actual query objects still
would be reachable in memory. To make the test fully deterministic in
CI, we explicitly control GC.
Diffstat (limited to 'src/nvim/main.c')
-rw-r--r-- | src/nvim/main.c | 1 |
1 files changed, 1 insertions, 0 deletions
diff --git a/src/nvim/main.c b/src/nvim/main.c index e2a3d32984..30b6b6e86b 100644 --- a/src/nvim/main.c +++ b/src/nvim/main.c @@ -63,6 +63,7 @@ #include "nvim/log.h" #include "nvim/lua/executor.h" #include "nvim/lua/secure.h" +#include "nvim/lua/treesitter.h" #include "nvim/macros_defs.h" #include "nvim/main.h" #include "nvim/mark.h" |