A RetroSearch Logo

Home - News ( United States | United Kingdom | Italy | Germany ) - Football scores

Search Query:

Showing content from https://github.com/neovim/neovim/commit/8c140be31f0d203b63e7052e698fdfe253e0b5d4 below:

expose minimum language version to lua (#17186) · neovim/neovim@8c140be · GitHub

File tree Expand file treeCollapse file tree 2 files changed

+11

-0

lines changed

Filter options

Expand file treeCollapse file tree 2 files changed

+11

-0

lines changed Original file line number Diff line number Diff line change

@@ -11,6 +11,7 @@ local parsers = {}

11 11

local M = vim.tbl_extend("error", query, language)

12 12 13 13

M.language_version = vim._ts_get_language_version()

14 +

M.minimum_language_version = vim._ts_get_minimum_language_version()

14 15 15 16

setmetatable(M, {

16 17

__index = function (t, k)

Original file line number Diff line number Diff line change

@@ -4,6 +4,7 @@

4 4

#include <lauxlib.h>

5 5

#include <lua.h>

6 6

#include <lualib.h>

7 +

#include <tree_sitter/api.h>

7 8 8 9

#include "luv/luv.h"

9 10

#include "nvim/api/private/defs.h"

@@ -1267,6 +1268,12 @@ int tslua_get_language_version(lua_State *L)

1267 1268

return 1;

1268 1269

}

1269 1270 1271 +

int tslua_get_minimum_language_version(lua_State *L)

1272 +

{

1273 +

lua_pushnumber(L, TREE_SITTER_MIN_COMPATIBLE_LANGUAGE_VERSION);

1274 +

return 1;

1275 +

}

1276 + 1270 1277

static void nlua_add_treesitter(lua_State *const lstate) FUNC_ATTR_NONNULL_ALL

1271 1278

{

1272 1279

tslua_init(lstate);

@@ -1288,6 +1295,9 @@ static void nlua_add_treesitter(lua_State *const lstate) FUNC_ATTR_NONNULL_ALL

1288 1295 1289 1296

lua_pushcfunction(lstate, tslua_get_language_version);

1290 1297

lua_setfield(lstate, -2, "_ts_get_language_version");

1298 + 1299 +

lua_pushcfunction(lstate, tslua_get_minimum_language_version);

1300 +

lua_setfield(lstate, -2, "_ts_get_minimum_language_version");

1291 1301

}

1292 1302 1293 1303

int nlua_expand_pat(expand_T *xp, char_u *pat, int *num_results, char_u ***results)

You can’t perform that action at this time.


RetroSearch is an open source project built by @garambo | Open a GitHub Issue

Search and Browse the WWW like it's 1997 | Search results from DuckDuckGo

HTML: 3.2 | Encoding: UTF-8 | Version: 0.7.4