-
Notifications
You must be signed in to change notification settings - Fork 12.6k
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
Quick Fix support #6943
Comments
thanks @angelozerr for filing this issue. We actually have Quick Fix support on our roadmap for 2.0; we just did not have an issue to track it, but now we do :) |
Thanks @mhegazy for your answer. I'm very enthousiasm with this cool feature. |
This would be a great feature to add! As you can see nbts is waiting for it as well. |
Some basic quick fixes has been implemted along with a special request handler. - Implement interface; for methods and properties - Implement abstract class; for methods and properties - Add import statement (ES6 / AMD) - Add class method / member - Type cast to "any" Related microsoft#6943
Hi, I've worked a bit on @basarat 's implementation and tried to move it into the core. Any thoughts? |
@kisstkondoros Thanks for that, it shows there is certainly demand for this feature. I see a couple of issues with integrating with VS (and possibly VSCode), e.g. you can't depend on the error message, since we ship in 14 languages. Can you take a look at my PR, #9304, and if you have suggestions to make the API more useful that's very much appreciated. Note, I didn't do any work yet to integrate this with tsserver yet, I need to discuss that with the VS Code team first. |
@paulvanbrenk Yes I also thought it is not the best practice to get the context information from an error message 😄 perhaps extending the Diagnostic class with some context information could help for the more complicated use cases, e.g. adding missing methods / members to a class. |
Is this issue done by #10185 ? |
Yes, this is completed with #10185 |
Great work! Adding imports will be really awesome. BTW: Any plans to allow library-specific quick issues? |
@olmobrutall Not sure what you mean by that. |
I mean an equivalent to C# Code Analyzers. Something like distribuiting codefixes together with .d.ts files. The compiler will need to somehow load the codefix code at compile time. Of course it requires TS compiler to do some |
Ah, thanks. |
Sorry for stupid question, how to enable/execute quick fix action inside vs code ? I see no light bulb. Do I have to use tslint ? thanks in advance |
quick fixes don't work on Mac, works on Windows |
Seems like a VSCode specific issue, @mjbvz any ideas? |
@marcinnajder If you are on VSCode 1.10 (current insiders builds) and don't see the expected quick fixes, please open a bug: https://github.com/Microsoft/vscode/issues/new |
works fine on VSCode 1.10, thanks for help! |
It should b every cool if tsserver could support quickfix like https://github.com/TypeStrong/atom-typescript/blob/master/docs/quickfix.md
Quick fix could be returned when
geterr
is called like ESLint fix does.The text was updated successfully, but these errors were encountered: