Git Product home page Git Product logo

kotlin-firviewer's Introduction

Kotlin FIR Viewer

A small tool to inspect Kotlin FIR structure.

image

Installation

Note: This plugin only works with Kotlin plugin in FIR mode.

  1. Go to the release page and download the most recent release.
  2. Launch IntelliJ with FIR plugin.
  3. Open plugins setting. Click the gear icon on top, select "Install plugin from disk...", and pick the downloaded zip file and click OK.

How to use?

The plugin provides three tool windows

  • FIR Viewer (View -> Tool Windows -> FIR Viewer): shows FIR structures for the current opened file
  • KT Viewer (View -> Tool Windows -> KT Viewer): shows the Kotlin PSI structures for the current opened file plus some information exposed by the new idea-frontend-api (those carries star icons)
  • CFG Viewer (View -> Tool Windows -> CFG Viewer): shows the FIR control flow graph. To use this, you must have dot(graphviz) available in your PATH. You can install it via homebrew install graphviz or sudo apt-get install graphviz

Build Instruction

This plugin depends on the Kotlin plugin in FIR mode. Since Kotlin FIR mode is currently not released yet, you will need a local build of the Kotlin IDE plugin. Also, since the master branch of Kotlin project is built with non-released version of Kotlin compiler, this plugin will need to be compiled with the same (or more recent) version of Kotlin compiler (see beloow for instructions).

  1. Clone https://github.com/JetBrains/kotlin.git

  2. Clone https://github.com/JetBrains/intellij-community.git and put it inside /intellij

  3. Open intellij-community project in IntelliJ and add an artifact bulding module kotlin.fir and its dependency. The output should be in <intellij project root>/out/artifacts/kotlin_fir_jar See the following screenshot image image

  4. Run ./gradlew install in the Kotlin repo to install needed dependencies in the local maven repo.

  5. Build the artifact created in step 3 and copy the artifact to the project root of FirViewer. Make sure the copied artifact is named kotlin.fir.jar (this should be the default name).

  6. cd into FirViewer project and build FirViewer with ./gradlew buildPlugin. Note that you may want to bump up the plugin version in build.gradle in order to create a new release.

  7. The resulted plugin file is located at build/distributions.

  8. If everything works fine. Please consider committing your change, pushing upstream, and publishing a new release so others can use it.

kotlin-firviewer's People

Contributors

punzki avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.