Issafalcon / neotest-dotnet

Neotest adapter for dotnet
MIT License
71 stars 26 forks source link

TSParser error Invalid node type "name_equals" #101

Closed Dynge closed 4 months ago

Dynge commented 4 months ago

Hello

I am having with neotest-dotnet as it does not seem to find the tests.

I set the log level of neotest to 1 and when i try to run require"neotest".run.run() i get the following error:

~/.local/share/nvim/lazy/nvim-nio/lua/nio/control.lua:145: /usr/share/nvim/runtime/lua/vim/treesitter/query.lua:252: Query error at 32:18. Invalid node type "name_equals":
                (name_equals
                 ^

stack traceback:
        [C]: in function '_ts_parse_query'
        /usr/share/nvim/runtime/lua/vim/treesitter/query.lua:252: in function 'fn'
        /usr/share/nvim/runtime/lua/vim/func/_memoize.lua:58: in function 'parse_query'
        ...re/nvim/lazy/neotest/lua/neotest/lib/treesitter/init.lua:104: in function 'normalise_query'
        ...re/nvim/lazy/neotest/lua/neotest/lib/treesitter/init.lua:161: in function 'parse_positions_from_string'
        ...re/nvim/lazy/neotest/lua/neotest/lib/treesitter/init.lua:207: in function 'func'
        ...l/share/nvim/lazy/neotest/lua/neotest/lib/subprocess.lua:156: in function <...l/share/nvim/lazy/neotest/lua/neotest/lib/subprocess.lua:155>
        [C]: in function 'xpcall'
        ...l/share/nvim/lazy/neotest/lua/neotest/lib/subprocess.lua:155: in function <...l/share/nvim/lazy/neotest/lua/neotest/lib/subprocess.lua:154>
stack traceback:
        [C]: in function 'error'
        ...dalf/.local/share/nvim/lazy/nvim-nio/lua/nio/control.lua:145: in function 'call'
        ...re/nvim/lazy/neotest/lua/neotest/lib/treesitter/init.lua:189: in function 'parse_positions'
        ...are/nvim/lazy/neotest-dotnet/lua/neotest-dotnet/init.lua:110: in function 'discover_positions'
        ...ocal/share/nvim/lazy/neotest/lua/neotest/client/init.lua:300: in function <...ocal/share/nvim/lazy/neotest/lua/neotest/client/init.lua:264>
        [C]: in function 'xpcall'
        ...ocal/share/nvim/lazy/neotest/lua/neotest/client/init.lua:264: in function '_update_positions'
        ...ocal/share/nvim/lazy/neotest/lua/neotest/client/init.lua:317: in function <...ocal/share/nvim/lazy/neotest/lua/neotest/client/init.lua:315>

I've tried to see if there are any updates to the treesitter parser for c_sharp, but i dont seem to be missing any.

I am using NVIM v0.11.0-devand tree-sitter 0.20.8.

Can you help me fix the issue?

neubaner commented 4 months ago

@Dynge are you using xUnit? Can you check if this PR fixes your problem? https://github.com/Issafalcon/neotest-dotnet/pull/100

Dynge commented 4 months ago

I am using xunit. I will check and report back 🙂

Dynge commented 4 months ago

@Dynge are you using xUnit? Can you check if this PR fixes your problem? #100

It works perfectly! :)

Issafalcon commented 4 months ago

Thanks for raising the issue @Dynge , and thanks @neubaner for the PR. I've merged this in now so sounds like this is all resolved.