Closed ravidsrk closed 6 years ago
@ravidsrk i tried it and you need to update the injectRegex:
const injectRegex = /@Inject(?:\n|.)*?\s+(?:protected|public)*\s*(\w*)/g;
this regex match something like:
@Inject
public MyType field;
So it causes issues with kotlin code. You should replace it with:
const injectRegex = /@Inject(?:\n|.)*?\s+(?:protected|public|var|val|lateinit|.+?\:)*\s*(\w*)/g;
It will also cause issues with constructor instantiation.
class test @Inject constructor(var injection1:InjectionOne)
So we need to find a good Regex to support that scenario as well or add an extra step for kt
files for constructor injection.
Thanks for the PR mate. Completely forgot about Kotlin, yeah let's think about a proper regex that works with both!
@ravidsrk Just finished to setup the default branches for the PRs, can i ask you to create PR that goes into develop and not master? So i can start having a look at the regex and on what @v3n3 provided! 😄
Description