Closed nexxai closed 2 months ago
Had the same issue and I found a quick fix for now.
Looks like there was a commit to nvim-treesitter that changed the way things are parsed (https://github.com/nvim-treesitter/nvim-treesitter/commit/4e21361e15b1d4147830c5fe571556eb1b14e6f9)
You can force nvim-treesitter to use the commit before the failing one (https://github.com/nvim-treesitter/nvim-treesitter/commit/c579d186bec0a4af9d0741b235cfa0627ffd9f15) which should at least get you running tests again.
I'm using LazyVim, but you should get the idea:
return {
"nvim-treesitter/nvim-treesitter",
commit = "c579d186bec0a4af9d0741b235cfa0627ffd9f15",
...
}
@noreason You are a lifesaver, thank you.
@V13Axel Any chance you could dig into why this update with treesitter is causing a problem?
Oh, interesting! Thanks @noreason for digging into that, I hadn't gotten a chance to yet.
I'll try to make some time this evening to look a bit closer into what's going on with it - The only thing this adapter does with tree-sitter is a query to discover positions, through neotest.lib
.
First thought is maybe something changed with how that query gets run.
Oh ... I took the minute or two just now to go look at the tree-sitter changelog and I bet I just need to update the query to change string_value
to string_content
, to match the tree-sitter change.
Tried to spend some time this evening on it, but my area was hit by really bad storms today and both power and Internet have been out since. I'll be looking into it a bit closer as soon as things are restored.
Tried to spend some time this evening on it, but my area was hit by really bad storms today and both power and Internet have been out since. I'll be looking into it a bit closer as soon as things are restored.
Ah man, hope everything is good!
Went ahead and tested the change and it did work, so I just opened a PR to help save you some time. Hope it helps.
I appreciate the concern, we're all ok on this end. Still waiting for Internet to come back on, but I'm able to get some things done via cell connection at the moment.
When testing the change locally, in a Laravel project running in sail
, it appears like it worked... until I try to do anything with it.
The summary window shows only filenames (no tests), and when I try to do anything involving specific tests (such as calling require('neotest').run.run()
or even just using i
to 'navigate to' one of the files in the summary view), I get a segfault that just crashes neovim immediately. Very confusing.
However, the adapter worked perfectly with the change when trying to run it in this repository and in a fresh app running in sail
... So at this point I'm convinced the segfault is my fault and the PR is good to go. ¯\_(ツ)_/¯
Yep, update for anyone curious or discovering this thread by hitting the same issue: Discovered that segfault is unrelated, and specifically has to do with treesitter injections via heredocs.
Typing out this content in a fresh PHP file is enough to segfault neovim for me as of the update:
<?php
$someContent = <<<HTML
HTML
After some searching, it appears to be an upstream issue with tree-sitter, according to https://github.com/nvim-treesitter/nvim-treesitter/issues/6573
I love this community. Thanks both of you for figuring this out so quickly! ❤️
Ok last update before I move on, I kept digging and found out the crashes I mentioend are definitely caused by tree-sitter: https://github.com/tree-sitter/tree-sitter-php/issues/238
Ok, I'm still fairly new to Neovim so I'm not sure how to provide more details but happy to give anything that's missing here if you can explain how, but the gist of the situation is: I just started working on some PHP this evening (I haven't in maybe a week or two?) and when I went to run my usual keymap, Neotest does not run (at least visibly) but something happens in the background that Neovim ends up absolutely dog slow for about 30 seconds.
I'm not sure what could have happened and I definitely haven't been messing with my Neovim config for at least a month so aside from updating my plugins, I'm not sure what I could have done to break things.
I'm running Neovim 0.9.5 and here is the output from
:checkhealth
. Nothing about it seems odd, but there's also nothing aboutneotest
in there so I'm not sure if that should alarming.This is my loading of neotest, maybe there's something obvious there, but I haven't changed anything in here in months.
If anyone could give me a hand, I would greatly appreciate it.