Skip to content
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

Please add feature for generate stuff like in java. #48

Closed
Chris2011 opened this issue Apr 11, 2016 · 13 comments
Closed

Please add feature for generate stuff like in java. #48

Chris2011 opened this issue Apr 11, 2016 · 13 comments
Labels

Comments

@Chris2011
Copy link

In Java you have the feature what you can see it here:
generate

where you can generate a ctor, getter and setter from private fields and much more. This would be very handy, maybe in the same context as you can see it in the image or with the hint functionality of netbeans.

@idarous
Copy link

idarous commented Apr 14, 2016

+1 it will be a very good feature and Webstorm can already do that.

@Chris2011
Copy link
Author

Please vote for it here. In the upper corner there is the smiley and give them a thumb up. +1 is not really noticeable. thx :)

@idarous
Copy link

idarous commented Apr 14, 2016

That's done.

@jeffrey-easyesi
Copy link
Contributor

"Quick fix" functionality like this is something that belongs in the TypeScript language service, so that all plugins based on that could use it.

See: microsoft/TypeScript#6943

@Chris2011
Copy link
Author

But this issue has nothing todo with quick fix. This is to related to generate the ctor or Getter and Setter and add overrides etc.

@mintern
Copy link
Contributor

mintern commented May 16, 2016

I'm pretty sure that this feature would be covered by a Quick Fix. Here are some of Eclipse's Quick Fix resources:

What is a Quick Fix?

Whenever it detects an error, the Java editor highlights the error using a wavy red line under the offending code and a marker in the left editor margin. [...] The marker can be selected with the left mouse to activate the Quick Fix pop-up, indicating actions that can be undertaken to repair the error.

[...]

Quick Fixes can be used to add fields to classes, add parameters to methods, help with unhandled exceptions, and generate local variable declarations. Quick Fixes are designed to allow you to continue the creative process of designing API while using it, a major component of Extreme Programming.

How do I implement Quick Fixes for my own language? gives a bit more context for Quick Fixes. It looks like they are useful for a broad range of functionality—implementing constructors, getters, and setters seems to be best handled as a Quick Fix.

Quick Fix functionality is already on TypeScript's road map. After they implement it, NBTS will present all of their suggested fixes automatically. At that time, any Quick Fix enhancements should be directed to Microsoft/TypeScript, so that all TypeScript IDE plugins can use them.

@Chris2011
Copy link
Author

Ok, big thx for the explanation.

@PavelTurk
Copy link

PavelTurk commented Oct 15, 2018

I've read this thread with attention and as I understand NBTS is waiting quick fixes are added to TypeScript. However, https://blogs.msdn.microsoft.com/typescript/2018/07/30/announcing-typescript-3-0/#remove-bogus-code says that quick fixes were added NOTE for Quick fixes for unreachable code and unused labels. It doesn't say about code generation and after reading TypeScript road map I don't see there any mentions about quick fix.

Could anyone say what are plans of NBTS team about code generation? I am asking because adding at least setters and getters will save A LOT OF TIME AND NERVES of developers.

@Chris2011
Copy link
Author

Afaik, the developers of NBTS is not willing to implement stuff, which is not implemented into the LS of TypeScript. Unfortunately.

@PavelTurk
Copy link

@Chris2011 For now I asked this question https://stackoverflow.com/questions/52831048/how-to-add-custom-code-generation-in-netbeans-9-0 maybe I will get some information. I hope this can be done as separate plugin. Unfortunately I never developed anything for NB and don't know its architecture, but I need setters/getters very much.

@Chris2011
Copy link
Author

Chris2011 commented Oct 16, 2018

@PashaTurok If this is not possible with a 3rd-party-plugin it would be nice, if you can create a JIRA Ticket for NetBeans and try to creating a PR. So I mean to implement it into the core of NetBeans. For this, you can have a look into the Java code, maybe PHP can handle this too.

@PavelTurk
Copy link

@Chris2011 I got information here https://platform.netbeans.org/tutorials/nbm-code-generator.html is full tutorial how to make code generation. If you have time, you can try to implement generation for TS.

@Chris2011
Copy link
Author

@PashaTurok me yes, or maybe you ;)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

5 participants