From eea85dd57d52dc6a14829f6b25fbc52e8788b3f8 Mon Sep 17 00:00:00 2001 From: Ivan Yonchovski Date: Tue, 13 Aug 2019 22:24:44 +0300 Subject: [PATCH] [Dependencies] Initial version of java dependency explorer --- README.md | 15 +- icons/vscode/classfile.png | Bin 0 -> 506 bytes icons/vscode/folder-open.png | Bin 0 -> 591 bytes icons/vscode/folder.png | Bin 0 -> 357 bytes icons/vscode/icon-create.png | Bin 0 -> 406 bytes icons/vscode/icon-flat.png | Bin 0 -> 617 bytes icons/vscode/icon-hierarchical.png | Bin 0 -> 759 bytes icons/vscode/icon-link.png | Bin 0 -> 551 bytes icons/vscode/icon-refresh.png | Bin 0 -> 1249 bytes icons/vscode/icon-unlink.png | Bin 0 -> 822 bytes icons/vscode/jar.png | Bin 0 -> 844 bytes icons/vscode/library.png | Bin 0 -> 690 bytes icons/vscode/package.png | Bin 0 -> 839 bytes icons/vscode/packagefolder-open.png | Bin 0 -> 751 bytes icons/vscode/packagefolder.png | Bin 0 -> 701 bytes icons/vscode/project-open.png | Bin 0 -> 694 bytes icons/vscode/project.png | Bin 0 -> 544 bytes install/pom.xml | 33 +++- lsp-java-dependencies.el | 173 ++++++++++++++++++ lsp-java-treemacs.el | 268 ---------------------------- lsp-java.el | 5 + 21 files changed, 213 insertions(+), 281 deletions(-) create mode 100644 icons/vscode/classfile.png create mode 100644 icons/vscode/folder-open.png create mode 100644 icons/vscode/folder.png create mode 100644 icons/vscode/icon-create.png create mode 100644 icons/vscode/icon-flat.png create mode 100644 icons/vscode/icon-hierarchical.png create mode 100644 icons/vscode/icon-link.png create mode 100644 icons/vscode/icon-refresh.png create mode 100644 icons/vscode/icon-unlink.png create mode 100644 icons/vscode/jar.png create mode 100644 icons/vscode/library.png create mode 100644 icons/vscode/package.png create mode 100644 icons/vscode/packagefolder-open.png create mode 100644 icons/vscode/packagefolder.png create mode 100644 icons/vscode/project-open.png create mode 100644 icons/vscode/project.png create mode 100644 lsp-java-dependencies.el delete mode 100644 lsp-java-treemacs.el diff --git a/README.md b/README.md index adb64ec..fc0c3d5 100644 --- a/README.md +++ b/README.md @@ -113,18 +113,9 @@ some of them are bound to Emacs commands: * `lsp-java-create-local` - Create local refactoring * `lsp-java-extract-method` - Extract method refactoring * `lsp-java-add-import` - Add missing import -#### Treemacs -__NOTE__ It works only when using Eclipse Che Language Server. - -[lsp-java](https://github.com/emacs-lsp/lsp-java) provides experimental integration with [treemacs](https://github.com/Alexander-Miller/treemacs) which provides option to navigate through package dependecies, namespaces, classes and resources. -* `lsp-java-treemacs-register` activates [lsp-java](https://github.com/emacs-lsp/lsp-java)/[treemacs](https://github.com/Alexander-Miller/treemacs) integration. -* `lsp-java-treemacs-unregister` deactivates [lsp-java](https://github.com/emacs-lsp/lsp-java)/[treemacs](https://github.com/Alexander-Miller/treemacs) integration. -* `lsp-java-update-project-uris` refresh the project URIs. -#### Classpath browsing -__NOTE__ It works only when using Eclipse Che Language Server. - -[lsp-java](https://github.com/emacs-lsp/lsp-java) the command `lsp-java-classpath-browse` which allows users to browse the structure of current projects classpath. From that view the users could go to the particular item. -![Classpath](images/classpath.png) +#### Dependency viewer +* `lsp-java-dependency-list` - View java dependencies + #### STS4 Integration (experimental) LSP java has integration with [STS4](https://github.com/spring-projects/sts4/) providing the following functionality. diff --git a/icons/vscode/classfile.png b/icons/vscode/classfile.png new file mode 100644 index 0000000000000000000000000000000000000000..df76efb4f621ea188fbbdf636132dfea48a29ebe GIT binary patch literal 506 zcmVh!PJS zyYxkRIn^QP+IPr0buCb^i;%&t7Z-W~+1lLcWJv0^dG2=_p83yjhG&=&#vqefEr@X4 zS9+{g@0a>Bk=`Je%dPmn9E1^zkWvcv7F=p?5pJI&1DWqiw<{?T_R{Gz(da~=*tTt6 zUS8QSJv?86#XZX9T};yq6xZty937nmW(KzcDwP{5mFrpstn145eK~718h?`ZqwC5ZdvRF407Z~+8#~M{fB*mh07*qoM6N<$f1&q)rq=!oE>4gLcs|hiY z4PxS8q8q|L!DLw292`0_5P!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wbngCid(LOmr9!=6&h0_qz#wILAZoN&cXC(NQFyl2jA`E z{l15nj~A{<0w9yg=3SS$i&t*E-rM{9by9E;z;&6EBuR@#r#-`Q9P0J&2=Qw-ozC9A z6c`{Hou*J&^$gSOu)h8Z*X6AclVZ<-&$PDo0!2|+Sa<|LKEFgf9`_A2j4E4OAI8Co zqL54`y}4F9pw&9@4Q@7@qlq2I!8AKw(r&j4K&7Ie2tnUB84zOF3RTS(0qvqC*X92H z{_dwqzyN_s5B$n|ML0Y~DwXn#!C-)4R1rcvP}S_6OM_)uM$?{nhG}*%j4I&1yi(#b zt*ksJkw~CvPXQ*THpkA*7P^%q$0e<=>5A`3{EfR?^JA2nNY}=+>-bM(XWir`&R{-B)e*PhiMuSi& zgzG}NyiGVfr3HgGeFOXbKD}OVycHW8Z$|32yu9>p>bAJ}7+IFRd2{nUk|g;CTb2c! zdxd3L==u(UK!A3;&C$`Hx*Z??C<)=Ve3OT|wz~ZWeA}?sBU4e|00000NkvXXu0mjf Ds6`LG literal 0 HcmV?d00001 diff --git a/icons/vscode/icon-hierarchical.png b/icons/vscode/icon-hierarchical.png new file mode 100644 index 0000000000000000000000000000000000000000..7bd0356bbc44a2fc6d99ba7c4fecef25899b0563 GIT binary patch literal 759 zcmVcs6Z+o1 zzwiJ5`TzL;e}DK-5&&9S#34^y zyWOJYQeXg^&C1x=h#sWV2aJzDMbnrTgi5gm;8Tr`KEdU3(ck|7fT5vB*zNYRft#CO zSzdmB5$tlga5x;g-`e_4B9SZ`tSHLaj&r#j>GT1^!;i^kv+VEx03aBYl7c|CY%(AS zCsX0^i1WZ8z{JE0fZNjjY- zkx1Myo3B4J+MCU0IXXHr2K#(od_J%4&ySnkZm)dY=H^~eU0tpFfq{O!-Yyy%8uVH` zt}rz!&i^W21Z4HvNhN`AGK0Z!HqdOlB p$)~(xfhdZN`8=^A@#j+G_8XKH>hL>o_bLDY002ovPDHLkV1ltdQfvSK literal 0 HcmV?d00001 diff --git a/icons/vscode/icon-link.png b/icons/vscode/icon-link.png new file mode 100644 index 0000000000000000000000000000000000000000..6897fc07407bce48c2721f252650e982e9394786 GIT binary patch literal 551 zcmV+?0@(eDP)hJDQ|O4iHWNB3UUeOemoN2^lKSc9tN<*xBXl#xr_;^V7^X!ZhoW161Y^ zP=KRd6N;i>7zO~d*^KFQ`tM*xQLybR48veDnQ(jSq=G_36j9LSa+w;uVO%H_u2vidObcrC$WHCr$uaE5FrGYm%nJWTKK+?|( z{DXSE&dEuG_xC@{=krwHFUI?-QmJr#ZKJ9x{eGYO`z}EcBr}ey#bUu|^hTr6z%)&Y z#Ug{j04X>9B8@doL)Z1#A5^OqI-L$e2wq?Nbi148kypCeY;tjNo_H6Qb&3#d#PZ*| zTe(~&m&=9YNMqM^d47J01*vKQ%d!wcFdmO_oI6&lRXCseR6w#ul{$)~-7mGVuIp%; p27u>z_`V;x?pskLse`?Fe*vb-r&r--E3W_m002ovPDHLkV1fq7?acrH literal 0 HcmV?d00001 diff --git a/icons/vscode/icon-refresh.png b/icons/vscode/icon-refresh.png new file mode 100644 index 0000000000000000000000000000000000000000..a7a0ff00b43da4e7e5e1e9ff358f695424fa9556 GIT binary patch literal 1249 zcmV<71Rnc|P)iQG&M;gTiBELmpQGH;x2PH1Txs{$6$Nsv+k zm4a>Gvx`Dg85l2iF3gsFx_tR^;#oP$^MEH; zW8>Qxjq0v}fuY|ut-}6)fK`BsigNbs*-dV4&Qe85{N;3(mCuwQW)j?P_dF@Zhf=Zu zSO{?R=pg`xhK4wDq=}xMo-rYm_c}V-Pd^V>aXQQP2q8bUSS(qUmE|}b4y@K(3JMC+ zLF41&oH})ewzhVFFMU4GUO=A~TwPsl42OrBg%I1~KhfuRE?lX3gbo$umwYEMC;(I{rK`9F?Bp`IkL&*$@gn;D-5yIf@} zLGEg3*pi0E<8dxsYURq6KZryk=^jTS5e^@2qPMqq7-;bMJU>sZCd0A(WWj<3V#$)l z0K{T34j%k^qD<}suK;v)b<@;zjN#$oPAQdozrXF~B*E==YhJH6kOsTm?$>pl#kI97 z)5n}U*Fq>18WTcpmQu+Fny+2^le1^PCy|K%rt68#fk0req@-lFl*%?Ccwg5kb-Ue8 zuh$z;QkNiVR8^&@s0e`m{(f%UXam^S(b4hKG5~~Fq_S+S+fcu#1}4CS=Cgi%T-n-C7;*Tt;TGg4M1C4J5tJ|sv0f< z7yuqVd^l>e*&Poa{Nq}_d>M+OP*_+(=d@2GK5^N(rv)m+S(e{udhc@ zo;|L0UFX7ui?p`>ij=a^@ArN;sTnc@`}_NRHk-YttE+qMojaX|)Kjud3%z%*mlG$N zxqkg`34HALd%wxlrycZ~R=Pw{I1H4`pFbamVqKrgWS9sq__7zK&O;^;P-o4 zr!r>zgKXNg$q)?QSp{sBl1d>coRE3|kCgKK*x2KXot>TI)8+pQy0FCaf9TqW00000 LNkvXXu0mjf{vcGH literal 0 HcmV?d00001 diff --git a/icons/vscode/icon-unlink.png b/icons/vscode/icon-unlink.png new file mode 100644 index 0000000000000000000000000000000000000000..4f097ec9bfb678fbd31f54e7789ca931e4c79fa5 GIT binary patch literal 822 zcmV-61Ihe}P)9LLFul7%1$FijJ0->%@|;sOAE0 zj=rPWY&r#F2|-cUwI%z&@#Tr4^o9^DJI!LT7?ze4@H~%Fsf1iE4@$f5HBDO_nz#=- z0pLCW);>Q!KS!maB9%%Zkw_pI4C3J6@KGQT9BVYrc7`TSB&1p>6pDw#VW+@7O-{zJ zu&@9^2#UoL^7%iL4|D|pOixc^e*W35;C{(+8iWA3T>gb5NzgQHap1-Lt)kH=JRT1y z#Y0gPJ&uWWUB}ke_N^eE_d%9r5JGT#e2kTqRdhO?eTE@Vt5xID32dsW+ErE6iN^wn za2y9k$$}69(=@TV`VOsDtLXKznR2<@0*0KMlkAmhYrla?9SM8`r4+N_a2TOb2mny4 z)zEIY9ea8tuqZxwP6$ogeL~P;S@zY<`u|100W@AF^$wf=5C8xG07*qoM6N<$g3vQ| AXaE2J literal 0 HcmV?d00001 diff --git a/icons/vscode/jar.png b/icons/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$ zDhZrUr>WIG01ys`IY0M=Q9hp&9iwR)r>8%KRxX#sR7N6CZ?>E3PHr9Pv$G-Xb{l~8 z^>rx~w%wCP`bNaA`&)ojRh7WQ;ZSJFWKt}le_&f^tE;Q?Qn5m<_E8A41Cr0@r0qAm zE6U{(<#I`U2SrvgnXI2k#EC>A(i5lCDJLgCxNFg;(<>}4E=ro~y7c=4luRc3iN|#Q Y0)BST4p+Yi*Z=?k07*qoM6N<$g6g<3YybcN literal 0 HcmV?d00001 diff --git a/icons/vscode/package.png b/icons/vscode/package.png new file mode 100644 index 0000000000000000000000000000000000000000..7ca88a69a75db2f108bba1545764a481d5a18dc6 GIT binary patch literal 839 zcmV-N1GxN&P)nu~K~y-6-IY&F({L2WzwQ2X-Nxpo-8u#m7?8*qj4dvaNSGuV zVmKHL8jVKc#j9Su>B+=|=*e*L>cL=)h6o&{hD1;kAb=hw3GycybuMFLTXpMN4}_Mo zVlYt;zSHl0-|zS7`@Q$t>ae#FZEeAOE*Cq_vaG;y>k|MF2n2`RZuW)C#n#l;dPft9 zgs6E~ON>UN`cx`2L=w`qNRtIq@%*MF2~CnjQ6yRZeAGu97gm3OFN)(lPxUV@zRT`r z=ynU?aM+y7@lOqU;{2_%Zd~bhAU2<)HhCCGQtGjq$jIP;7u|jfrs4%(Q55u5ArQxGKy&pu>v=Lv_EZ$$w3 z1dz`e#=E>-61jP;t-&Zk;FZg+hmKTw>T?@$qmMxqy_HN+knnIUg_$K@$y}81H6uWh zaAIL$_B8BAaJvfQE6O8z~u+aDov9xHj~BZ^rq}bn$5V_rl3>B#Ww8N4-f4p`MCAX@3o@S&GgUE8Grc zj;o!@`gGWaU_CASJ`c5ja3f2hk<~sBsG||6qg5K05i0im+focqZeaLrTK2pBR$TAh zn%$w%B;I_?$+2^t4jgZ>?hl;j%iuPY>unT7)p}l3c R4Z{Ec002ovPDHLkV1j@Rd`JKQ literal 0 HcmV?d00001 diff --git a/icons/vscode/packagefolder-open.png b/icons/vscode/packagefolder-open.png new file mode 100644 index 0000000000000000000000000000000000000000..bff40aafb41a0703cb33c728f0e75e9df09bcf24 GIT binary patch literal 751 zcmV*$w!}9n+B5r4MX&#X|T?&bb24R|A zXk8SNT^K@zQfY+I$A!^Ngiz3}LEY7b-eq4(-AEQeh7dAQmtcuLbX|zkI&*Gz z)pPaozR&;1^Zwrt_}`@2%wV_MQv^X*7%N!Z%peG2I|R?h3XYgKH@7HV6qiQps}y6I z(-al(_0U%y^bD^gb~v1eAm~urmdaBky|Jb|lf}Ri&juzULd%?Hq-{E2trbUgqP8Jf zGN{al_hq6J1-f63@~C$tB3Q8`g~p*CD;de$I8_|BV16OM<9>HU=-*Nu-kpaZnDP1l zn49(a@%>!fI(X3agEt?iSnvm8ftB_?GxBC-4Jx>rt5p(KxDvPbE;w(9dw!8f-2ZQQX09001 zP*-;hqtSrPWf70ow2Rx5=?yQ2ap#OtW9QdIMydz_dkQBqohUa!Yul}SzA z5fvEVK(U3scb~&29v^da<TEf=0vXBY9}n{gt7_7OTv~whN);c85J= zdhhy9d*|kl=T~4E-~8el*yS1_5LkJ}Q{SdS#>vS^W@cvbc>OMq*Z(T&EdUya!>PW6 hYTX|i8ax>b_%|bWs&c!%yhH#1002ovPDHLkV1h*mR%`$O literal 0 HcmV?d00001 diff --git a/icons/vscode/packagefolder.png b/icons/vscode/packagefolder.png new file mode 100644 index 0000000000000000000000000000000000000000..9c827cce78f8b04f311df16c8db45a90766ec426 GIT binary patch literal 701 zcmV;u0z&!lVKRff7{-D6-^fNpgFf0xlOj0mL;*7c2Ir= zMi7P6i6KNyDvdD84uno3I`5=|`UC7BO!`>lNf}1;AxO;HX1GYJO{Zj|eRL4L9;olT zNhjS$4?NfX<9aUc`+@(hR7wJ`*SlG**435@7L){PwJ-pMGo^xM9oN+C+#(3MkH=eF z#sBBxe4s*$1wa>TX9&pU#ansXtmTVrZRx7=|=g6>u{+lnj|4e=wRt2k6g?5*#TGibh z!sBt{^Lc4%+K1ciqN}SDL8~SDdA@Woz{0{JgM)WjTKY*_TMKn{yNJi97#bQz5EPel zZE$n*emXjiVl*0XI-LlDfYa$96gq{?R1Oe)JEcsI=R- z(05*P?iIa~=yl{P1GmPC0w&X$WpE@iNj94WU}knk5+xD|=H})}r8ALKIx|v=W0ffS ji}`YHkB`4OQ407sXzZe=I;3?l00000NkvXXu0mjfN=!5t literal 0 HcmV?d00001 diff --git a/icons/vscode/project-open.png b/icons/vscode/project-open.png new file mode 100644 index 0000000000000000000000000000000000000000..72d01e4cf80ee8e1389dbb27a84349cd022d7fab GIT binary patch literal 694 zcmV;n0!jUeP)ndy)kr5(&v~BD`JTgh&Vdb*^sfM2*N+P!A6piB9Sn{?SQYH`dTV7_-BZ+=ls~6R;;imW z@&0Eei$+BNq#LV(HLdkFNLNecY_@0V_l3AJ)yQbv0f17fz~k9l54j6Hoo){Jwpiv2 z3`Q6k37O)`Z&$vfAT)DXuD#Y}uR77*MApdhYF<=VoU%NuW8i03-|#D2Zr8ax&GPHaA9 z39(W%Z7YmVA8Ibt%4HMQC`HqJVne_{rp;5QcKEjg(A%|>RN5%3`04NrpXTC4!H;6| zOWkdrI)I{$V5R15)m*zXL|<ErWD-IvVH0^g`Ld0(h&7!}}U6=j32;>;(`Gyft@K zIqL0l<8-KIFd&5B-r)FL(YsnoPKQcQr`r;Y5VrdnBcFXW_GRssfewEIEe+LX@Z{vX zC@>Is^LbrhS(3PPY8TS7N4PN5wB1KQJn=TwqExJ}Z!$)nL^8|l*TofIldS8lH-(VQ cPu%~cUuOcg7b-Xt#sB~S07*qoM6N<$g0jFhLI3~& literal 0 HcmV?d00001 diff --git a/icons/vscode/project.png b/icons/vscode/project.png new file mode 100644 index 0000000000000000000000000000000000000000..6cd0635dde4abe8f1e35a70e261586ae0449269b GIT binary patch literal 544 zcmeAS@N?(olHy`uVBq!ia0vp^Vj#@H1|*Mc$*~4fEX7WqAsj$Z!;#Vf4nJ zi1>mq^&vm4GmFmpav%Gy>ue+N)hLL%Zr z=7lRJ(^3+C%ocjP?pQ*$LTl*RY0CT(=jQC}RXoR3IJHrn`EY%#Pj3C&mLE4P|Gt?b zQTPAn=?$NcDD#N+$JZXrQap2XVUErj&ZZg}2`;8LQzdRh%#iptzw*$A*H4mn{8)d# zUgBQ;zoQ3E{h04K{ku6c5FB1^@5A%Q<_(Yh{y#1(t+VzhI2X^d47)7}bkQB%Cm{Ub z&t~&D<1J_G&u(z~&)2N*I=*dh{!fW_b&nGa0v@MY)W25$XQ0NG5+9zBkpAoVhY!}) z%?oF7G*6wUa`epwGOsC{I-~%=YHM4w2lz5M1#vh={M@XaRS}Y7}ChU zVWW}ZjI1sYPMn&qbUnc-;mU)+=9d`;HqAB_-#Qm2p405&t@-{^z3U+R{+j=PUq5 process-resources - download-vscode + download-spring-boot wget @@ -53,6 +53,18 @@ ${project.build.directory} + + process-resources + download-java-dependency + + wget + + + https://github.com/emacs-lsp/lsp-java/releases/download/2.2/vscjava.vscode-java-dependency-0.5.1.vsix + java-dependency.zip + ${project.build.directory} + + @@ -67,6 +79,7 @@ + @@ -150,6 +163,24 @@ + + copy-dep-bundles + package + + copy-resources + + + ${jdt.js.server.root}/bundles/ + + + ${project.build.directory}/java-dependency/extension/server + + com.microsoft.jdtls.ext.core-0.5.1.jar + + + + + diff --git a/lsp-java-dependencies.el b/lsp-java-dependencies.el new file mode 100644 index 0000000..bba7afc --- /dev/null +++ b/lsp-java-dependencies.el @@ -0,0 +1,173 @@ +;;; lsp-java-dependency.el --- LSP Java treemacs integration -*- lexical-binding: t; -*- + +;; Copyright (C) 2018 Ivan Yonchovski + +;; Author: Ivan Yonchovski +;; Keywords: lsp + +;; This program is free software; you can redistribute it and/or modify +;; it under the terms of the GNU General Public License as published by +;; the Free Software Foundation, either version 3 of the License, or +;; (at your option) any later version. + +;; This program is distributed in the hope that it will be useful, +;; but WITHOUT ANY WARRANTY; without even the implied warranty of +;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +;; GNU General Public License for more details. + +;; You should have received a copy of the GNU General Public License +;; along with this program. If not, see . + +;;; Commentary: + +;; Provides integration between `lsp-java' and `treemacs' which aims to provide +;; ide like project explorer. + +;;; Code: + +(with-eval-after-load 'treemacs + (require 'dash) + (require 'lsp-mode) + (require 'lsp-java) + (require 'dash-functional) + + (defun lsp-java-dependency--goto-element (&rest _args) + (if-let ((dep (-some-> (treemacs-node-at-point) + (button-get :dep)))) + (--doto (find-file-noselect (or (-some-> (gethash "uri" dep) + (lsp--uri-to-path)) + (gethash "path" dep))) + + (select-window (get-mru-window nil nil t)) + (switch-to-buffer it)) + (user-error "No element under point."))) + + (treemacs-modify-theme "Default" + :icon-directory (f-join (f-dirname (or load-file-name buffer-file-name)) "icons/vscode") + :config + (progn + (treemacs-create-icon :file "classfile.png" :extensions (classfile) :fallback "-") + (treemacs-create-icon :file "default_folder_opened.png" :extensions (default-folder-opened) :fallback "-") + (treemacs-create-icon :file "default_folder.png" :extensions (default-folder) :fallback "-") + (treemacs-create-icon :file "default_root_folder_opened.png" :extensions (default-root-folder-opened) :fallback "-") + (treemacs-create-icon :file "default_root_folder.png" :extensions (default-root-folder) :fallback "-") + (treemacs-create-icon :file "file_type_class.png" :extensions ("class") :fallback "-") + (treemacs-create-icon :file "file_type_jar.png" :extensions (file-type-jar) :fallback "-") + (treemacs-create-icon :file "folder-open.png" :extensions (folder-open) :fallback "-") + (treemacs-create-icon :file "folder.png" :extensions (folder) :fallback "-") + (treemacs-create-icon :file "folder_type_component_opened.png" :extensions (folder-type-component-opened) :fallback "-") + (treemacs-create-icon :file "folder_type_component.png" :extensions (folder-type-component) :fallback "-") + (treemacs-create-icon :file "folder_type_library_opened.png" :extensions (folder-type-library-opened) :fallback "-") + (treemacs-create-icon :file "folder_type_library.png" :extensions (folder-type-library) :fallback "-") + (treemacs-create-icon :file "folder_type_maven_opened.png" :extensions (folder-type-maven-opened) :fallback "-") + (treemacs-create-icon :file "folder_type_maven.png" :extensions (folder-type-maven) :fallback "-") + (treemacs-create-icon :file "folder_type_package_opened.png" :extensions (folder-type-package-opened) :fallback "-") + (treemacs-create-icon :file "folder_type_package.png" :extensions (folder-type-package) :fallback "-") + (treemacs-create-icon :file "icon-create.png" :extensions (icon-create) :fallback "-") + (treemacs-create-icon :file "icon-flat.png" :extensions (icon-flat) :fallback "-") + (treemacs-create-icon :file "icon-hierarchical.png" :extensions (icon-hierarchical) :fallback "-") + (treemacs-create-icon :file "icon-link.png" :extensions (icon-link) :fallback "-") + (treemacs-create-icon :file "icon-refresh.png" :extensions (icon-refresh) :fallback "-") + (treemacs-create-icon :file "icon-unlink.png" :extensions (icon-unlink) :fallback "-") + (treemacs-create-icon :file "jar.png" :extensions (jar) :fallback "-") + (treemacs-create-icon :file "library.png" :extensions (library) :fallback "-") + (treemacs-create-icon :file "packagefolder-open.png" :extensions (packagefolder-open) :fallback "-") + (treemacs-create-icon :file "packagefolder.png" :extensions (packagefolder) :fallback "-") + (treemacs-create-icon :file "package.png" :extensions (package) :fallback "-") + (treemacs-create-icon :file "project.png" :extensions (java-project) :fallback "-"))) + + (defun lsp-java-dependency--icon (dep expanded) + "Get the symbol for the the kind." + (-let (((&hash "uri" "name" "kind" "entryKind" entry-kind) dep)) + (concat + (if (or (= kind 6) + (= kind 8)) + " " + (treemacs-get-icon-value + (if expanded 'expanded 'collapsed) + nil + lsp-treemacs-theme)) + (if (or (= kind 8) + (= kind 6)) + (treemacs-icon-for-file uri) + (treemacs-get-icon-value + (cond + ;; ((eq kind 6) 'file-type-class) + ((eq kind 5) 'namespace) + ((eq kind 4) 'jar) + ((eq kind 2) 'java-project) + ((eq entry-kind 1) 'package) + ((eq entry-kind 3) 'packagefolder) + ((eq entry-kind 5) 'library)) + nil + lsp-treemacs-theme))))) + + (defun lsp-java-dependency--get-children (dep) + (lsp-java-with-jdtls + (-let (((&hash "projectUri" project-uri "rootPath" root-path "path" "kind" "name") dep)) + (unless (or (= kind 6) + (= kind 8)) + (--map (--doto it + (puthash "projectUri" project-uri it) + (when (= kind 4) + (puthash "rootPath" path it))) + (lsp-send-execute-command "java.getPackageData" + (vector (ht ("kind" kind) + ("path" (unless (eq kind 2) + (if (= 5 kind) + name + path))) + ("rootPath" (unless (eq kind 2) + (or root-path path))) + ("projectUri" project-uri))))))))) + + (treemacs-define-expandable-node lsp-java-dependency + :icon-open-form (lsp-java-dependency--icon (treemacs-button-get node :dep) t) + :icon-closed-form (lsp-java-dependency--icon (treemacs-button-get node :dep) nil) + :query-function (lsp-java-dependency--get-children (treemacs-button-get node :dep)) + :ret-action 'lsp-java-dependency--goto-element + :render-action + (treemacs-render-node + :icon (lsp-java-dependency--icon item nil) + :label-form (propertize (gethash "name" item) 'face 'default) + :state treemacs-lsp-java-dependency-closed-state + :key-form (gethash "name" item) + :more-properties (:dep item))) + + (defun lsp-java-dependency--root-folders () + (lsp-java-with-jdtls + (-mapcat (lambda (root-path) + (let ((project-uri (lsp--path-to-uri root-path))) + (->> project-uri + (lsp-send-execute-command "java.project.list") + (--map (--doto it (puthash "projectUri" project-uri it)))))) + (lsp-session-folders (lsp-session))))) + + (treemacs-define-variadic-node lsp-java-dependency-list + :query-function (lsp-java-dependency--root-folders) + :render-action + (treemacs-render-node + :icon (lsp-java-dependency--icon item nil) + :label-form (propertize (gethash "name" item) 'face 'default) + :state treemacs-lsp-java-dependency-closed-state + :key-form item + :more-properties (:dep item)) + :root-key-form 'LSP-Errors) + + (defun lsp-java-dependency-list () + "Display error list." + (interactive) + (let* ((buffer (get-buffer-create "*LSP Dependency List*")) + (window (display-buffer-in-side-window buffer '((side . right))))) + (select-window window) + (set-window-dedicated-p window t) + (treemacs-initialize) + (setq-local treemacs-default-visit-action 'treemacs-RET-action) + (treemacs-LSP-JAVA-DEPENDENCY-LIST-extension) + (setq-local mode-line-format (propertize "LSP Dependency View" 'face 'shadow))))) + +(provide 'lsp-java-dependency) + +;; Local Variables: +;; flycheck-disabled-checkers: (emacs-lisp-checkdoc) +;; End: diff --git a/lsp-java-treemacs.el b/lsp-java-treemacs.el deleted file mode 100644 index 5162980..0000000 --- a/lsp-java-treemacs.el +++ /dev/null @@ -1,268 +0,0 @@ -;;; lsp-java-treemacs.el --- LSP Java treemacs integration -*- lexical-binding: t; -*- - -;; Copyright (C) 2018 Ivan Yonchovski - -;; Author: Ivan Yonchovski -;; Keywords: lsp - -;; This program is free software; you can redistribute it and/or modify -;; it under the terms of the GNU General Public License as published by -;; the Free Software Foundation, either version 3 of the License, or -;; (at your option) any later version. - -;; This program is distributed in the hope that it will be useful, -;; but WITHOUT ANY WARRANTY; without even the implied warranty of -;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -;; GNU General Public License for more details. - -;; You should have received a copy of the GNU General Public License -;; along with this program. If not, see . - -;;; Commentary: - -;; Provides integration between `lsp-java' and `treemacs' which aims to provide -;; ide like project explorer. - -;;; Code: - -(require 'dash) -(require 'lsp-mode) -(require 'lsp-java) -(require 'dash-functional) -(require 'treemacs) -(require 'treemacs-extensions) -(require 'treemacs-icons) - -(defface lsp-java-treemacs-directory-face - '((t :inherit treemacs-directory-face)) - "Face used by treemacs for lsp-java directories and packages." - :group 'lsp-java-treemacs) - -(defface lsp-java-treemacs-extension-root-face - '((t :inherit treemacs-directory-face )) - "Face used for the extension root." - :group 'lsp-java-treemacs) - -(defface lsp-java-treemacs-file-face - '((t :inherit treemacs-file-face)) - "Face used by treemacs for files." - :group 'lsp-java-treemacs) - -(defun lsp-java-treemacs--is-root (dir-or-project) - "Return whether DIR-OR-PROJECT is root of a project." - (let ((dir (if (stringp dir-or-project) - dir-or-project - (treemacs-project->path dir-or-project)))) - - (when-lsp-workspace (lsp-java--find-workspace dir) - (-contains? (lsp-java--get-project-uris lsp--cur-workspace) - (lsp--path-to-uri dir))))) - -(defun lsp-java-treemacs--get-libraries (project-uri) - "Get the list of buffers, grouped by their major mode. -PROJECT-URI is the project id of the active project." - (when-lsp-workspace (lsp-java--find-workspace project-uri) - (lsp-send-execute-command "che.jdt.ls.extension.externalLibraries" - (list :projectUri project-uri)))) - -(defun lsp-java-treemacs--library-children (project-uri node-id) - "Get the list of library children. -PROJECT-URI and NODE-ID are the details for the current node." - (when-lsp-workspace (lsp-java--find-workspace project-uri) - (lsp-send-execute-command "che.jdt.ls.extension.libraryChildren" - (list :projectUri project-uri - :nodeId node-id)))) - -(defun lsp-java-treemacs--external-library-children (project-uri node-id path) - "Get the list of external library children. -PROJECT-URI, NODE-ID and PATH are the details for the current node." - (when-lsp-workspace (lsp-java--find-workspace project-uri) - (lsp-send-execute-command "che.jdt.ls.extension.externalLibrariesChildren" - (list :projectUri project-uri - :nodeId node-id - :nodePath path)))) - -(defun lsp-java-treemacs--open-file (_arg) - "Open resource file." - (when-lsp-workspace (lsp-java--find-workspace (treemacs--prop-at-point :project-uri)) - (->> (treemacs--prop-at-point :uri) - lsp--uri-to-path - find-file))) - -(treemacs-define-leaf-node lsp-file treemacs-icon-java - :ret-action 'lsp-java-treemacs--open-file) - -(defmacro lsp-java-treemacs--setup-icon (var file-name &rest extensions) - "Define VAR with its display property being the image created from FILE-NAME. -Insert VAR into `treemacs-icon-hash' for each of the given file EXTENSIONS." - (unless (treemacs--is-image-creation-impossible?) - `(progn - (defvar ,var - (let* ((image-unselected (treemacs--create-image (f-join (f-dirname (or load-file-name buffer-file-name)) ,file-name))) - (image-selected (treemacs--create-image (f-join (f-dirname (or load-file-name buffer-file-name)) ,file-name)))) - (treemacs--set-img-property image-selected :background treemacs--selected-icon-background) - (treemacs--set-img-property image-unselected :background treemacs--not-selected-icon-background) - (concat (propertize " " - 'display image-unselected - 'img-selected image-selected - 'img-unselected image-unselected) - " "))) - (push ,var treemacs--created-icons) - (--each (quote ,extensions) (ht-set! treemacs-icons-hash it ,var)) - ,var))) - -(if (treemacs--is-image-creation-impossible?) - (treemacs--set-icon-save-default - lsp-java-treemacs-jar treemacs-icon-closed-text - lsp-java-treemacs-jar-opened treemacs-icon-open-text - lsp-java-treemacs-package treemacs-icon-closed-text - lsp-java-treemacs-package-opened treemacs-icon-open-text - lsp-java-treemacs-jar-folder treemacs-icon-closed-text - lsp-java-treemacs-jar-folder-opened treemacs-icon-open-text - lsp-java-treemacs-library-folder treemacs-icon-closed-text - lsp-java-treemacs-library-folder-opened treemacs-icon-open-text - lsp-java-treemacs-class treemacs-icon-tag-leaf-text) - (progn - (lsp-java-treemacs--setup-icon lsp-java-treemacs-jar "icons/vscode/file_type_jar.png") - (lsp-java-treemacs--setup-icon lsp-java-treemacs-jar-opened "icons/vscode/file_type_jar.png") - (lsp-java-treemacs--setup-icon lsp-java-treemacs-package "icons/vscode/folder_type_package.png") - (lsp-java-treemacs--setup-icon lsp-java-treemacs-package-opened "icons/vscode/folder_type_package_opened.png") - (lsp-java-treemacs--setup-icon lsp-java-treemacs-jar-folder "icons/vscode/folder_type_component.png") - (lsp-java-treemacs--setup-icon lsp-java-treemacs-jar-folder-opened "icons/vscode/folder_type_component_opened.png") - (lsp-java-treemacs--setup-icon lsp-java-treemacs-library-folder "icons/vscode/folder_type_library.png") - (lsp-java-treemacs--setup-icon lsp-java-treemacs-library-folder-opened "icons/vscode/folder_type_library_opened.png") - (lsp-java-treemacs--setup-icon lsp-java-treemacs-class "icons/vscode/file_type_class.png" "class"))) - -(defmacro treemacs--lsp-node-or-folder () - "Extract common code from nodes." - (let ((more-properties '(:project-uri (button-get btn :project-uri) - :node-path node-path - :node-id (button-get btn :node-id) - :uri uri))) - `(-let (((&hash "name" "entryType" "uri" "path" node-path) item)) - (pcase entryType - ("PACKAGE" - (treemacs-render-node :icon treemacs-icon-package-closed - :label-form name - :state treemacs-package-closed-state - :key-form node-path - :face 'lsp-java-treemacs-directory-face - :more-properties ,more-properties)) - ("FOLDER" - (treemacs-render-node :icon treemacs-icon-folder-closed - :label-form name - :state treemacs-folder-closed-state - :key-form node-path - :face 'lsp-java-treemacs-directory-face - :more-properties ,more-properties)) - ((or "CLASS_FILE" "FILE") - (treemacs-render-node :icon (treemacs-icon-for-file name) - :label-form name - :state treemacs-lsp-file-state - :key-form uri - :face 'lsp-java-treemacs-file-face - :more-properties ,more-properties)))))) - -(treemacs-define-expandable-node package - :icon-open lsp-java-treemacs-package-opened - :icon-closed lsp-java-treemacs-package - :query-function (lsp-java-treemacs--external-library-children - (button-get btn :project-uri) - (button-get btn :node-id) - (button-get btn :node-path)) - :render-action (treemacs--lsp-node-or-folder)) - -(treemacs-define-expandable-node folder - :icon-open lsp-java-treemacs-jar-folder-opened - :icon-closed lsp-java-treemacs-jar-folder - :query-function (lsp-java-treemacs--external-library-children - (button-get btn :project-uri) - (button-get btn :node-id) - (button-get btn :node-path)) - :render-action (treemacs--lsp-node-or-folder)) - -(treemacs-define-expandable-node jar-file - :icon-open lsp-java-treemacs-jar-opened - :icon-closed lsp-java-treemacs-jar - :query-function (lsp-java-treemacs--library-children (button-get btn :project-uri) - (button-get btn :key)) - :render-action (treemacs--lsp-node-or-folder)) - -(treemacs-define-expandable-node external-library - :icon-open lsp-java-treemacs-library-folder-opened - :icon-closed lsp-java-treemacs-library-folder - :query-function (-> btn - (button-get :parent) - (button-get :path) - file-name-as-directory - lsp--path-to-uri - lsp-java-treemacs--get-libraries) - :root-label "External Libraries" - :root-marker t - :root-face 'lsp-java-treemacs-extension-root-face - :root-key-form (lsp--path-to-uri (button-get parent :path)) - :render-action (-let ((project-uri (-> btn - (button-get :parent) - (button-get :path) - lsp--path-to-uri)) - ((&hash "name" "id") item)) - (treemacs-render-node - :icon treemacs-icon-jar-file-closed - :label-form name - :state treemacs-jar-file-closed-state - :face 'lsp-java-treemacs-directory-face - :key-form id - :more-properties (:node-id id :project-uri project-uri - :workspace (lsp-java--find-workspace project-uri))))) - -(defun lsp-java-treemacs--folders-change (added removed) - "Handler for `lsp-workspace-folders-change' hook. -ADDED and REMOVED are pointing which are the changed folders." - (--each added - (treemacs-do-add-project-to-workspace it (f-filename it))) - (--each removed - (-some->> (treemacs-current-workspace) - treemacs-workspace->projects - (-first (lambda (project) (f-equal? it (treemacs-project->path project)))) - treemacs-do-remove-project-from-workspace))) - -(defun lsp-java-treemacs--get-projects () - "Get projects." - (or (when (functionp 'lsp-session) - (lsp-session-folders (lsp-session))) - (hash-table-keys lsp--workspaces))) - -(defun lsp-java-treemacs-register () - "Register `lsp-java' extension." - (interactive) - (treemacs-define-directory-extension - :extension 'treemacs-EXTERNAL-LIBRARY-extension - :position 'top - :predicate 'lsp-java-treemacs--is-root) - (treemacs-define-project-extension - :extension 'treemacs-EXTERNAL-LIBRARY-extension - :position 'top - :predicate 'lsp-java-treemacs--is-root) - - (require 'treemacs) - (unless (eq 'visible (treemacs-current-visibility)) - (treemacs)) - - (mapc (lambda (root-path) - (unless (or (s-equals? (f-canonical root-path) (f-canonical lsp-java-workspace-dir)) - (s-equals? (f-canonical root-path) (f-canonical lsp-java-workspace-cache-dir))) - (treemacs-do-add-project-to-workspace root-path (f-filename root-path)))) - (lsp-java-treemacs--get-projects)) - (add-hook 'lsp-workspace-folders-change 'lsp-java-treemacs--folders-change)) - -(defun lsp-java-treemacs-unregister () - "Unregister extension." - (interactive) - (remove-hook 'lsp-workspace-folders-change 'lsp-java-treemacs--folders-change) - (treemacs-remove-project-extension 'treemacs-EXTERNAL-LIBRARY-extension - 'project-start) - (treemacs-remove-directory-extension 'treemacs-EXTERNAL-LIBRARY-extension - 'directory-start)) - -(provide 'lsp-java-treemacs ) -;;; lsp-java-treemacs.el ends here diff --git a/lsp-java.el b/lsp-java.el index be3b0df..95fcdb7 100644 --- a/lsp-java.el +++ b/lsp-java.el @@ -179,6 +179,10 @@ usually)" "Enable/disable the 'auto build'" :type 'boolean) +(defcustom lsp-java-selection-enabled t + "Enable/disable the 'auto build'" + :type 'boolean) + (defcustom lsp-java-max-concurrent-builds 1 "Max simultaneous project builds" :type 'number) @@ -308,6 +312,7 @@ then list all." ("java.completion.enabled" lsp-java-completion-enabled t) ("java.maxConcurrentBuilds" lsp-java-max-concurrent-builds) ("java.autobuild.enabled" lsp-java-autobuild-enabled t) + ("java.selection.enabled" lsp-java-autobuild-enabled t) ("java.contentProvider.preferred" lsp-java-content-provider-preferred) ("java.import.exclusions" lsp-java-import-exclusions) ("java.saveActions.organizeImports" lsp-java-save-actions-organize-imports t)