Skip to content
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

[GENERAL] Linter links to the documentation #141

Open
Gotfrid opened this issue Sep 2, 2024 · 2 comments
Open

[GENERAL] Linter links to the documentation #141

Gotfrid opened this issue Sep 2, 2024 · 2 comments
Labels
enhancement New feature or request

Comments

@Gotfrid
Copy link
Member

Gotfrid commented Sep 2, 2024

Is it possible to somehow hook into the languageserver to replace lintr linnks in the "Problems" tab?

Buy default any lintr issues are leading to the lintr website, but I would very much like if box.linters issues would lead to the box.linters reference website.

Not sure if it's even possible, so just leaving it here as an idea - see the video below.

CleanShot.2024-09-02.at.11.37.23.mp4
@radbasa
Copy link
Collaborator

radbasa commented Sep 18, 2024

That would indeed be nice to have. As far as we know, {languageserver} only has public hooks for the document parser. This might be need a modification of languageserver itself.

@radbasa radbasa added the enhancement New feature or request label Sep 18, 2024
@radbasa
Copy link
Collaborator

radbasa commented Sep 19, 2024

The link to {lintr} documentation is in the following {languageserver} function

diagnostic_from_lint <- function(result, content) {
    list(
        range = diagnostic_range(result, content),
        severity = diagnostic_severity(result),
        source = "lintr",
        message = result$message,
        code = result$linter,
        codeDescription = list(
            href = sprintf("https://lintr.r-lib.org/reference/%s.html", result$linter)
        )
    )
}

https://github.com/REditorSupport/languageserver/blob/9b300181f2588462cb5a6f7ecd55fcbeb083d028/R/diagnostics.R#L51-L62

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

2 participants