microsoft / microsoft/language-server-protocol

Signal the client a refactoring failed

Open
#1,988 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

commands feature-request workspace edit
Dominant language
TypeScript
Stars
13k
Forks
1k
Avg merge
6d 1h
Merged PRs (30d)
10

Description

In my understanding of the refactorings in LSP, there is no dedicated property/notification for the server to signal the client that the refactoring failed. The server can reject a workspace/executeCommand request for example when the parameters are invalid but after that, the server must compute the edits and is expected to send a workspace/applyEdit request. However the ApplyWorkspaceEditParams type does not contain anything to report a problem that occured during the edits computation.

I'd like to have a int? code and string? message properties like in ResponseError directly on ApplyWorkspaceEditParams to describe failed or incomplete refactorings.

Note that the showMessage notification is not appropriate because the client has no info to correlate an incoming showMessage with a previously launched refactoring.

Contributor guide

No contributing guide indexed for this repository

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start by reading the ApplyWorkspaceEditParams and ResponseError definitions, then trace workspace/applyEdit, workspace/executeCommand, and showMessage in the protocol specification. Done means reaching agreement on how failed or incomplete refactorings are reported and documenting a compatible API shape for clients and servers.

Written by the indexing model from the issue text.

Assessment

Tech stack
typescript
Domain
api, backend-api-design
Issue type
Feature
Difficulty
5/5
Estimated time
Over a week
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
30/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.