From adc99b8f2b490638946d89352063d192be511df7 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?R=C3=B3n=C3=A1n=20Carrigan?= Date: Sun, 9 Oct 2022 12:44:05 +0100 Subject: [PATCH] feat(treesitter): pass string arg for position_id (#20) --- lua/neotest-go/init.lua | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/lua/neotest-go/init.lua b/lua/neotest-go/init.lua index 049cfc5..b0e8569 100644 --- a/lua/neotest-go/init.lua +++ b/lua/neotest-go/init.lua @@ -305,7 +305,7 @@ end ---@param position neotest.Position The position to return an ID for ---@param namespaces neotest.Position[] Any namespaces the position is within -local function generate_position_id(position, namespaces) +function adapter._generate_position_id(position, namespaces) local prefix = {} for _, namespace in ipairs(namespaces) do if namespace.type ~= 'file' then @@ -379,7 +379,7 @@ function adapter.discover_positions(path) return lib.treesitter.parse_positions(path, query, { require_namespaces = false, nested_tests = true, - position_id = generate_position_id, + position_id = "require('neotest-go')._generate_position_id", }) end