This is what I got with the PSI approach:
# arrow-meta
i
This is what I got with the PSI approach:
For an general reference you can check out this DevGuide. It is not very good, but all we got about the theoretical part. https://www.jetbrains.org/intellij/sdk/docs/basics/architectural_overview/psi_files.html
a
This is all the info we need to get from the `PsiElement`https://github.com/arrow-kt/arrow/blob/master/modules/meta/arrow-meta/src/main/java/arrow/meta/ast/ast.kt#L233 This is a MPP project using Psi https://github.com/square/sqldelight and this is the Psi native library that
sqdelight
use under the hood https://github.com/AlecStrong/sqlite-psi
i
My current workflow is to search through the IntelliJ Platform support and try to find gold examples. One for (virtual) PSI generation in PHP https://intellij-support.jetbrains.com/hc/en-us/community/posts/360002038299-Add-element-to-PSI?flash_digest=abd9f102af43a4eeae9145715b3188a8a94222bb This plugin seems to work for most PSI dev’s, but I am still working on how the PSI System works. https://plugins.jetbrains.com/plugin/227-psiviewer
a
ok
i
Update The aforementioned purity was a dead end. I’’ll try to find a way to fetch the info. At least now. I know where all the information is. From there I will try to generate code in either a virtual file, or an physical. (A virtual file is from an PSI standpoint viewable, but the User of the annotation. Can not see the generated code. I hope to avoid this path, but let’s see)
a
I think we will need the physical one if we need to do the same hack as on kapt
i
Those how, read into the doc’s need to get used to the idea. That in intellij PSIElements are either files or directory. I am still at the beginning to find a function, which can distinguish those two. Thereby the meaning of PSIElement children makes sense, now at least.
a
don't worry you are doing a good job