Re: semantic-symref question

Anand Tamariya <[email protected]> Mon, 25 Nov 2019 12:51:36 +0530
Newsgroups gmane.emacs.semantic
Message-ID <CADm7Y4m7CO5Fi8vpd-=P1P+q2jabGToqFFng_TdLiXOmG1ckOA@mail.gmail.com>
--===============7898279883423406557==
Content-Type: multipart/alternative; boundary="000000000000d24d5d0598269d87"

--000000000000d24d5d0598269d87
Content-Type: text/plain; charset="UTF-8"

Hi Eric,
IMHO LSP is to VSCode what CEDET is to Emacs. Only CEDET is a tad better.
LSP offloads all language related editing to a language specific external
service. This overlooks the fact that programming languages are more
similar in their structure than there are differences. CEDET seems to have
beautifully captured this idea. For a demo, I've been able to use the
refactoring logic to extract method that I'd written for Java to refactor
Elisp code!!

The last thing remaining is the symref backend. In absence of any API, I'm
thinking of post-processing results from grep tool for semantic references.
This should give us a quick win.

Regards,
Anand

On Sat, Nov 23, 2019 at 7:02 PM Eric Ludlam <[email protected]> wrote:

> Hi Anand,
>
> Of the tools I had integrted, none were particularly spectacular for
> very large code bases, but ok for smaller ones.
>
> I'm not familiar with any symref level external tools for Java other
> than the core java tools themselves.  (ie - the jar files.)  There is
> some support in CEDET already with some jar based semanticdb tables, but
> I never wrote any introspection tools for symrefs.
>
> A new thing that has appeared recently are LSP servers for different
> languages.  A good bet would be to look for an LSP server for Java, and
> see what it supports.  Supporting LSP as a backend for CEDET would be a
> nice addition.  This one: https://github.com/emacs-lsp/lsp-java looks
> like it supports references.
>
> The trick would then be to write a semanticdb backend, and a symref
> backend over one of these lsp servers Emacs interfaces.  This would be a
> big win for CEDET, as these backends are becoming quite popular, and
> would let people use CEDET tools as the interface.
>
>
> Eric
>
> On 11/21/19 11:24 PM, Anand Tamariya wrote:
> > Hi Eric,
> > I've looked at some third party scripts. I realized that they can't work
> > across multiple languages without context awareness - my language of
> > interest being Java.
> >
> > Your efforts with these tools is in the right direction and really
> > commendable. They provide great starting points for adding support for
> > new languages. Do you recall any API which would help me do a global
> > search as grep / cscope tools do which can then be fed into
> semantic-symref?
> >
> > Regards,
> > Anand
> >
> > On Thu, Nov 21, 2019 at 8:43 AM Eric Ludlam <[email protected]
> > <mailto:[email protected]>> wrote:
> >
> >     On 11/19/19 11:33 PM, Anand Tamariya wrote:
> >      > Hi Eric,
> >      > What are your thoughts about integrating semantic parsing with
> >     symref
> >      > for refactoring? Is it possible/desirable?
> >
> >     Hi Anand,
> >
> >     That was one of my goals with those two tools.  You may notice that
> >     in a
> >     symref buffer, there are some options in the menu for doing
> renames.  I
> >     didn't get very far with this project.
> >
> >     Someone else started a refactoring tool using a mix of semantic,
> >     symref,
> >     and srecode.
> >
> >     https://github.com/tuhdo/semantic-refactor
> >
> >     I haven't done any coding in a while so haven't tried this much
> myself.
> >
> >     Eric
> >
>

--000000000000d24d5d0598269d87
Content-Type: text/html; charset="UTF-8"
Content-Transfer-Encoding: quoted-printable

<div dir=3D"ltr"><div>Hi Eric,</div><div>IMHO LSP is to VSCode what CEDET i=
s to Emacs. Only CEDET is a tad better. LSP offloads all language related e=
diting to a language specific external service. This overlooks the fact tha=
t programming languages are more similar in their structure than there are =
differences. CEDET seems to have beautifully captured this idea. For a demo=
, I&#39;ve been able to use the refactoring logic to extract method that I&=
#39;d written for Java to refactor Elisp code!!</div><div><br></div><div>Th=
e last thing remaining is the symref backend. In absence of any API, I&#39;=
m thinking of post-processing results from grep tool for semantic reference=
s. This should give us a quick win.<br></div><div><br></div><div>Regards,</=
div><div>Anand<br></div></div><br><div class=3D"gmail_quote"><div dir=3D"lt=
r" class=3D"gmail_attr">On Sat, Nov 23, 2019 at 7:02 PM Eric Ludlam &lt;<a =
href=3D"mailto:[email protected]">[email protected]</a>&gt; wrote:<=
br></div><blockquote class=3D"gmail_quote" style=3D"margin:0px 0px 0px 0.8e=
x;border-left:1px solid rgb(204,204,204);padding-left:1ex">Hi Anand,<br>
<br>
Of the tools I had integrted, none were particularly spectacular for <br>
very large code bases, but ok for smaller ones.<br>
<br>
I&#39;m not familiar with any symref level external tools for Java other <b=
r>
than the core java tools themselves.=C2=A0 (ie - the jar files.)=C2=A0 Ther=
e is <br>
some support in CEDET already with some jar based semanticdb tables, but <b=
r>
I never wrote any introspection tools for symrefs.<br>
<br>
A new thing that has appeared recently are LSP servers for different <br>
languages.=C2=A0 A good bet would be to look for an LSP server for Java, an=
d <br>
see what it supports.=C2=A0 Supporting LSP as a backend for CEDET would be =
a <br>
nice addition.=C2=A0 This one: <a href=3D"https://github.com/emacs-lsp/lsp-=
java" rel=3D"noreferrer" target=3D"_blank">https://github.com/emacs-lsp/lsp=
-java</a> looks <br>
like it supports references.<br>
<br>
The trick would then be to write a semanticdb backend, and a symref <br>
backend over one of these lsp servers Emacs interfaces.=C2=A0 This would be=
 a <br>
