From 06002fecf258fe869db47c20b714df07f9a4e372 Mon Sep 17 00:00:00 2001 From: Evgeny Kurnevsky Date: Sun, 1 Sep 2019 22:16:02 +0300 Subject: [PATCH] Add Metals Tree View Protocol support. --- icons/vscode/metals/book-dark.png | Bin 0 -> 485 bytes icons/vscode/metals/book-light.png | Bin 0 -> 463 bytes icons/vscode/metals/bug-dark.png | Bin 0 -> 585 bytes icons/vscode/metals/bug-light.png | Bin 0 -> 538 bytes icons/vscode/metals/class.png | Bin 0 -> 824 bytes icons/vscode/metals/enum.png | Bin 0 -> 730 bytes icons/vscode/metals/field.png | Bin 0 -> 704 bytes icons/vscode/metals/github-dark.png | Bin 0 -> 591 bytes icons/vscode/metals/github-light.png | Bin 0 -> 553 bytes icons/vscode/metals/gitter-dark.png | Bin 0 -> 264 bytes icons/vscode/metals/gitter-light.png | Bin 0 -> 253 bytes icons/vscode/metals/interface.png | Bin 0 -> 615 bytes icons/vscode/metals/issue-opened-dark.png | Bin 0 -> 610 bytes icons/vscode/metals/issue-opened-light.png | Bin 0 -> 568 bytes icons/vscode/metals/method.png | Bin 0 -> 827 bytes icons/vscode/metals/object.png | Bin 0 -> 895 bytes icons/vscode/metals/trait.png | Bin 0 -> 668 bytes icons/vscode/metals/twitter-dark.png | Bin 0 -> 495 bytes icons/vscode/metals/twitter-light.png | Bin 0 -> 443 bytes icons/vscode/metals/val.png | Bin 0 -> 844 bytes icons/vscode/metals/var.png | Bin 0 -> 839 bytes lsp-treemacs-tvp.el | 182 +++++++++++++++++++++ lsp-treemacs.el | 1 + 23 files changed, 183 insertions(+) create mode 100644 icons/vscode/metals/book-dark.png create mode 100644 icons/vscode/metals/book-light.png create mode 100644 icons/vscode/metals/bug-dark.png create mode 100644 icons/vscode/metals/bug-light.png create mode 100644 icons/vscode/metals/class.png create mode 100644 icons/vscode/metals/enum.png create mode 100644 icons/vscode/metals/field.png create mode 100644 icons/vscode/metals/github-dark.png create mode 100644 icons/vscode/metals/github-light.png create mode 100644 icons/vscode/metals/gitter-dark.png create mode 100644 icons/vscode/metals/gitter-light.png create mode 100644 icons/vscode/metals/interface.png create mode 100644 icons/vscode/metals/issue-opened-dark.png create mode 100644 icons/vscode/metals/issue-opened-light.png create mode 100644 icons/vscode/metals/method.png create mode 100644 icons/vscode/metals/object.png create mode 100644 icons/vscode/metals/trait.png create mode 100644 icons/vscode/metals/twitter-dark.png create mode 100644 icons/vscode/metals/twitter-light.png create mode 100644 icons/vscode/metals/val.png create mode 100644 icons/vscode/metals/var.png create mode 100644 lsp-treemacs-tvp.el diff --git a/icons/vscode/metals/book-dark.png b/icons/vscode/metals/book-dark.png new file mode 100644 index 0000000000000000000000000000000000000000..599b98a1093554d6878d0f8d30047a0dc3af46bb GIT binary patch literal 485 zcmV%Ft181$t3o;l~tnU_28-(bl> z(iAX|p}jVB>da0ZMzTm{%j%_ZQ}<6X!K zUIV&AP1>jfiym)1Ddh_u0eT$n)tL*xxW{{y9DKoL{Hv&@<|44?@rGAnW@8?MtEm$B zK_snvgC&)Leuu7^StX?@0$ZNk-C$!N28JB&#+gGqE(C+kY}I3MHKAL9q-lVzP9Z-< z()byOC2i;MEJ<=#mBuXaWB`(8fPJ7h!!XF_{k{bh(7gc%ISPJ2Qc==<&ae6&B=!Az b=%2wmQlYWK$?jBs00000NkvXXu0mjfBQ3>e literal 0 HcmV?d00001 diff --git a/icons/vscode/metals/book-light.png b/icons/vscode/metals/book-light.png new file mode 100644 index 0000000000000000000000000000000000000000..5a1551dca44100f4fce2cf32f30f836a871e65fa GIT binary patch literal 463 zcmV;=0WkiFP)3@*7-WORY7+%* zc7y+cVPXFOK|!`|61J}<5rbHS1<@cf!Dx_m6%8|Iy&TWIUIjtFaN)cU@AL59_nsL( z8!egh7`h93|KI`@Oh?`<|8N+J6+FD~)G>;mC3^QO&EQEKV7_4DDIDP!Mhg1o@U4;& zZg5s$IKvO@ywG<=V_z`?3H>@4npDx3@Ycg26}*SRNZZD8rk=#_g!gMv@FLpsCTVhv znS}Q^43!G*M|-5*MRgU!3GYcbq=MI_SFxL^YuHG53s*6e&|-Gw|3H@Vg4fX%Y5N*e z2WnVNc)y23-gWDZw9}~0+i|rhcp;(1?U#0JN>anuzZ&A;xY35%jU}Lzfp=>0T$}8 zdKb9drQ-?ps@h))R<8pKz#MP}_|PTzGjJPNQ0LUOb80zW0>*)%h}aKIXMokLZRr}& z2b>4yX+Bi#rJhn(Qyt&5YN=jQR|@}dZ#zcS>$VTr4ZMtq#X|fbuoZX_5nn1D{#W`1 XK_jr;9P6O)00000NkvXXu0mjf-M9c) literal 0 HcmV?d00001 diff --git a/icons/vscode/metals/bug-light.png b/icons/vscode/metals/bug-light.png new file mode 100644 index 0000000000000000000000000000000000000000..a7936a88ba26e33d3b68ee872394006390696cb0 GIT binary patch literal 538 zcmV+#0_FXQP)75t?7ay|3?fzvuTo3YY%yxc8iU?*E>9 z-v3rhkGkBY=AH+lSMf(lra*_ij#Qhk+*+@K|kxt=3j2S>rg$p!fHjN*+ zp4sC~_JQ^$Yd`S~9e9m(9LEN}w<0d9ae+Rp;T1k7{%iPxD}S4DcO2)ikoX7Vq3zgd zMqY;V!gXs+z7Im(OHrueChp)!v`5jI#LeS!w)d1!a~Q^BbqW5)vzXzwpxgN@yU7@r zXZ-?8alVR+W!WFX7+zwtBJm2IM4%EN~CUa6^#Z`d*nAxEe`n_@rLT+rq0?Xt<*lQ5lAC3B8&BG)B}P css9AO0Lt-uzah$N%m4rY07*qoM6N<$f>I6d9smFU literal 0 HcmV?d00001 diff --git a/icons/vscode/metals/class.png b/icons/vscode/metals/class.png new file mode 100644 index 0000000000000000000000000000000000000000..f580f3831e830984b717660f5a5d232d8d36ae50 GIT binary patch literal 824 zcmV-81IPS{P)&!6hRb5&#mqrGD#*;QKQE93ltw15TY(rPy?dT z_!r!&AmR%|K|~P2g$w-;f{W3WF9M3FD^W2%5pi^41kE@xiJ9)M>!K$y)6+vV-=^Sx zRi|#Z6A-JRLcqMo}?R67w}1u`>o^c%s!)#i3hr8%xJW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yc+$e zsr&nZPowxm9ap(^b8FWQhbW?9;ba!ELWdL_~cP?peYja~^ zaAhuUa%Y?FJQ@H10j5brK~y-6oz=f<6hRcg@z1SMP)QLG5k(}3l7KdXmYPB%h`$gl zZ0+(t2v#;0LRvu-2?PsmMAIaV{sYnKw39>-;-Mlc`QgQ4c43^|y}P{!ubB7aJ3DXQ zylv?%hjA4XIF#E~(Z)-x^vN&D87!fT?HcW35vKYvOv8MraOu0mtGF(pr=kU7$_#2)lwrlV{*=?c$w2)H?;~jjB3|(YHfcGZg zwM^)MLR#281US8u(F~o$I7}%flXWM3hC{`ZjJ0rFe^F zoT~uO)Id8pkOp56YPBl-IeJMt28u~H)hppAzGGe(r6&de|G>pQA7c`4qNMW`F;^o0 rqHr$*NlR#>d5l;1j|-=nsssE3UR1Sx^JUsl00000NkvXXu0mjf%k1Vs literal 0 HcmV?d00001 diff --git a/icons/vscode/metals/gitter-dark.png b/icons/vscode/metals/gitter-dark.png new file mode 100644 index 0000000000000000000000000000000000000000..d38aaf7392c269b2c8415cb745d926dbf12180f6 GIT binary patch literal 264 zcmeAS@N?(olHy`uVBq!ia0vp^Vj#@H1|*Mc$*~4fEX7WqAsj$Z!;#Vf2?p zcY-iuz?3FcprB-lYeY$Kep*R+Vo@qXd3m{BW?pu2a$-TMUVc&f>~}U&Kt-*dE{-7< zy>BlVay2`Mv^@NuX{F7-dG7nq(j5%Hs|cftZ4me#p>ZBHL>6mSh% zuPfTA8Pu44a8j11zo+7@ru?nnFIE5M{`Di-U1eqWy^?*b@27tM_u;7K$%3~39QI|k z3~C9Mi8=?QCH5am`({-=bLLrx&G+AbKQ6h?a1RsfmB<^586PJD9mL@2>gTe~DWM4f DEw*CO literal 0 HcmV?d00001 diff --git a/icons/vscode/metals/gitter-light.png b/icons/vscode/metals/gitter-light.png new file mode 100644 index 0000000000000000000000000000000000000000..f95ba2466184f2eb4386e8c0bdb266223bfb49af GIT binary patch literal 253 zcmeAS@N?(olHy`uVBq!ia0vp^Vj#@H1|*Mc$*~4fEX7WqAsj$Z!;#Vf2?p zcY-iuz?3FcprB-lYeY$Kep*R+Vo@qXd3m{BW?pu2a$-TMUVc&f>~}U&Kt)xaE{-7< zy>BOMe@24=m34;xr- qBt6pnX=2e}r*ryup{TgdK86WyLQ*|@KIZ~m!QkoY=d#Wzp$Pzf_EY-+ literal 0 HcmV?d00001 diff --git a/icons/vscode/metals/interface.png b/icons/vscode/metals/interface.png new file mode 100644 index 0000000000000000000000000000000000000000..9e94a092c2f1562d9cd690503e95e8589e80ea39 GIT binary patch literal 615 zcmV-t0+{`YP)NgNwRIp#5SdeT4$8J=VECgvcbx~Bh6RRzD;Y_Qkm}Ks8lW1+5q=xZX z-r@Ppff>#f8stTCut#0FBq}*nk09&;Kv_bVRbkRb&ZF%2iKWf@vi_jBJHOrj^hOk} z1Ib1&uB8NwMjg(b?3amBL%7&|r8lao4;*g+t{-pK5u3||g%2Cxmpg|Jsg)_vz5j&% z$)Y-L`fTvvBY**T)^jzfk^0ThIU6u%gJ$qPiK>rZlkfNqn;+3IB1fCG#ws(6Rc2aE zeXNx7ZUUHM=in}Z8?72!jll5JRKD9(jTrzs^(Iwhy7Dc!4{O%u^KF;+8`n$$2iqKW-d1h8f3>gx zwe1Gbzgk$ZRhw31x()PA%Ny)an_+N6-I&uy)Qd4j za$28yD||o3seg%+A>3Ct6l6Bhakmo%dPRK@dc92^4&r;ff}$gr1`eA6bt!BPWx%=6 zt`=T?k4Pzf2Cl{OYz7>O#l3$G+JU<6uSSJpw6R^eZwRRNm7K43R6 z-^H*F%*OXjNx;FFn;FoE#hDU^Mc{pm#S*)Aj0WmZJdve89(M}M{P)4?Bj(XrbL>wZi6TS%O8u2rgqh_-D9_CtcZX#9kc7u8`fw zX?!lrbUQvqHuE@G;dY0x5I!H!C>m_SVi;V(s)D|Wv$2{5-D+G5-*?ijf8%B-?qFp} zW>Y$EJ5{2uVJ7s`xo}?yzDre5hCzWvra!`FPli*WxTweDSHve=3i@P*{lVP+gP=KX z#eN{e=3rj^g}|?4-;#9+2X)~vXw{@L+kvf89hYGm&x2m*6L2i{#SF8-oap1Qgg3F4 z`qDiukpY}dZyDGJ5Hzsi| z)?`7q2G_&)t&%2dNQ0y;ebC_wnT|`Jnh&9ExuRHNb*XzMf}fYh=A2Gf)^*0_&XC>1 z85IWqg!Hq^dJp<#Ji?K(0E3!hgEVs+LBm(Pz{8;bFMa{L&vT0CvVpY#0000-A+ literal 0 HcmV?d00001 diff --git a/icons/vscode/metals/method.png b/icons/vscode/metals/method.png new file mode 100644 index 0000000000000000000000000000000000000000..131b890c327e5787cd90ea48307b211337fa1f29 GIT binary patch literal 827 zcmV-B1H}A^P)Y13Oo*bO z6Jz3BqcMm?e}IYc5y3~|*dL%$iE+fhs0oZnBnqelVig1*T+1uP+q)fP?HCkov+_T8rOB$!;8Qpt)Wdm$L&F=_&;by zqe=DEg>O%M%z(dKEDwk?^9p1az}v5ioq!dVP~$PC?+eU2N{JtKl+EW;`sPf$enUI6 z7JxXjZD}aLjUIRzQ!JxAKV?{3v=I7j7EX4${BmJ`M0n7c+5heWH`ogCD`up%cnxqN zJ5itz{1!ytEl%4xq!d~yPqsv8i?sw-8{?QJpg7y$_d!D?JQ{Fwf*UGRo*WALRgW4G zJ(RNy9IY~Zn1KFq&8)p1gQ4%xRAs!{P|RTiZ1*zMhGAn69u59kdpM*-ieXRKlM86I z0q^T2K+`s%>w_|vgoFc6-z&$fW%0{esPzWWe>s|~U@`&S!%FwC5>LR9sytY5Ent)! zhnH5kSlAne$Ad~zg?$kr;^|IF;Il#HO}_ERs^LWpUd5E=ZTZ}wqHm3e`y`+7;8xgN z0$W0|m2ZEkIixO#SkH0BPMlXb2Q6xKzDyck)gu_`JTJEeaE7)Rg^ zaPXKzY!-C1n*tP|u2$%1H&oAbYtm^SI1;jTgF$tjH*?`HC6|LuUkYUbyDTe(jV(ep z>(+WDYQ8cE_1?toyY4xEt{*y~C5vQA?NsRkBkF%%$(OE+SheqR3Ys~?J%?WU9RnX4 zATaYrjdw}#Y{vjkz0s!VTdc4t3=DFvc`^634xaAJ5pC6Rf zUL)%K<_)iC6iQ0q)EOm{@wa6%aO#ZvI+i#19g9f9Ov5CA0g9c>W*!yw~Aj z-|Lk;>{B}SC@%(;?OP4uu#Y=rvgWh^oa?Oo3G`QQ#f8ht;VvzFW1#T8w`~!YH~QTw zx^vBz;k^RTeV9^vTI5fJrQX6^4sP_qvjNw2O-xu^4<#l36)9XDi>6kzw2&)|{Jm@X z2S%+cK&`*!t<>*GzF}>A^a+5Oh^~!~K5-=9pm6m)px11%nkJxAz!PvQms%+*KjOL2 zB1(epdKFDIHpd71Cnt*j*^9?3t6t%(S23-EE>M^=-te~~x4}t-a-qbkZ<2uq{s-el V4tN0Te7yhw002ovPDHLkV1o4Nrf2{F literal 0 HcmV?d00001 diff --git a/icons/vscode/metals/trait.png b/icons/vscode/metals/trait.png new file mode 100644 index 0000000000000000000000000000000000000000..aa8497a389cbe186a917736f366667c438c145bb GIT binary patch literal 668 zcmV;N0%QG&P)l`Tp09c1TAh>U=%JQ(3K0RHX)X!WYCObGdknF=V_56GmYaL({Fd4 z`<%~t;9kxZDx}_f)8e87D$=XUX%P+ssIn-+w5W~-fqnLSAilWSe)+d>=;?SvuEq`` zdJCwpbntpI2qU$j;L(qGJW~;Fel;HT{lEjxZ3C80Crpd)^rjM>vt@AO%eNmOV2HY|>R-er|?*+~PkjcQz=beGA$Dy&Qu$oG**0po>;))BfvTE*# ztfK&5X5s$5oxwM5!sU*_>TIMob2|+WB|JKQP&AkU!W+%`94!7U1xAJ;nS=*JrS;|m zP*+=ANfYu)*GFA36F}=8hn@4)#(^b8FWQhbW?9;ba!ELWdL_~cP?peYja~^ zaAhuUa%Y?FJQ@H10c=S`K~y-6)s($2r9l*jpAoT*AS~4uIzb`CHrt5;TW_mboz6c% z)D)u7NkpTOY_;nnLL~~KU>lLEU6I`oh2#?VQQY@(m)C22G=9k>GdVNQ@64IWfp;mj z;u(8CsWWO${iCj`eP!`3wW+jNR68P|ZR&{+RZthyU3CK>s2_j};1uW&A?##;w}I{q z?;J1z6j1BRoG;aJwJHVLo|0*r_SKK2Lr3?52kMC0SO)$Y0X2p&tlgWCIwY|qsCM+;=J2fRdsnUz;IsNW z0y=NngC&rfWVEW^)fJ1~Doc5bJtbsi*Qx$euOl)ns6W+~r*3`gs5S%NfG~Rr(hcQU7zAoLF9iSq002ovPDHLkV1jLD&dUG* literal 0 HcmV?d00001 diff --git a/icons/vscode/metals/twitter-light.png b/icons/vscode/metals/twitter-light.png new file mode 100644 index 0000000000000000000000000000000000000000..d0661651817c77428b0d9e5f6648c75fcb485742 GIT binary patch literal 443 zcmV;s0Yv_ZP)(^b8FWQhbW?9;ba!ELWdL_~cP?peYja~^ zaAhuUa%Y?FJQ@H10XRuSK~y-6-PFG;g;5;G@z<5u+?!vM!6pnM7OO#-trj;an}2}p zCWB4MVo@eSVv<1_u*i>9>8e{MWYg@%XXut)r1B?gxA#^5-Eexc9_Tdp9Wh!A4=QvJ^oAHhUhUcuqnMboMl@I^FJGPT?dieBA&3Wp`^pr>BT;f>vx#Atl5 lEzUoQhSCYPMFajH#wT(s*@;60(kB1_002ovPDHLkV1j%PyYm15 literal 0 HcmV?d00001 diff --git a/icons/vscode/metals/val.png b/icons/vscode/metals/val.png new file mode 100644 index 0000000000000000000000000000000000000000..eaa14ead2f37b2394cd3c67ba7ba9e92c15b3c20 GIT binary patch literal 844 zcmV-S1GD^zP)5Qsk5rI0~KK# z=ky)8qE`9E#N|)lL&0Mws%o8xlLEHP1N_rpkB2lb@3aRBz{4H!x`^XFLrDA^bVeUs zjWn&eI{ps80DL^XtRmvNsXR3OS?SIw(_T1b+Jo+l(l@60(DDfGouPKhXTai2o&njI zuXvIXj&v!H2E)M*2jEDT(w&(T6gHQ5u?_$;+_7j0aBA+NL+hZ#Kr$U}Ihpn-F>qk* z@BJ6y%usu*${5ES0v63pE-8ndb?|5qMkflPW0Uas9qe8ORpkZgSXA|(5z&1?jt(~% z91rgGYeDW#pMU?YjVACkirH^~^+Cy9bx^$kZuS;}Z}<79+OaZ_3uvQ(;PJ9@_xJh> zyd0f{_l)?H(9+=dAw)F>D72JQ+j_q-x6`w+WbVJEA)E?$2KW$`T^)x_2}t!TKV6u1 z;r<(CO9IwZhEoOJ8&qBv+q!j~VE=%JgUW*eWqi_aY%!_mDnu~K~y-6os>IT?5zjJ4TNlZ*k8{!ZQ1&K;QRjVLEQ-Mek zU54>52sc$%I8&f<%>66$nKHO2wn(NqBe|NFdgD zP8W`iYkLgl-_8Bc`R;$`+!-N2kG>5zAoey?I}!Z^WMRh9NsvL1KDE>5V#i)img<+n zg~_h^d4y&TsIm_T2W>p7Dd2?K)kkB;9!&*;pYC3;*t5I@u<9+q!hC~1(%IPKJSYN> zb=NJmJii|yRv9#>@w8fPi%umU=D-vC8^YpEUj_LrTjjilp(mQ_vIOeGLeo45*#T(f zddj$K<0pA#1BmzPyL>3XjY;L}i(1rKT?IQn7505D#RC#rs{BYdxIf5PckPE(TJ8b0 z`8AgxX25&b2%R4bX@!5ED<=ow=40jX2E+E|lDXZKu*?|GY%PT5D>@hA5%_36v@a2k zf0fC3>2Bd^a*Bjhw-^!a2&yQhcqB8J7pXunirHj9>)=Y`-hktb|P04TC;xkC$u~Yv2gL#nwV1VB`Nd=+_c-i;wNTuE01^8EK1vU zzd*c_^jRqkTb|ce-#a}9V6sMi@AR1Ed2PVJdr+^ZjlDJt{U10BpRRMi6qSR#+dv)A z1Fr9W(RAY3aJ~`vT{=7GM^hnxv#RM-v{{730IG}#a!ZV#s8TBt?Qu#5_zzX{{-~8- R^9}$2002ovPDHLkV1niwc98%8 literal 0 HcmV?d00001 diff --git a/lsp-treemacs-tvp.el b/lsp-treemacs-tvp.el new file mode 100644 index 0000000..ba55fe1 --- /dev/null +++ b/lsp-treemacs-tvp.el @@ -0,0 +1,182 @@ +;;; lsp-treemacs-tvp.el --- LSP Tree View Protocol -*- lexical-binding: t; -*- + +;; Copyright (C) 2019 Evgeny Kurnevsky + +;; Author: Evgeny Kurnevsky +;; Keywords: languages + +;; 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: + +;; Metals Tree View Protocol implementation + +;;; Code: +(require 'treemacs) +(require 'treemacs-extensions) +(require 'treemacs-icons) + +(require 'lsp-mode) + +(defgroup lsp-treemacs-tvp nil + "LSP Tree View Protocol." + :group 'lsp-treemacs + :link '(url-link "https://scalameta.org/metals/docs/editors/tree-view-protocol.html") + :package-version '(lsp-treemacs . "0.1")) + +(defcustom lsp-treemacs-tvp-theme 'Metals-light + "The theme for Tree View icons." + :group 'lsp-treemacs-tvp + :type '(choice + (const :tag "Light" 'Metals-light) + (const :tag "Dark" 'Metals-dark)) + :package-version '(lsp-treemacs . "0.1")) + +(treemacs-create-theme "Metals" + :icon-directory (f-join (f-dirname (or load-file-name buffer-file-name)) "icons/vscode/metals") + :config + (progn + (treemacs-create-icon :file "class.png" :extensions (class) :fallback "-") + (treemacs-create-icon :file "enum.png" :extensions (enum) :fallback "-") + (treemacs-create-icon :file "field.png" :extensions (field) :fallback "-") + (treemacs-create-icon :file "interface.png" :extensions (interface) :fallback "-") + (treemacs-create-icon :file "method.png" :extensions (method) :fallback "-") + (treemacs-create-icon :file "object.png" :extensions (object) :fallback "-") + (treemacs-create-icon :file "trait.png" :extensions (trait) :fallback "-") + (treemacs-create-icon :file "val.png" :extensions (val) :fallback "-") + (treemacs-create-icon :file "var.png" :extensions (var) :fallback "-"))) + +(treemacs-create-theme "Metals-dark" + :icon-directory (f-join (f-dirname (or load-file-name buffer-file-name)) "icons/vscode/metals") + :config + (progn + (treemacs-create-icon :file "book-dark.png" :extensions (book) :fallback "-") + (treemacs-create-icon :file "bug-dark.png" :extensions (bug) :fallback "-") + (treemacs-create-icon :file "github-dark.png" :extensions (github) :fallback "-") + (treemacs-create-icon :file "gitter-dark.png" :extensions (gitter) :fallback "-") + (treemacs-create-icon :file "issue-opened-dark.png" :extensions (issue-opened) :fallback "-") + (treemacs-create-icon :file "twitter-dark.png" :extensions (twitter) :fallback "-"))) + +(treemacs-create-theme "Metals-light" + :icon-directory (f-join (f-dirname (or load-file-name buffer-file-name)) "icons/vscode/metals") + :config + (progn + (treemacs-create-icon :file "book-light.png" :extensions (book) :fallback "-") + (treemacs-create-icon :file "bug-light.png" :extensions (bug) :fallback "-") + (treemacs-create-icon :file "github-light.png" :extensions (github) :fallback "-") + (treemacs-create-icon :file "gitter-light.png" :extensions (gitter) :fallback "-") + (treemacs-create-icon :file "issue-opened-light.png" :extensions (issue-opened) :fallback "-") + (treemacs-create-icon :file "twitter-light.png" :extensions (twitter) :fallback "-"))) + +(defun lsp-treemacs-workspace-at-point () + "Find the LSP workspace at the point in the treemacs buffer." + (lsp-find-workspace 'metals (treemacs-project->path (treemacs-project-at-point)))) + +(defun lsp-treemacs-tvp--children (viewId &optional nodeUri) + "Get children for NODEURI with VIEWID." + (with-lsp-workspace (lsp-treemacs-workspace-at-point) + (append (ht-get (lsp-request "metals/treeViewChildren" `(:viewId ,viewId + :nodeUri ,nodeUri)) "nodes") nil))) + +(defun lsp-treemacs-tvp--ret-action (&rest _) + "Tree View RET action." + (with-lsp-workspace (lsp-treemacs-workspace-at-point) + (let ((command (treemacs--prop-at-point :command))) + (pcase (ht-get command "command") + (`"metals-echo-command" (lsp-send-execute-command (elt (ht-get command "arguments") 0))) + (`"metals.goto" (lsp-send-execute-command "goto" (ht-get command "arguments"))) + (`"build-connect" (lsp-send-execute-command "build-connect")) + (`"build-import" (lsp-send-execute-command "build-import")) + (`"compile-cascade" (lsp-send-execute-command "compile-cascade")) + (`"compile-cancel" (lsp-send-execute-command "compile-cancel")) + (c (lsp-warn "Unknown metals Tree View command: %s" c)))))) + +(defun lsp-treemacs-tvp--icon (name &optional default) + "Get the icon for the NAME. +Return DEFAULT if there is no such icon." + (pcase name + (`"class" (treemacs-get-icon-value 'class nil 'Metals)) + (`"enum" (treemacs-get-icon-value 'enum nil 'Metals)) + (`"field" (treemacs-get-icon-value 'field nil 'Metals)) + (`"interface" (treemacs-get-icon-value 'interface nil 'Metals)) + (`"method" (treemacs-get-icon-value 'method nil 'Metals)) + (`"object" (treemacs-get-icon-value 'object nil 'Metals)) + (`"trait" (treemacs-get-icon-value 'trait nil 'Metals)) + (`"val" (treemacs-get-icon-value 'val nil 'Metals)) + (`"var" (treemacs-get-icon-value 'var nil 'Metals)) + (`"book" (treemacs-get-icon-value 'book nil lsp-treemacs-tvp-theme)) + (`"bug" (treemacs-get-icon-value 'bug nil lsp-treemacs-tvp-theme)) + (`"github" (treemacs-get-icon-value 'github nil lsp-treemacs-tvp-theme)) + (`"gitter" (treemacs-get-icon-value 'gitter nil lsp-treemacs-tvp-theme)) + (`"issue-opened" (treemacs-get-icon-value 'issue-opened nil lsp-treemacs-tvp-theme)) + (`"twitter" (treemacs-get-icon-value 'twitter nil lsp-treemacs-tvp-theme)) + (_ default))) + +(treemacs-define-leaf-node tvp-leaf 'dynamic-icon + :ret-action #'lsp-treemacs-tvp--ret-action) + +(treemacs-define-expandable-node tvp-node + :icon-open-form (lsp-treemacs-tvp--icon (treemacs-button-get node :icon) (treemacs-as-icon " ▾ ")) + :icon-closed-form (lsp-treemacs-tvp--icon (treemacs-button-get node :icon) (treemacs-as-icon " ▸ ")) + :ret-action #'lsp-treemacs-tvp--ret-action + :query-function (lsp-treemacs-tvp--children (treemacs-button-get node :viewId) (treemacs-button-get node :nodeUri)) + :render-action (treemacs-render-node + :icon (lsp-treemacs-tvp--icon (ht-get item "icon") (if (ht-get item "collapseState") + (treemacs-as-icon " ▸ ") + (treemacs-as-icon " • "))) + :label-form (ht-get item "label") + :state (if (ht-get item "collapseState") + treemacs-tvp-node-closed-state + treemacs-tvp-leaf-state) + :face 'default + :key-form (ht-get item "nodeUri") + :more-properties (:viewId (ht-get item "viewId") + :nodeUri (ht-get item "nodeUri") + :command (ht-get item "command") + :icon (ht-get item "icon")))) + +(treemacs-define-expandable-node tvp-root + :icon-open (treemacs-as-icon " ▾ ") + :icon-closed (treemacs-as-icon " ▸ ") + :query-function `(,(ht ("label" "Build") ("viewId" "metalsBuild")) + ,(ht ("label" "Compile") ("viewId" "metalsCompile")) + ,(ht ("label" "Help") ("viewId" "metalsHelp"))) + :render-action (treemacs-render-node + :icon (treemacs-as-icon " ▸ ") + :label-form (ht-get item "label") + :state treemacs-tvp-node-closed-state + :face 'default + :key-form (ht-get item "label") + :more-properties (:viewId (ht-get item "viewId") + :nodeUri (ht-get item "nodeUri"))) + :root-marker t + :root-label "Tree View" + :root-face 'default + :root-key-form 'TreeView) + +(defun lsp-treemacs-tvp--predicate (project) + "Check if the Metals Tree View should be displayed for the PROJECT." + (lsp-find-workspace 'metals (treemacs-project->path project))) + +(treemacs-define-project-extension + :extension #'treemacs-TVP-ROOT-extension + :predicate #'lsp-treemacs-tvp--predicate + :position 'top) + +(provide 'lsp-treemacs-tvp) +;;; lsp-treemacs-tvp.el ends here + +;; Local Variables: +;; flycheck-disabled-checkers: (emacs-lisp-checkdoc) +;; End: diff --git a/lsp-treemacs.el b/lsp-treemacs.el index 6aa17f2..e2ddae4 100644 --- a/lsp-treemacs.el +++ b/lsp-treemacs.el @@ -33,6 +33,7 @@ (require 'treemacs-icons) (require 'lsp-mode) +(require 'lsp-treemacs-tvp) (defconst lsp-treemacs-deps-buffer-name "*Java Dependency List*")