From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 11350 invoked by alias); 7 Jul 2018 20:57:57 -0000 Mailing-List: contact zsh-workers-help@zsh.org; run by ezmlm Precedence: bulk X-No-Archive: yes List-Id: Zsh Workers List List-Post: List-Help: List-Unsubscribe: X-Seq: 43149 Received: (qmail 24623 invoked by uid 1010); 7 Jul 2018 20:57:57 -0000 X-Qmail-Scanner-Diagnostics: from mail-oi0-f43.google.com by f.primenet.com.au (envelope-from , uid 7791) with qmail-scanner-2.11 (clamdscan: 0.99.2/21882. spamassassin: 3.4.1. Clear:RC:0(209.85.218.43):SA:0(-1.6/5.0):. Processed in 1.11142 secs); 07 Jul 2018 20:57:57 -0000 X-Spam-Checker-Version: SpamAssassin 3.4.1 (2015-04-28) on f.primenet.com.au X-Spam-Level: X-Spam-Status: No, score=-1.6 required=5.0 tests=BAYES_00, FREEMAIL_ENVFROM_END_DIGIT,FREEMAIL_FROM,RCVD_IN_DNSWL_NONE,RCVD_IN_MSPIKE_H2, SPF_PASS,T_DKIM_INVALID,UNPARSEABLE_RELAY autolearn=no autolearn_force=no version=3.4.1 X-Envelope-From: phy1729@gmail.com X-Qmail-Scanner-Mime-Attachments: | X-Qmail-Scanner-Zip-Files: | 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== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state: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=A607WSsPYXRjxjMDSgwCD5Y4o/MdljoL2klD+vdHP6esCFyQKdAADX0OwfbjTLc3Zy J6DiCBG+88rZXoWVH+K5f5SeJ4fi0GPbwiJ5nCuzLdoVrdCtcNMSJbavyZfzbb5pIw8v CZDM6ADc/Hwsd8jImshHRGWQ/s0qaIrT/aGHH5mUWzE5neVT6yO5Qznue7qro6fHReEo jAX9AaxBB+Qz+i8hmWlEADHrjEfXBU6AaqUaiyLAmfpmYOoJyY6fr+rFUN2yTGW1fBau kNGSC0PhMPY97da8N3g/eBub6tXjM5erQtzydFVP3uavQkrAXUHtMTqaZJpm1VQ5ZKf/ SbsQ== X-Gm-Message-State: APt69E1oz2KNRfzxjmbZrsK0NnY2UzHogJeSegpCj0EYHIUzyAp0IMmd N2wS9re2aGhg11SUxxdNxUS1/pB3 X-Google-Smtp-Source: AAOMgpf0v7OAg6JDDW+6zcFvZqlyzHTfHC4A4s3+b/IkxUKuiUdefWd/I4svurMrUluWsYOS0Gm1ig== X-Received: by 2002:aca:6044:: with SMTP id u65-v6mr16547614oib.323.1530997073551; Sat, 07 Jul 2018 13:57:53 -0700 (PDT) Date: Sat, 7 Jul 2018 15:57:51 -0500 From: Matthew Martin To: zsh-workers@zsh.org Subject: Re: clang completion Message-ID: <20180707205750.GA62923@CptOrmolo.darkstar> Mail-Followup-To: zsh-workers@zsh.org References: MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: User-Agent: Mutt/1.10.0 (2018-05-17) 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