Simpler quick fix API #46249
Labels
API
Relates to the public API for TypeScript
Domain: TSServer
Issues related to the TSServer
In Discussion
Not yet reached consensus
Rescheduled
This issue was previously scheduled to an earlier milestone
Suggestion
An idea for TypeScript
VS Code Priority
Critical issues that VS Code needs fixed in the current TypeScript milestone
Milestone
Follow up on #27614
Search terms
getCodeFixes
getSupportedCodeFixes
Problem
The
getCodeFixes
API currently takes a range plus a diagnostic code. Currently, the range we pass to it has to match the range of the diagnostic we are trying to fix. This API is difficult for editors to implement for a few reasons:Proposal
We should consider a new quick fix API that addresses these problems and also is better aligned with the language server protocol. My proposal is that instead of having to think about diagnostics, editors pass the TS Server a range and are returned the valid quick fixes in that range.
Here's what the VS Code api for this looks like:
https://github.com/microsoft/vscode/blob/9a21b536639c2d986c50fb51b7da67bafdb50c9b/src/vs/vscode.d.ts#L2336
And here's the LSP:
https://microsoft.github.io/language-server-protocol/specifications/lsp/3.17/specification/#textDocument_codeAction
The text was updated successfully, but these errors were encountered: