Exuberant Ctags with R

前端 未结 6 826
北荒
北荒 2021-02-05 07:54

Is there any documented use of ctags with R? Would this be useful? Would it be difficult to implement?

Specifically, I\'ve just started using Vim. It would be cool to be

6条回答
  •  轻奢々
    轻奢々 (楼主)
    2021-02-05 08:17

    Universal-ctags has an R parser.

    $ cat input.r
    add <- function (x, y) {
        3 -> z
        return(x + y + z)
    }
    add (3, 4)
    $ ./ctags --quiet --options=NONE -o - --kinds-R='*' --fields=+S input.r
    add input.r /^add <- function (x, y) {$/;"  f   signature:(x, y)
    x   input.r /^add <- function (x, y) {$/;"  z   function:add
    y   input.r /^add <- function (x, y) {$/;"  z   function:add
    z   input.r /^    3 -> z$/;"    v   function:add
    

    In addition, the ctags implementation supports R6Class and S4Class.

提交回复
热议问题