aboutsummaryrefslogtreecommitdiff
path: root/src/nvim/lua/treesitter.c
diff options
context:
space:
mode:
authorBjörn Linse <bjorn.linse@gmail.com>2020-01-25 13:43:41 +0100
committerBjörn Linse <bjorn.linse@gmail.com>2020-02-07 09:22:55 +0100
commit00c57c98dfb2df58875a3d9ad8fc557ec9a24cba (patch)
tree15541520aa60732b476fa14f87f0d0b123d995c6 /src/nvim/lua/treesitter.c
parent64807303df34318c075a6c9ba1e9ee350135748f (diff)
downloadrneovim-00c57c98dfb2df58875a3d9ad8fc557ec9a24cba.tar.gz
rneovim-00c57c98dfb2df58875a3d9ad8fc557ec9a24cba.tar.bz2
rneovim-00c57c98dfb2df58875a3d9ad8fc557ec9a24cba.zip
treesitter: add standard &rtp/parser/ search path for parsers
Diffstat (limited to 'src/nvim/lua/treesitter.c')
-rw-r--r--src/nvim/lua/treesitter.c9
1 files changed, 8 insertions, 1 deletions
diff --git a/src/nvim/lua/treesitter.c b/src/nvim/lua/treesitter.c
index 874fabd89f..a420f79ffd 100644
--- a/src/nvim/lua/treesitter.c
+++ b/src/nvim/lua/treesitter.c
@@ -119,7 +119,14 @@ void tslua_init(lua_State *L)
build_meta(L, "treesitter_querycursor", querycursor_meta);
}
-int tslua_register_lang(lua_State *L)
+int tslua_has_language(lua_State *L)
+{
+ const char *lang_name = luaL_checkstring(L, 1);
+ lua_pushboolean(L, pmap_has(cstr_t)(langs, lang_name));
+ return 1;
+}
+
+int tslua_add_language(lua_State *L)
{
if (lua_gettop(L) < 2 || !lua_isstring(L, 1) || !lua_isstring(L, 2)) {
return luaL_error(L, "string expected");