Skip to content

Allow linters to provide fix #784

@renkun-ken

Description

@renkun-ken

Some code editors (e.g. vscode) supports code actions to allow language server to provide code refactoring or fixes via the language server protocol.

In languageserver, I'm trying to support code actions like this to provide quick fixes of the lint results for many linters. However, lintr might be the best place to provide the fix along with the problem as each linter has the best knowledge of the problem it finds and how it should be resolved if possible.

Does it make sense to allow an optional a field fix in the lint result which contains a list of edits (each has a range and a new text) so that languageserver could directly transform these fixes into code actions at downstream?

The code issues found by many linters could be easy to fix and the fix is optional rather than required so that implementing fixes could be done in a progressive way.

Also see REditorSupport/languageserver#396.

Metadata

Metadata

Assignees

No one assigned

    Labels

    featurea feature request or enhancementhelp wanted ❤️we'd love your help!

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions