Comments (27)
Just made a PR to treesitter
that fixes it: nvim-treesitter/nvim-treesitter-textobjects#645
from r.nvim.
Ah, yes, that did it. Thanks!
from r.nvim.
I updated my plugins and can replicate the bug. I removed R.nvim
and cmp-r
from my lazy.nvim
config and the bug remains. So, the problem seems to be with nvim-treesitter
.
from r.nvim.
I deleted the nvim-treesitter
directory (~/.local/share/nvim/lazy/nvim-treesitter
). Everything was installed again by lazy.nvim
and the error messages disappeared.
from r.nvim.
Not fixed from on my own side
from r.nvim.
better to remove some of the plugins that may be conflicting with nvim.tressitter, I remove hlargs.nvim and restarted nvim, everything is back to normal.
from r.nvim.
r-lib/tree-sitter-r#129 (comment)
from r.nvim.
after the bug report I wrote was closed, I was referred to their pined comment this
nvim-treesitter/nvim-treesitter#3092
so you may check it out also to diagnose what the issue may be
from r.nvim.
just using
"nvim-treesitter/nvim-treesitter",
commit = "173515a5d2be6e98c2996189f77ee5993620e2aa",
for now
from r.nvim.
Did you try:
- Close Neovim.
- Delete all parsers:
cd ~/.local/share/nvim/lazy
rm -rf nvim-treesitter/
- Start Neovim again.
My nvim-treesitter
config:
{
"nvim-treesitter/nvim-treesitter",
tag = nil,
branch = "master",
run = ":TSUpdate",
config = function ()
require("nvim-treesitter.configs").setup({
sync_install = true,
ensure_installed = {
"bash",
"c",
"css",
"html",
"json",
"latex",
"lua",
"markdown",
"markdown_inline",
"python",
"query",
"r",
"rnoweb",
"vim",
"vimdoc",
"yaml",
},
highlight = {
enable = true,
},
})
vim.o.foldmethod = "expr"
vim.o.foldexpr = "nvim_treesitter#foldexpr()"
vim.o.foldenable = false
end
},
from r.nvim.
Yes. I tried it and get the same error. Looks like the bug is known per discussions going on in the PR. It works for you? Have you tried to re-update all plugins after re-instslling them?
from r.nvim.
It fixed the bug here. I didn't uninstall any other plugins. I only deleted nvim-treesitter
directory and let lazy.nvim
install it again. I'm using the development version of Neovim.
from r.nvim.
I feel like I've been having some version of this issue as well. I initially fixed it, I thought, by deleting the nvim-treesitter
directory, but now I'm getting errors again. When I delete the nvim-treesitter
directory, and reinstall treesitter, I first get this error:
nvim-treesitter[r]: Error during tarball extraction.
tar (child): tree-sitter-r.tar.gz: Cannot open: No such file or directory
tar (child): Error is not recoverable: exiting now
tar: Child returned status 2
tar: Error is not recoverable: exiting now
but once I close and reopen an R file, it goes back to the previous error (and then there's no syntax highlighting):
Error detected while processing BufReadPost Autocommands for "*":
Error executing lua callback: /usr/share/nvim/runtime/filetype.lua:36: BufReadPost Autocommands for "*"..FileType Autocommands for "*": Vim(append):Error executing lua callback: /usr/share/nvim/runtime/lua/vim/treesitter/query.lua:252: Query error at 12:2
. Invalid node type "if":
(if
^
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 'fn'
/usr/share/nvim/runtime/lua/vim/func/_memoize.lua:58: in function 'get_query'
...r-textobjects/lua/nvim-treesitter/textobjects/shared.lua:99: in function 'available_textobjects'
...r-textobjects/lua/nvim-treesitter/textobjects/select.lua:173: in function 'attach'
...vim/lazy/nvim-treesitter/lua/nvim-treesitter/configs.lua:509: in function 'attach_module'
...vim/lazy/nvim-treesitter/lua/nvim-treesitter/configs.lua:532: in function 'reattach_module'
...vim/lazy/nvim-treesitter/lua/nvim-treesitter/configs.lua:133: in function <...vim/lazy/nvim-treesitter/lua/nvim-treesitter/configs.lua:132>
[C]: in function 'nvim_cmd'
/usr/share/nvim/runtime/filetype.lua:36: in function </usr/share/nvim/runtime/filetype.lua:35>
[C]: in function 'pcall'
vim/shared.lua: in function <vim/shared.lua:0>
[C]: in function '_with'
/usr/share/nvim/runtime/filetype.lua:35: in function </usr/share/nvim/runtime/filetype.lua:10>
stack traceback:
[C]: in function '_with'
/usr/share/nvim/runtime/filetype.lua:35: in function </usr/share/nvim/runtime/filetype.lua:10>
I should point out that everything was working absolutely fine until treesitter updated. Other file types also seem to be fine.
from r.nvim.
Apologies, it seems that my issue is with nvim-treesitter-textobjects
, not R.nvim
.
from r.nvim.
treesitter-r
has been updated, and it breaks nvim-treesitter
. Looks like they are working on it.
from r.nvim.
In my case, at least, disabling nvim-treesitter-textobjects
means I no longer have error messages. When following the advice here , the result of :echo nvim_get_runtime_file('queries/<lang>/*.scm', v:true)
includes subdirectories of that plugin that are not under nvim-treesitter
. Unless I'm confusing things.
from r.nvim.
How do you disable textobjects?
from r.nvim.
I either comment out the dependency within the nvim-treesitter
plugin setup, or I comment out the textobjects = { }
table. Either means that the R file loads without errors, and with syntax highlighting.
from r.nvim.
Got it! The thing is I am using textobjecsts a lot!
from r.nvim.
Oh, I'd rather not have to disable it! I just don't know whether I should report it there too. Did disabling it fix it for you too?
from r.nvim.
yes it worked, but went back to an older commit of treesitter (see above) until they fix it. See nvim-treesitter/nvim-treesitter#6774
from r.nvim.
Going back to that commit in treesitter for some reason still didn't work for me...
from r.nvim.
Are you using lazy? If so make sure you run :Lazy update
.
from r.nvim.
Fixed here:
from r.nvim.
Talked too soon....
from r.nvim.
An issue related to the tree-sitter is that when sending the following line to the R Console only x <- 1
is sent:
x <- 1; y <- 2
Although the syntax is valid, practically nobody uses semicolons in R scripts. So, I don't see fixing this issue as a priority.
from r.nvim.
Good catch. I will look at it.
from r.nvim.
Related Issues (20)
- Can't send code from R documentation to R Console HOT 1
- [`pdfviewer`] Add support for or make default: `vim.ui.open` HOT 3
- Can not get arguments completion use `devtools::load_all` of functions which are not export in NAMESPACE HOT 21
- setting object browser and console verticallly HOT 2
- Failure to build nvimcom HOT 4
- Setting pipe_keymap not working HOT 2
- Open R console in a new tmux pane HOT 23
- clear_line not working with R console in tmux HOT 5
- Possible resource to add to the wiki HOT 6
- Why build nvimcom: Nvimcom not installed HOT 6
- Issue from LSP? HOT 3
- Upcoming R version might break nvimcom HOT 7
- nvimcom fails to compile since 4f28bfd HOT 3
- Has function of `<Leader>l` and `<Leader>d` been changed? HOT 9
- In tmux RDSendLine does not work when opening a second buffer HOT 3
- Running R in a ToggleTerm HOT 4
- .Rnw does not highlight latex syntax until I do :e HOT 3
- renv is ignored when using external_term HOT 10
- R code lines incorrectly identified HOT 3
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from r.nvim.