Zsh Mailing List Archive
Messages sorted by: Reverse Date, Date, Thread, Author

Re: Go completion support



On Mon, 23 May 2011 12:23:59 +0200
İsmail Dönmez <ismail@xxxxxxxxxxx> 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@xxxxxxx>            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



Messages sorted by: Reverse Date, Date, Thread, Author