zsh-workers
 help / color / mirror / code / Atom feed
* Go completion support
@ 2011-05-23 10:23 İsmail Dönmez
  2011-05-23 12:29 ` Peter Stephenson
  0 siblings, 1 reply; 6+ messages in thread
From: İsmail Dönmez @ 2011-05-23 10:23 UTC (permalink / raw)
  To: zsh-workers


[-- Attachment #1.1: Type: text/plain, Size: 142 bytes --]

Hi;

Attached is the go completion file from official go HG repository. It would
be nice to get it in before the release :-)

Regards,
ismail

[-- Attachment #1.2: Type: text/html, Size: 225 bytes --]

[-- Attachment #2: go --]
[-- Type: application/octet-stream, Size: 233 bytes --]

# install in /etc/zsh/zshrc or your personal .zshrc

# gc
prefixes=(5 6 8)
for p in $prefixes; do
	compctl -g "*.${p}" ${p}l
	compctl -g "*.go" ${p}g
done

# standard go tools
compctl -g "*.go" gofmt

# gccgo
compctl -g "*.go" gccgo

^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: Go completion support
  2011-05-23 10:23 Go completion support İsmail Dönmez
@ 2011-05-23 12:29 ` Peter Stephenson
  2011-05-23 12:33   ` İsmail Dönmez
  2011-05-23 12:34   ` İsmail Dönmez
  0 siblings, 2 replies; 6+ messages in thread
From: Peter Stephenson @ 2011-05-23 12:29 UTC (permalink / raw)
  To: zsh-workers

On Mon, 23 May 2011 12:23:59 +0200
İsmail Dönmez <ismail@namtrac.org> wrote:
> Attached is the go completion file from official go HG repository. It
> would be nice to get it in before the release :-)

Hmmm.... this is the (very) old-fashioned compctl completion, which
(probably) works but is unsupported beyond trivial fixes to keep it
working, and for which we've never supplied a completion library.  It
could really do with being updated to use the completion system.

From looking at that file, it's going to be something like the
following...

P.S. I quite like to be told what a completion is actually for without
having to search Google.

Index: Completion/Unix/Command/_go
===================================================================
RCS file: Completion/Unix/Command/_go
diff -N Completion/Unix/Command/_go
--- /dev/null	1 Jan 1970 00:00:00 -0000
+++ Completion/Unix/Command/_go	23 May 2011 12:27:51 -0000
@@ -0,0 +1,18 @@
+#compdef gccgo gofmt 5l 6l 68 5g 6g 8g
+
+# This is for the computer language go,
+# http://glolang.org.
+
+local expl pat
+
+case $service in
+  (<->l)
+  pat="*.${service[1,-2]}"
+  ;;
+
+  (*)
+  pat="*.go"
+  ;;
+esac
+
+_wanted files expl "input file" _files -g "$pat"


-- 
Peter Stephenson <pws@csr.com>            Software Engineer
Tel: +44 (0)1223 692070                   Cambridge Silicon Radio Limited
Churchill House, Cambridge Business Park, Cowley Road, Cambridge, CB4 0WZ, UK


Member of the CSR plc group of companies. CSR plc registered in England and Wales, registered number 4187346, registered office Churchill House, Cambridge Business Park, Cowley Road, Cambridge, CB4 0WZ, United Kingdom


