[Top][All Lists]

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

Re: Project support and completions

From: Dmitry Gutov
Subject: Re: Project support and completions
Date: Sun, 25 Jan 2015 20:18:59 +0200
User-agent: Mozilla/5.0 (X11; Linux x86_64; rv:33.0) Gecko/20100101 Thunderbird/33.0

On 01/25/2015 06:08 PM, Eli Zaretskii wrote:

However, for the purposes of this discussion, all that is needed is
for xref to expose some interface that would allow a project API to
tell xref which databases to use.

It already does. Please keep xref out of this discussion, I've split it out intentionally.

The important aspect of this is that at least in some situations the
set of databases to use for symbol completion should be dictated by
some code outside xref that uses an interface provided by xref, and
not necessarily inferred automatically.

Like I mentioned, xref itself doesn't keep any databases.

Suppose there's some bug when Emacs calls a GnuTLS function.  Does
working on both of them trying to solve the bug makes them "related"?

Sure. Emacs uses GnuTLS, so they're related.

Do you agree that being able to browse and complete on symbols from
both of them might be very useful in this use case?

Of course. Being able to complete on symbols from _all_ libraries that the current project uses is useful.

Such automatic inference is not easy.  Library dependencies come in
several forms: linking in a Makefile, dynamic loading in the sources,
dependencies in pkg-config style *.pc files, etc.  Also, some
libraries depend on other libraries.  Discovering all those
dependencies sounds like a non-trivial project to me.

Different packages can provide support for different kind of projects. There's no reasons for users of languages and build systems where this is easier to suffer the same hurdles as you.

More importantly, most of the time when I work on the application, I
don't care about symbols in the libraries used by an application.  So
doing what you suggest would fill my "namespace" with many symbols I
don't care about and don't want to see as completion candidates.

If you had access to context-sensitive completion, you might change your mind. Or maybe not. But it would improve the namespace pollution considerably.

an extreme example, consider libc, the Standard C library, which any C
program uses, or the Standard C++ library.  Is it really a good idea
for xref to offer all those when the user types 'M-.'?

Yeah, why not? Want to see the definition of printf? There you go!

Once again, I don't think this can be resolved automatically in a
satisfactory manner, at least not in all important use cases.  So a
provision for manual instruction by the user is still required, IMO.

It will be solved by different users using different code completion solutions.

reply via email to

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