How lint is building UAST?

148 views
Skip to first unread message

Станислав Максимов

unread,
Dec 4, 2019, 4:19:16 AM12/4/19
to lint-dev
What mechanism lint is using to build UAST? Can I somehow use this mechanism to build UAST outside of lint? I have codebase with mixed java and kotlin code and I kinda want to build UAST to search what application parts are changed when building releases. 

Matthew Gharrity

unread,
Dec 11, 2019, 7:35:46 AM12/11/19
to Станислав Максимов, lint-dev
UAST is built using APIs from the IntelliJ platform.
When running in the IDE (as an IntelliJ plugin, say) it's relatively easy because you can just call `toUElement()` on the relevant PSI.
On the command line, though, there's a lot of extra setup you have to do to get PSI in the first place. (See LintCoreApplicationEnvironment and LintCoreProjectEnvironment, for example.) It's not easy.

On Wed, Dec 4, 2019 at 9:19 AM Станислав Максимов <s.ma...@gmail.com> wrote:
What mechanism lint is using to build UAST? Can I somehow use this mechanism to build UAST outside of lint? I have codebase with mixed java and kotlin code and I kinda want to build UAST to search what application parts are changed when building releases. 

--
You received this message because you are subscribed to the Google Groups "lint-dev" group.
To unsubscribe from this group and stop receiving emails from it, send an email to lint-dev+u...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/lint-dev/f981afa1-10d6-4585-a6d9-e1c37ac69a5b%40googlegroups.com.

Matthew Gharrity

unread,
Jul 21, 2020, 2:56:04 PM7/21/20
to Станислав Максимов, lint-dev
Note, I recently rewrote some of this code, and now all the configuration happens in UastEnvironment.kt.
There is more documentation now, and the code is simpler because most of the work is delegated to the Kotlin compiler.
Reply all
Reply to author
Forward
0 new messages