Skip to content

feat(kotlin): add Kotlin definitions

What does this merge request do

This MR implements definition extraction for Kotlin. It builds off the analyzer pattern established by the Ruby definitions MR.

Given a Kotlin file, the parser will return a list of DefinitionInfo objects. Each will contain the following:

  • The definition type (class, function, properties, constructors, objects, enums, packages).
  • Fully qualified name (FQN) of the definition, with metadata, according to the new schema
  • Match information from the ast-grep rule engine.
  • All captured ast-grep variables.

Notably, there are a few limitations:

  • Inaccessible code is not included in the definitions (functions or classes declared in a function).
  • Function and constructor overloading have been pushed to a future iteration.
  • Type aliases have been pushed to a future iteration.
  • Imports are going to be considered as part of a future iteration.

Resolves: #21 (closed)

Edited by Jonathan Shobrook

Merge request reports

Loading