^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: Go completion support
  2011-05-23 12:29 ` Peter Stephenson
@ 2011-05-23 12:33   ` İsmail Dönmez
  2011-05-23 12:34   ` İsmail Dönmez
  1 sibling, 0 replies; 6+ messages in thread
From: İsmail Dönmez @ 2011-05-23 12:33 UTC (permalink / raw)
  To: Peter Stephenson; +Cc: zsh-workers

[-- Attachment #1: Type: text/plain, Size: 845 bytes --]

Hi;

On Mon, May 23, 2011 at 2:29 PM, Peter Stephenson
<Peter.Stephenson@csr.com>wrote:

> On Mon, 23 May 2011 12:23:59 +0200
> İsmail Dönmez <ismail@namtrac.org> wrote:
> > Attached is the go completion file from official go HG repository. It
> > would be nice to get it in before the release :-)
>
> Hmmm.... this is the (very) old-fashioned compctl completion, which
> (probably) works but is unsupported beyond trivial fixes to keep it
> working, and for which we've never supplied a completion library.  It
> could really do with being updated to use the completion system.
>
> From looking at that file, it's going to be something like the
> following...
>

Thanks for that!


> P.S. I quite like to be told what a completion is actually for without
> having to search Google.
>
>
Uh sorry for that!

ismail

^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: Go completion support
  2011-05-23 12:29 ` Peter Stephenson
  2011-05-23 12:33   ` İsmail Dönmez
@ 2011-05-23 12:34   ` İsmail Dönmez
  2011-05-23 12:57     ` Peter Stephenson
  1 sibling, 1 reply; 6+ messages in thread
From: İsmail Dönmez @ 2011-05-23 12:34 UTC (permalink / raw)
  To: Peter Stephenson; +Cc: zsh-workers

[-- Attachment #1: Type: text/plain, Size: 1177 bytes --]

Hi again;

On Mon, May 23, 2011 at 2:29 PM, Peter Stephenson
<Peter.Stephenson@csr.com>wrote:

> On Mon, 23 May 2011 12:23:59 +0200
> İsmail Dönmez <ismail@namtrac.org> wrote:
> > Attached is the go completion file from official go HG repository. It
> > would be nice to get it in before the release :-)
>
> Hmmm.... this is the (very) old-fashioned compctl completion, which
> (probably) works but is unsupported beyond trivial fixes to keep it
> working, and for which we've never supplied a completion library.  It
> could really do with being updated to use the completion system.
>
> From looking at that file, it's going to be something like the
> following...
>
> P.S. I quite like to be told what a completion is actually for without
> having to search Google.
>
> Index: Completion/Unix/Command/_go
> ===================================================================
> RCS file: Completion/Unix/Command/_go
> diff -N Completion/Unix/Command/_go
> --- /dev/null   1 Jan 1970 00:00:00 -0000
> +++ Completion/Unix/Command/_go 23 May 2011 12:27:51 -0000
> @@ -0,0 +1,18 @@
> +#compdef gccgo gofmt 5l 6l 68 5g 6g 8g
>

s/68/8l

ismail

^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: Go completion support
  2011-05-23 12:34   ` İsmail Dönmez
@ 2011-05-23 12:57     ` Peter Stephenson
  2011-05-23 13:08       ` Mikael Magnusson
  0 siblings, 1 reply; 6+ messages in thread
From: Peter Stephenson @ 2011-05-23 12:57 UTC (permalink / raw)
  To: zsh-workers

On Mon, 23 May 2011 14:34:41 +0200
İsmail Dönmez <ismail@namtrac.org> wrote:
> s/68/8l

Thanks, I've made that change and submitted it.

I should probably make one last test release just to check everything
that needs to be there is.

-- 
Peter Stephenson <pws@csr.com>            Software Engineer
Tel: +44 (0)1223 692070                   Cambridge Silicon Radio Limited
Churchill House, Cambridge Business Park, Cowley Road, Cambridge, CB4 0WZ, UK


Member of the CSR plc group of companies. CSR plc registered in England and Wales, registered number 4187346, registered office Churchill House, Cambridge Business Park, Cowley Road, Cambridge, CB4 0WZ, United Kingdom


^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: Go completion support
  2011-05-23 12:57     ` Peter Stephenson
@ 2011-05-23 13:08       ` Mikael Magnusson
  0 siblings, 0 replies; 6+ messages in thread
From: Mikael Magnusson @ 2011-05-23 13:08 UTC (permalink / raw)
  To: Peter Stephenson; +Cc: zsh-workers

On 23 May 2011 14:57, Peter Stephenson <Peter.Stephenson@csr.com> wrote:
> On Mon, 23 May 2011 14:34:41 +0200
> İsmail Dönmez <ismail@namtrac.org> wrote:
>> s/68/8l
>
> Thanks, I've made that change and submitted it.
>
> I should probably make one last test release just to check everything
> that needs to be there is.

There's a typo in the url in the comment, glolang.org instead of golang.org

-- 
Mikael Magnusson


^ permalink raw reply	[flat|nested] 6+ messages in thread

end of thread, other threads:[~2011-05-23 13:08 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2011-05-23 10:23 Go completion support İsmail Dönmez
2011-05-23 12:29 ` Peter Stephenson
2011-05-23 12:33   ` İsmail Dönmez
2011-05-23 12:34   ` İsmail Dönmez
2011-05-23 12:57     ` Peter Stephenson
2011-05-23 13:08       ` Mikael Magnusson

Code repositories for project(s) associated with this public inbox

	https://git.vuxu.org/mirror/zsh/

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).