RedHat Jboss Developer StudioでCodeLensを実現する
背景
CodeLensというのは、Microsoft Visual Studio に搭載されているいわば参照元列挙機能のことで、Visual Studio 2017以前のバージョンでは製品版(Professional版、Enterprise版など)でしかCodeLensの使用が制限されていました。つまり、お金を出さなければ使えない、リッチな機能というわけです。(Visual Studio 2019ではCommunity版でもCodeLensが使えるようになりました🎉)
↓Visual Studio CodeにおけるCodeLensの例
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も通してあること)
インストール手順
- RedHat Jboss Developer Studioをインストールします。
-
https://github.com/dhq-boiler/codelens-eclipse からソースコードをZipでダウンロードするか、gitでクローンします。
※なお、dhq-boiler/codelens-eclipseプロジェクトはフォークしたプロジェクトであり、ビルドに必要な修正を加えたものです。元のプロジェクトはangelozerr/codelens-eclipseです。angelozerr/codelens-eclipseを崇めましょう。
-
ビルドします。ソースコードをダウンロードしたフォルダでコマンドプロンプトを開き、
mvn clean install
を実行します。初回ビルドにはしばらく時間がかかります…。
コマンドプロンプトで"BUILD SUCCESS"と表示されたら、次に進みます。
-
*.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 -
RedHat Jboss Developer Studioを
-clean
オプション付きで起動します。devstudio.exe -clean
このようにクラスの上部、またはメソッドの上部に
N references
と表示されればインストール完了です!
注意
このcodelens-eclipseプラグインは未完成であり、本家のCodeLensにはあってこのプラグインにない機能はあります。(例えば、"N reference"の部分をクリックすると参照元が一覧できるウィンドウが開く)このプラグインの開発は2017年10月に止まっていますし、これ以上期待するのはやめておいたほうが良さそうです。または、Eclipseのプラグイン開発に詳しい方がこのプロジェクトをフォークして引き継ぐかですね。
Author And Source
この問題について(RedHat Jboss Developer StudioでCodeLensを実現する), 我々は、より多くの情報をここで見つけました https://qiita.com/dhq_boiler/items/39a82bf6c879a4dba131著者帰属:元の著者の情報は、元のURLに含まれています。著作権は原作者に属する。
Content is automatically searched and collected through network algorithms . If there is a violation . Please contact us . We will adjust (correct author information ,or delete content ) as soon as possible .