emacs-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: IDE


From: Dmitry Gutov
Subject: Re: IDE
Date: Sun, 11 Oct 2015 07:38:31 +0300
User-agent: Mozilla/5.0 (X11; Linux x86_64; rv:41.0) Gecko/20100101 Thunderbird/41.0

Hi Eric,

On 10/10/2015 07:48 PM, Eric Ludlam wrote:

I had always intended CEDET to be a baseline for IDE like features.
Looking just at tagging files, those familiar with it's internals
recognize that it can use external tools as weak as ctags or GLOBAL, and
can use a more powerful external tool for parsing as well, such as using
JAVAC for decompiling .jar files into tags.

It sounds good if all I have is a parser/tagger.

But if I already have an external tool that can give me a set of completions at a given position in a given buffer, and also provides a go-to-definition feature, what's the advantage of going through Semantic? SRecode support?

Not to mention that we have tools like Jedi that only (mostly) do these two things, but don't provide dumps of the syntax tree.

As a backup, it also has
in-buffer parsing for when you've only half-written your code, or when
no external tool is available.

That assumes we also have a Semantic grammar for the said language. And then, we'll need to duplicate whatever logic is used by the external tool to disambiguate between same-named methods in different classes.

If that's even possible.

The same philosophy is throughout CEDET.  Unfortunately, those who are
interested in tooling who brush casually past CEDET only see that people
complain that it doesn't always complete right, or that the C++ part is
hard to setup

The example we've been given in one of the previous discussions of C++ support is that Semantic can't tell the difference between different methods with the same name? If Z#foo returns type A, and T#foo returns type B, it's been shown that Semantic doesn't know which is the type 'x.foo'.

Given this, how would we expect it to properly support languages with type inference like Scala or Go? Not to mention dynamic languages which normally have no type annotations on methods, and often use more complicated algorithms for accurate code completion.

If we look at the two starting key features listed for IDEs,
"completion" and "refactoring", the basics are all there.  CEDET has a
completion engine, but it is only as good as the input data.

It's limited by the input data, sure, but it also has to know what to do with it.

If only implementing accurate code completion was as easy as writing a language parser.

CEDET also has 'srecode' which is about
generating code.  This bit is trickier, as the intention is you could
write one highlevel tool that might extract tag data from your file,
permute the language-independent tags, and then write them back out with
srecode.  There are tests showing this working, but they are simple and
proof of concept and not stuff someone would depend on day-to-day.

SRecode should be in a better position, but I imagine it would also fail often enough in dynamic languages.

And in any case, one has to teach Semantic about scoping rules for each given language, for SRecode to only rename, say, a variable 'foo' but not function 'foo', or only the variable 'bar', but not the variable 'bar' up the scope that's being shadowed.



reply via email to

[Prev in Thread] Current Thread [Next in Thread]