Hey everyone! I am trying to fix <this issue>. How...
# kontributors
a
Hey everyone! I am trying to fix this issue. How do we get the function declarations and know if a particular parameter is required not null? I did go through the PSI documentation but couldn't find an appropriate article / example on how to identify if a parameter is required as not null I tried going to the parent declaration by using
parent.context.reference.resolve()
From there on I can get the valueParameters of the function but I am not sure how to check they are nullable or not Any help will be appreciated thanks
d
IIRC resolve call will return you function descriptor from which you extract parameters as ValueParametrDescriptor This descriptor contains its type in returnType property (or so) from which you can extract nullability of the type
a
Thanks
Hi @dmitriy.novozhilov Do we have any common place wiki or any blog or anything where I can look into common functions working and their responsibilities. I checked out the documentation but it's not exhaustive.
d
No, there is no such documentation for the kotlin compiler The one your linked is about intellij idea
a
Yes actually I am focusing on plugins right now. So that's why Any tips which I can follow? Right now I am navigating through the codebase and trying to understand the functionality.
d
But you can check Kdocs for analysis api, AFAIK it more or less documented AA is a new API for interacting with kotlin compiler from ide for a new K2 IDE plugin (and it supports K1 too) https://github.com/JetBrains/kotlin/tree/master/analysis/analysis-api
I can suggest to find parts of code in the main plugin which more or less similar to what you are trying to achieve and check how some things are done here
a
Got it. Will try that. Thanks @dmitriy.novozhilov