Closed jalvesaq closed 4 months ago
This pull request changes the code originally developed for omni-completion and optimizes it to interact with the Lua code. The main goal is to make it easier to eventually convert rnvimserver
into a C library for Lua. To test this pull request, please, use it along with the branch optimized of cmp-r
.
Part of cmp-r
code was converted to C and incorporated into R.nvim
.
Using
"R-nvim/R.nvim",
commit = "c0c167eddadb6b8aa41cea5f225c202d6aeac83d",
and
return {
"R-nvim/cmp-r",
branch = "optimized",
config = function()
require("cmp_r").setup({
filetypes = { "r", "rmd", "quarto" },
doc_width = 150,
})
end,
}
I am getting error when auto complete is triggered:
I added a commit to cmp-r
postponing the definition of send_to_nvimcom. It should work now.
I am now getting this:
It seems to work if I use it in a 1 liner like
lm()
But not on a piped expression.
Thanks! I can replicate the bug here. I will see what's happening.
The code supposes that the data.frame
will be in the .GlobalEnv
environment. I didn't consider the possibility of the data.frame
being from a package. Then, the rnvimserver
gets a SIGINT when trying to access a NULL GlobalEnv (because no code creating an object was sent to R yet).
The code supposes that the
data.frame
will be in the.GlobalEnv
environment. I didn't consider the possibility of thedata.frame
being from a package. Then, thernvimserver
gets a SIGINT when trying to access a NULL GlobalEnv (because no code creating an object was sent to R yet).
Good catch, if I do df <- mtcars
it works just fine.
And completion works fine now in scale_x_continuous()
This is fixing: https://github.com/R-nvim/cmp-r/issues/3
It should find data.frame
s in libraries too now.
I am still getting the same error (connection with rnvimserver was lost)
Using:
"R-nvim/R.nvim",
commit = "313f6c78ae5b8057ed5933bb1e8d90d6a258d4f0",
If I type :messages
I get
"Server" exited with status 139
Press ENTER or type command to continue
I had forgotten to increase nvimcom
version number to force the recompilation of the rnvimserver
. I increased it now.
Victory :1st_place_medal:
All good now on my side. These are really nice changes.
I think this can be merged. Good job!
Are you sure? Maybe we could use it for some time. If no bugs appear, we squash and merge it.
I am currently working on an R project using this latest commit. I think I will do it for 2-3h. I can report back and dig up in your code change there after if I can not spot something obvious.
Good! If you don't find bugs in the next couple of hours, we merge it.
I just spent 2h to extensively use the completion in the project I'm working on and no issue at all. It feels snappy and responsive!
So, we can squash and merge...
\
with \x12'
with \x13\n
with \x14