emacs-devel
[Top][All Lists]
Advanced

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

Re: progmodes/project.el and search paths


From: David Engster
Subject: Re: progmodes/project.el and search paths
Date: Wed, 12 Aug 2015 17:36:13 +0200
User-agent: Gnus/5.13001 (Ma Gnus v0.10) Emacs/24.4 (gnu/linux)

Stephen Leake writes:
> David Engster <address@hidden> writes:
>> This also applies to the most important feature (at least for me):
>> show all definitions of 'foo' that are currently in scope. EDE has no
>> notions of symbols, scope, overloading, methods, etc.
>
> Yes, I'm beginning to realize that. Semantic provides those things. And
> it can use different backends, so it can serve as the Emacs standard
> interface to such things (although I'd want to make significant changes
> to use it for Ada mode).
>
> In that sense, Semantic competes with xref in the same way EDE competes
> with project.el.

There is some overlap, especially in the GUI area for presenting
references. But at least I would be happy to give that up in favor of
xref, since CEDET was always planned to be more on the backend side of
things, and getting the GUI right is nasty, and maintaining it takes a
lot of time I'd rather spend elsewhere. So I'm happy that Dmitry is
working on this (also with maintaining company-mode, which IMO should
become part of core Emacs rather sooner than later).

With respect to project.el, I'm still not sure where this is going.

>> It gets much more complicated when you're not only interested in
>> definitions, but any occurance of a symbol. For instance, you want all
>> places where 'foo' gets called, but not any 'foo', but the method 'foo'
>> from class 'bar' and not from any other class.
>
> Right; that's name resolution; best done by the compiler.

Yeah well, we had that discussion. I hope I find the time to work on
that. Currently, there are more urgent issue, like getting CEDET
mergeable again after the switch to git and the extensive EIEIO
refactoring...

>> All this stuff is highly dependent on the language you're using.
>
> The backend may be, but at the API level, there are some things that all
> object oriented languages support:
>
> - Search for all implementations of this method.
>
>     That's the language used by elisp cl-generic and eieio defclass. I
>     just made this the default behavior for xref-find-definitions.
>     Although that's not tested on eieio classes; I'll add that to my
>     list.
>     
>     In Ada, it's called "functions that override primitive operations".
>
>     In C++, it's "functions that override a virtual function".
>
>     The terminology is different, but the underlying notion of runtime
>     dispatch is the same.
>
>     We might want to customize the menu entry depending on the current
>     programming language.

As always, it is more complicated in C++ (overload vs override,
namespaces, argument dependent lookup, etc.), but currently I don't
worry too much about details. Getting the usual dispatch right would
cover a lot of ground.

> - Search for the parents of this type.
>
>     "Type" is the Ada word; other languages use "class" here.
>
> - Search for all functions that overload this one.
>
>     Ada and C++ (at least) support this.
>     
> - Search for all references to this function.

Yes.

> In C, these searches are simpler; the first three only return one
> result.

Aah, the joys of ANSI C. Our parser is actually pretty good for
that. :-)

-David



reply via email to

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