-
Notifications
You must be signed in to change notification settings - Fork 12.8k
[tsserver] GetSupportedCodeFixes should return description of CodeFix #12266
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Comments
That is the expected behavior. the issue is we do not know what code fixes are applicable. the work to check for applicability is almost the same as that to compute them. |
The editor consumes SemanticDiagnosticsSync and SyntacticDiagnosticsSync to validate the editor content and marks an error. When user hovers the marked error, I have the error code and I want to display UI popup with description of codefixe that we can apply without exectuting getCodeFixes. I could display in the UI popup only the error code, but I prefer displaying the description which is more user friendly. But in this case I must consumes getCodeFixes. If GetSupportedCodeFixes could return errorCode/and description both (and not only array of string error code), it should be more performant to avoid computing of getCodedFixes just to get the description. |
Not all error codes might be fixable always by a code fix that matches the error code e.g. absent identifier may or may not be importable. Also not all code fixes would come with error code e.g. recently requested #13082 🌹 |
Automatically closing this issue for housekeeping purposes. The issue labels indicate that it is unactionable at the moment or has already been addressed. |
TypeScript Version: 2.1.1
Actual behavior:
Today when we wish to get the description of codefix to display it in an UI popup, we must consume **getCodeFixes" command which computes too the code edit although user have not executed the code fix. I think it's shame to compute the code edit although user don't execute the codefix. More I'm afraid if the compute of the codefix takes time, it will freeze the UI popup.
Expected behavior:
If tsserver GetSupportedCodeFixes command returns the errorCode/and description both, we could use the description to display in the UI popup and avoid computing the code edit.
The text was updated successfully, but these errors were encountered: