Everlaw / nbts

NetBeans TypeScript editor plugin
282 stars 46 forks source link

Can't see refactoring hint/action #117

Open Chris2011 opened 7 years ago

Chris2011 commented 7 years ago

As I understand it right here: https://github.com/Microsoft/TypeScript/issues/16622

there should be a refactoring hint for converting old ES5 constructs to ES6 classes. With your plugin, I don't have such feature. Can you have a look, what the problem is there? Would be great to have this hints for JS and TS files too.

Regards

Chris

jeffrey-easyesi commented 7 years ago

That hint is only relevant for JS files, not for TS, and NetBeans has its own JS support not provided by nbts. It's likely that in the future TypeScript will have refactorings that do apply to TS files, so I'll keep this issue open.

Chris2011 commented 7 years ago

Sure I know, but as I understand the ticket right, it comes right from the TS compiler. So it is a TS feature for JS files. And why not using this plugin with the feature for enhanced support for JS files too? It would be very helpful, if you want to port your JS code to TS code. I know JS is working well in TS but if you want to refactor, it would be vey handy to have it.

jeffrey-easyesi commented 6 years ago

Latest release updates to 2.5 and includes support for the Extract Method refactoring.

jeffrey-easyesi commented 6 years ago

If you really want to, it is possible to associate .js files with nbts - under Tools > Options > Miscellaneous > Files, associate the file extension "js" with MIME type "text/typescript". You'd also need to have "allowJs": true in tsconfig.json.

Chris2011 commented 6 years ago

Will normal js files in non typescript context projects still work? Because not all projects of mine are TS specific projects.

Chris2011 commented 6 years ago

This workaround is not working. Opened a JS file, inside a non ts project and it shows me the message: File /Angular Meetup Slides/Gruntfile.js is not in project defined by /Angular Meetup Slides/Gruntfile.js

And now no code completion is working.