Repository: vscode
Issue: Code Actions - Fix All Support
Labels: feature-request,editor-code-actions

Filed by @akhera99

### Problem
Currently, there is no Fix All support for code actions in LSP and vscode. This is an integral part of the code action experience in Visual Studio. Omnisharp gets around this issue by creating separate commands that offers fixes at the document, project, and solution scope for fixes available in the current open document. 
While this is a possible workaround, we already have the systems in place to provide the Fix All and it would be more inline with the VS experience.

### Proposal
We would need a vscode UI experience for fix-all.

Here is the experience in Visual Studio:
<img width="1253" alt="image" src="https://github.com/microsoft/vscode-internalbacklog/assets/40616383/99865881-38f3-4ae3-a3fe-4b27e4d9b5c8">

We would like a similar experience in vscode.

#### Possible Design
We would need a property added to the LSP spec for [CodeAction ](https://microsoft.github.io/language-server-protocol/specifications/lsp/3.17/specification/#codeAction)to have an optional ```FixAllScope[]``` property that indicates what scope that code action is available for.
```FixAllScope``` would look something like so:
```csharp
export namespace FixAllScope
{
      export const Document = 1;
      export const Project = 2;
      export const Solution = 3;
}
```

We would also need to create a new request.

_Request_
method: codeAction/fixAll
params: ```FixAllCodeAction```

where ```FixAllCodeAction``` might look something like:
```csharp
export interface FixAllCodeAction
{
      codeAction: CodeAction;
      scope: FixAllScope;
}
```

_Response_
result: ```CodeAction``` or ```FixAllCodeAction``` or an entirely different type, ```FixAllCodeActionResponse```

```csharp
export interface FixAllCodeActionResponse
{
      edit?: WorkspaceEdit;
      command?: Command;
}
```

### Discussed Design Possibilities

1. Using the CodeActionResolve to handle the Fix All support.
    This does not seem possible since we would not have knowledge of the selected ```FixAllScope``` with just the ```CodeAction```.

2. Having the Fix All code actions be separate entities entirely (i.e. having a ```DocumentCodeAction```, ```SolutionCodeAction```, etc.)
    This seems like it would be difficult on the client side to collapse code actions of the same type so that there aren't code 
    actions for the same item and different scopes clogging up the list.
    
Here is also an image displaying what having Fix All support would currently look like in the Code Actions list:
<img width="640" alt="image" src="https://github.com/microsoft/vscode-internalbacklog/assets/40616383/de7512db-cdcc-4d1f-b680-b29b5429aef4">

As you can see, it fills the list with superfluous code actions that could be condensed. This is a limited case as well, in a spot where there are even _more_ actions available, the list could be exponentially longer.

Here is an example with an extra lengthy code action list -- one where you would need to scroll to see all of the available options:
<img width="676" alt="image" src="https://github.com/microsoft/vscode-internalbacklog/assets/40616383/9b6f351d-a9ef-4b39-9a69-04487c662028">
The annotated portion only shows the code actions available for a singular diagnostic ID. You need to scroll down to see all of the options for the other major code action, which is underlined.

@dibarbet @isidorn