big win for CEDET, as these backends are becoming quite popular, and <br>
would let people use CEDET tools as the interface.<br>
<br>
<br>
Eric<br>
<br>
On 11/21/19 11:24 PM, Anand Tamariya wrote:<br>
&gt; Hi Eric,<br>
&gt; I&#39;ve looked at some third party scripts. I realized that they can&=
#39;t work <br>
&gt; across multiple languages without context awareness - my language of <=
br>
&gt; interest being Java.<br>
&gt; <br>
&gt; Your efforts with these tools is in the right direction and really <br=
>
&gt; commendable. They provide great starting points for adding support for=
 <br>
&gt; new languages. Do you recall any API which would help me do a global <=
br>
&gt; search as grep / cscope tools do which can then be fed into semantic-s=
ymref?<br>
&gt; <br>
&gt; Regards,<br>
&gt; Anand<br>
&gt; <br>
&gt; On Thu, Nov 21, 2019 at 8:43 AM Eric Ludlam &lt;<a href=3D"mailto:eric=
@siege-engine.com" target=3D"_blank">[email protected]</a> <br>
&gt; &lt;mailto:<a href=3D"mailto:[email protected]" target=3D"_blank">=
[email protected]</a>&gt;&gt; wrote:<br>
&gt; <br>
&gt;=C2=A0 =C2=A0 =C2=A0On 11/19/19 11:33 PM, Anand Tamariya wrote:<br>
&gt;=C2=A0 =C2=A0 =C2=A0 &gt; Hi Eric,<br>
&gt;=C2=A0 =C2=A0 =C2=A0 &gt; What are your thoughts about integrating sema=
ntic parsing with<br>
&gt;=C2=A0 =C2=A0 =C2=A0symref<br>
&gt;=C2=A0 =C2=A0 =C2=A0 &gt; for refactoring? Is it possible/desirable?<br=
>
&gt; <br>
&gt;=C2=A0 =C2=A0 =C2=A0Hi Anand,<br>
&gt; <br>
&gt;=C2=A0 =C2=A0 =C2=A0That was one of my goals with those two tools.=C2=
=A0 You may notice that<br>
&gt;=C2=A0 =C2=A0 =C2=A0in a<br>
&gt;=C2=A0 =C2=A0 =C2=A0symref buffer, there are some options in the menu f=
or doing renames.=C2=A0 I<br>
&gt;=C2=A0 =C2=A0 =C2=A0didn&#39;t get very far with this project.<br>
&gt; <br>
&gt;=C2=A0 =C2=A0 =C2=A0Someone else started a refactoring tool using a mix=
 of semantic,<br>
&gt;=C2=A0 =C2=A0 =C2=A0symref,<br>
&gt;=C2=A0 =C2=A0 =C2=A0and srecode.<br>
&gt; <br>
&gt;=C2=A0 =C2=A0 =C2=A0<a href=3D"https://github.com/tuhdo/semantic-refact=
or" rel=3D"noreferrer" target=3D"_blank">https://github.com/tuhdo/semantic-=
refactor</a><br>
&gt; <br>
&gt;=C2=A0 =C2=A0 =C2=A0I haven&#39;t done any coding in a while so haven&#=
39;t tried this much myself.<br>
&gt; <br>
&gt;=C2=A0 =C2=A0 =C2=A0Eric<br>
&gt; <br>
</blockquote></div>

--000000000000d24d5d0598269d87--


--===============7898279883423406557==
Content-Type: text/plain; charset="us-ascii"
MIME-Version: 1.0
Content-Transfer-Encoding: 7bit
Content-Disposition: inline


--===============7898279883423406557==
Content-Type: text/plain; charset="us-ascii"
MIME-Version: 1.0
Content-Transfer-Encoding: 7bit
Content-Disposition: inline

_______________________________________________
cedet-semantic mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/cedet-semantic

--===============7898279883423406557==--