Skip to content

insertText()'s location= argument -- is '0' a valid column number? #299

@MichaelChirico

Description

@MichaelChirico

#' \code{location} should be a (list of) \code{\link{document_position}} or

I couldn't tell from ?insertText whether 0 is valid or not. Of course I could test this with RStudio available, but I don't have it available at the moment, so it would be good to have this written out. The source code of rstudioapi::insertText() also eventually refers to a function inside an environment only available inside RStudio, so I couldn't check that either:

get(name, envir = asNamespace("rstudio"), ...)

Context: We have a conflict in {lintr} of 0 being a valid column number for lint objects, apparently to support RStudio:

r-lib/lintr#2418 (comment)

But this conflicts with SARIF format (r-lib/lintr#2550), which requires column>0. I'd like to know if the fix is to block 0 as a column number everywhere, or if we should just block it when producing SARIF output.

To answer this I tried to refer to the {rstudioapi} documentation, but to no avail.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions