-
-
Notifications
You must be signed in to change notification settings - Fork 66
This commit adds support for R with roxygen2 annotations #217
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Conversation
Always adds @return tag. - R always returns a value, even with no return statement, and even if you call invisible(...) at the end of the function. Always adds @export tag - Export tag added because it is easier to delete a line then type "#'" as for most people I expect the single quote will autoclose
I encountered an issue with your code. I had to rename the file from R.lua to r.lua. It's also possible to write it like this if you want to keep R.lua: require('neogen').setup({
languages = {
['r'] = require('neogen.configurations.R')
}
}) |
@KevinFalzone Can you please share how you have installed / are configuring neogen? Using Lazy.nvim I have the following (using my fork for now): return {
'RufusVijayaratnam/neogen',
-- dir = vim.fn.expand("~/dev/neogen"),
config = true,
dependencies = { 'nvim-treesitter/nvim-treesitter', 'nvim-treesitter/playground' },
cmd = "Neogen",
} And this functions correctly if I open an R file an run the command #' @title
#' @description
#' @param x
#' @param y
#' @param ...
#' @return
#' @export
myfunc <- function(x, y, ...) {
return(x + y)
} |
Here is my config : lazy.lua: {
'danymat/neogen',
commit = "7528bea"
} plugins/neogen.lua: require('neogen').setup({}) For me, the problem is due to the file type, which is r and not R and the filename should be r and not R. |
Apologies for the delay, you are absolutely right. I had tested only on macOS, which brief research indicates uses a case insensitive file system. Testing on Ubuntu demonstrated the issue. I have renamed the file as suggested. |
fixes #216
Always adds 'return' tag.