microsoft / microsoft/language-server-protocol

Provide a flag indicating when a command as been invoked manually or automatically, to allow for better error responses

Open
#1,018 0 comments 3 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

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

Description

My servers currently returns an error if you invoke the Organize Imports command on a file that has parse errors. However if I add this command to editor.codeActionsOnSave in VS Code, this means anytime I press Save with an invalid file, I get a notification that the Organize Imports call fails.

If I change my server to return silently in this case (which we currently do for formatting), then if a user manually invokes the command, it would silently do nothing (perhaps due to an error that's not visible on-screen) and might seem like the command is not working.

It would be nice if we could tell when a command was triggered automatically so we can suppress the error response (or, if there were some guidelines to IDEs to do this automatically).

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 with the Language Server Protocol command behavior and the VS Code codeActionsOnSave scenario described in the issue. Since no file or test is named, trace the protocol specification and existing command-related tests; done means an agreed way to distinguish automatic from manual invocation.

Written by the indexing model from the issue text.

Assessment

Tech stack
vscode
Domain
api, developer-experience
Issue type
Feature
Difficulty
5/5
Estimated time
Over a week
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
32/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.