Zsh Mailing List Archive
Messages sorted by:
Reverse Date,
Date,
Thread,
Author
Re: clang completion
- X-seq: zsh-workers 43153
- From: Oliver Kiddle <okiddle@xxxxxxxxxxx>
- To: Eric Cook <llua@xxxxxxx>
- Subject: Re: clang completion
- Date: Sun, 08 Jul 2018 23:34:07 +0200
- Authentication-results: amavisd4.gkg.net (amavisd-new); dkim=pass (2048-bit key) header.d=yahoo.co.uk
- Cc: zsh-workers@xxxxxxx
- Dkim-signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=yahoo.co.uk; s=s2048; t=1531085648; bh=oGTVSZhzv8New7kNbEDoczf96WaEIcFW422AkFsgKKQ=; h=From:References:To:Subject:Date:From:Subject; b=uAezah7E31wECyKccQtCjRDFbDmqH1Km/Sq9EaLIXaEgvId4zuCgKIQ6EkGIA4nSnY2K71jqOBH84AhIWa23lLiUoO1MDQ2d+7wIla/tcvDvWDRa8RYwweh+PpGxkYScxbIkvFMo0ojJnt08dRQ60ZfdJFdc4Wq2gbwFq32r/PaFULxDBUYlDUUfeQJ02bh4G4EKuN2MRD8IiC+ArV1RH596y8OUylvvInzdoT2IxM65iuhkpdvEIPtsSUhCAusuTQERMFQ40P50hfHcJw9Zb+/yueOS5ut6Mil7SrvQrDV84kDBenetEkuatvDXxz3nEbHqvz+7EadRWAQ3sOFlLQ==
- In-reply-to: <c335a271-cf49-2d91-d684-f285d040835a@gmx.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>
- Mailing-list: contact zsh-workers-help@xxxxxxx; run by ezmlm
- References: <CAF6rxgk2uiZ1wxHYtVKEZO=b4Voitz9sB8jU1ta1Evxv78FU-A@mail.gmail.com> <20180707205750.GA62923@CptOrmolo.darkstar> <20180708064008.rkjzh2h376kqehs6@tarpaulin.shahaf.local2> <2431.1531053655@thecus> <c335a271-cf49-2d91-d684-f285d040835a@gmx.com>
Eric Cook wrote:
> > This sort of design tends to follow from the way bash programmable
> > completion is designed. I'd far prefer to have clear options for listing
> > all warnings, languages, options etc. Those potentially have wider uses.
> >
>
> Do you mind further expanding upon this? so people considering this option
> can be directed to a location of why this may not be desired for other shells.
For a useful link to which we can refer people, some tidying and editing
work might be needed.
In bash, a function adds matches to the COMP_REPLY array. You can get
bash to do matching with compgen -W but clang has saved you the trouble:
clang --autocomplete='-fv' will only list options starting with -fv.
Firstly, we don't want matching done for us that way.
gcc has various forms of --help that provide a good example of the sort
of thing I was suggesting, e.g. gcc --help=target, --help=params and
--help=warnings. Perhaps an additional option could force these into a
more parsable match:description format with no headers/footers or word
wrapping.
Where it is useful for a command to parse the command-line for us, I'd
be happy with getting back a list of tags and offsets for how much of
the prefix and suffix should be ignored. So after -std= it might for
example, return standards:5:0 to tell you to complete standards after
stripping 5 characters of prefix and 0 of suffix. For the general case,
it might return more than one of these. We'd want all the tags
documented and they might be something like "files" that we already
complete some other way. The interface for that should not do weird
stuff with commas like clang. One idea would be to pass the word offset
followed by the character offset of the cursor followed by all words
(prefix and suffix). But, I'm not sure how well something like that
would really work in practice.
Oliver
Messages sorted by:
Reverse Date,
Date,
Thread,
Author