Skip to content

combineResponses is suspicious #2559

Open
@michaelpj

Description

@michaelpj

combineResponses is suspicious in two ways:

  1. It does more than combine responses

These are important things to do, but doing them in combineResponses is definitely the wrong place. If nothing else, it means that any handlers which don't go through PluginMethod won't benefit from this logic!

I'm not sure where this stuff should live, maybe even upstream in lsp somewhere. Perhaps we could provide a conformance/compatibility handler-transformer than does this stuff...

  1. it has no way to signal errors, so does some "arbitrary" choosing

For formatting providers and custom methods, there is no way to combine responses, so it just picks the first response! IMO this isn't great: if you do end up with multiple plugins which have handlers for those methods, one of them will just not work at random. Better to signal some kind of error ("you've enabled plugins A and B which both provide formatting, please disable one of them").

cc @wz1000 who wrote most of this originally.

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions