Zsh Mailing List Archive
Messages sorted by:
Reverse Date,
Date,
Thread,
Author
Re: clang completion
- X-seq: zsh-workers 43149
- From: Matthew Martin <phy1729@xxxxxxxxx>
- To: zsh-workers@xxxxxxx
- Subject: Re: clang completion
- Date: Sat, 7 Jul 2018 15:57:51 -0500
- Dkim-signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=date:from:to:subject:message-id:mail-followup-to:references :mime-version:content-disposition:content-transfer-encoding :in-reply-to:user-agent; bh=2wcasqN+m7Ap7ZguhhJB6F2fGDIPxRTld1xbsfnFEDA=; b=r6XOqJTPzBz5ZqYyT2svFIXJcyIpDTpT2IUXsE8+LLHtGw80twglslvgIJSsuHI/s9 5UQIarZYsSHOt50WjXZmbkiw4vQne7pX9r/3ARFUCgzR4gP4eAQmSuN2fRJhvA8sEAzt 5XBSXPUWfCuRSxgNNhkk8WihqvoBw9EGpmG8+itLT1ukEo0Fb4vFjb5u4+1QKazyCgRr pwYW7VE+IIDqxEFxnWxOWcjdSkZ1KhN8I0uSbZjAEClGZg3W+jTe1/fah0bUikb6cib3 fPB3bk1ysZzqTwzfP+oaG8lpHOv49ovT8NxRn9UgC6jfoU8Hv5OR14/fBqawZtX43YMa O6MA==
- In-reply-to: <CAF6rxgk2uiZ1wxHYtVKEZO=b4Voitz9sB8jU1ta1Evxv78FU-A@mail.gmail.com>
- List-help: <mailto:zsh-workers-help@zsh.org>
- List-id: Zsh Workers List <zsh-workers.zsh.org>
- List-post: <mailto:zsh-workers@zsh.org>
- List-unsubscribe: <mailto:zsh-workers-unsubscribe@zsh.org>
- Mail-followup-to: zsh-workers@xxxxxxx
- Mailing-list: contact zsh-workers-help@xxxxxxx; run by ezmlm
- References: <CAF6rxgk2uiZ1wxHYtVKEZO=b4Voitz9sB8jU1ta1Evxv78FU-A@mail.gmail.com>
On Sat, Jun 30, 2018 at 01:34:02AM -0700, Eitan Adler wrote:
> Hey all,
>
> I just discovered this feature of clang but unfortunately lack the
> time to properly sort this out:
>
> http://blog.llvm.org/2017/09/clang-bash-better-auto-completion-is.html'
>
> ∴clang --autocomplete='-tr'
> -traditional-cpp Enable some traditional CPP emulation
> -trigraphs Process trigraph sequences
>
> ∴clang --autocomplete='-std=,c++0'
> c++03
> c++0x
> and so on
>
> It seems easy enough to use. Maybe its time to give clang its own completer?
> gcc might also be thinking of doing something similar
> https://gcc.gnu.org/ml/gcc/2018-04/msg00148.html ?
Proof of concept completer:
#compdef clang
local -a options=(${${${(f)"$(_call_program clang clang --autocomplete=${words[CURRENT]/=/\=,})"}//:/\\:}/$'\t'/:})
compset -P '*='
_describe options options
The issue is I'm not sure what format --autocomplete expects. It seems
to want commas after the first = as in the -std example, but what about
if there's more =s or if there's a comma in an argument? I didn't find
docs with a quick search nor did I get a response from #llvm. If anyone
knows where --autocomplete docs are, those would be most helpful. I've
avoided reading the bash completer to avoid GPL taint.
I believe there were also concerns that clang cannot be split from gcc
and cc since clang is cc sometimes (for instance on OpenBSD for some
architectures).
- Matthew Martin
Messages sorted by:
Reverse Date,
Date,
Thread,
Author