LoginSignup
0
0

More than 3 years have passed since last update.

RedHat Jboss Developer StudioでCodeLensを実現する

Posted at

背景

CodeLensというのは、Microsoft Visual Studio に搭載されているいわば参照元列挙機能のことで、Visual Studio 2017以前のバージョンでは製品版(Professional版、Enterprise版など)でしかCodeLensの使用が制限されていました。つまり、お金を出さなければ使えない、リッチな機能というわけです。(Visual Studio 2019ではCommunity版でもCodeLensが使えるようになりました🎉)

↓Visual Studio CodeにおけるCodeLensの例
introduce_codelens.png

CodeLensを使おうと思ったら、Visual Studioか、オープンソースのVisual Studio Codeを使う以外選択肢がなかったのですが、この度、RedHat Jboss Developer StudioでもCodeLensを使用する方法を見つけたため、共有する次第です。

前提条件

今回の記事の対象となる、RedHat Jboss Developer Studioのバージョンは次の通りです。

Version: 11.3.0.GA

RedHat Jboss Developer StudioでCodeLensを実現するには、前準備として以下が必要です。

  • JDK のインストール
  • Maven 3+ のインストール(PATHも通してあること)

インストール手順

  1. RedHat Jboss Developer Studioをインストールします。
  2. https://github.com/dhq-boiler/codelens-eclipse からソースコードをZipでダウンロードするか、gitでクローンします。

    ※なお、dhq-boiler/codelens-eclipseプロジェクトはフォークしたプロジェクトであり、ビルドに必要な修正を加えたものです。元のプロジェクトはangelozerr/codelens-eclipseです。angelozerr/codelens-eclipseを崇めましょう。

  3. ビルドします。ソースコードをダウンロードしたフォルダでコマンドプロンプトを開き、mvn clean installを実行します。

    mvn_clean_install.png

    初回ビルドにはしばらく時間がかかります…。

    build_success.png

    コマンドプロンプトで"BUILD SUCCESS"と表示されたら、次に進みます。

  4. *.jarファイルをコピーします。

    コピーするファイル

    • codelens-eclipse\org.eclipse.codelens\target\org.eclipse.codelens-1.1.0-SNAPSHOT.jar
    • codelens-eclipse\org.eclipse.codelens.editors\target\org.eclipse.codelens.editors-1.1.0-SNAPSHOT.jar
    • codelens-eclipse\org.eclipse.codelens.feature\target\org.eclipse.codelens.feature-1.1.0-SNAPSHOT.jar
    • codelens-eclipse\org.eclipse.codelens.jdt\target\org.eclipse.codelens.jdt-1.1.0-SNAPSHOT.jar
    • codelens-eclipse\org.eclipse.codelens.jface.fragment\target\org.eclipse.codelens.jface.fragment-1.1.0-SNAPSHOT.jar
    • codelens-eclipse\org.eclipse.codelens.swt.fragment\target\org.eclipse.codelens.swt.fragment-1.1.0-SNAPSHOT.jar

    コピー先フォルダ
    RedHat Jboss Developer Studioインストールフォルダ\studio\plugins

    copied_binary_devstudio.png

  5. RedHat Jboss Developer Studioを-cleanオプション付きで起動します。

    devstudio.exe -clean
    

    devstudio_clean.png

    display_codelens.png

    このようにクラスの上部、またはメソッドの上部にN referencesと表示されればインストール完了です!

注意

このcodelens-eclipseプラグインは未完成であり、本家のCodeLensにはあってこのプラグインにない機能はあります。(例えば、"N reference"の部分をクリックすると参照元が一覧できるウィンドウが開く)このプラグインの開発は2017年10月に止まっていますし、これ以上期待するのはやめておいたほうが良さそうです。または、Eclipseのプラグイン開発に詳しい方がこのプロジェクトをフォークして引き継ぐかですね。

0
0
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
0
0