Skip to content

CodeAction Handlers should use Server-side known Diagnostics #4805

@fendor

Description

@fendor

In #4056, it was established that HLS should not rely on the Diagnostics provided by the client to compute possible CodeActions.

Since then, we have introduced the functions activeDiagnosticsInRangeMT and activeDiagnosticsInRange in ghcide/src/Development/IDE/Core/PluginUtils.hs and use it in some locations.

The next step is to review all occurrences of mkPluginHandler SMethod_TextDocumentCodeAction and make sure we use these instead of the Diagnostics provided by the client.

So the task is to review such handlers, use activeDiagnosticsInRangeMT or activeDiagnosticsInRange respectively and then make sure the tests still pass, as lsp-test sometimes does something weird with source ranges, leading unexpected changes in the tests.

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions