This page is no longer maintained — Please continue to the home page at www.scala-lang.org

bash completion now brewing

7 replies
extempore
Joined: 2008-12-17,
User offline. Last seen 35 weeks 3 days ago.

I am glad to say that scala bash completion now comes automatically with
scala if you use homebrew. ( https://github.com/mxcl/homebrew/ )

brew install scala

That's it. Tab away.

hseeberger
Joined: 2008-12-27,
User offline. Last seen 1 year 25 weeks ago.
Re: bash completion now brewing
On Sep 7, 2011, at 7:25 PM, Paul Phillips wrote:
scala bash completion

What's that? Any pointers or examples would be highly appreciated.
Heiko
extempore
Joined: 2008-12-17,
User offline. Last seen 35 weeks 3 days ago.
Re: bash completion now brewing

On 9/7/11 12:34 PM, Heiko Seeberger wrote:
>> scala bash completion
>
> What's that? Any pointers or examples would be highly appreciated.

This is predicated on your using bash as a shell; or maybe there are other shells which understand bash completion. It's tab completion for scala, scalac, fsc, scaladoc.

// see... everything
% scalac
-Dproperty=value -Xprint-pos -Yno-imports -Ywarn-numeric-widen
-J -Xprint-types -Yno-self-type-checks -Ywarn-value-discard
-P -Xprompt -Yno-squeeze -bootclasspath
-X -Xresident -Ynotnull -classpath
-Xassem-extdirs -Xscript -Ypmat-debug -d
-Xassem-name -Xshow-class -Ypmat-naive -dependencyfile
-Xassem-path -Xshow-object -Ypresentation-debug -deprecation
-Xcheck-null -Xshow-phases -Ypresentation-delay -encoding
-Xcheckinit -Xsource-reader -Ypresentation-log -explaintypes
-Xdisable-assertions -Xsourcedir -Ypresentation-replay -extdirs
-Xelide-below -Xverify -Ypresentation-verbose -help
-Xexperimental -Y -Yprofile-class -javabootclasspath
-Xfatal-warnings -Ybuild-manager-debug -Yprofile-memory -javaextdirs
-Xfuture -Yclosure-elim -Yrangepos -no-specialization
-Xgenerate-phase-graph -Ycompact-trees -Yrecursion -nobootcp
-Xlint -Ycompletion-debug -Yrepl-debug -nowarn
-Xlog-implicits -Ydead-code -Yrepl-sync -optimise
-Xmax-classfile-name -Ydebug -Yrich-exceptions -print
-Xmigration -Ydependent-method-types -Yself-in-annots -sourcepath
-Xno-forwarders -Ydoc-debug -Yshow-syms -toolcp
-Xno-uescape -Ygen-javap -Yshow-trees -unchecked
-Xnojline -Yide-debug -Ystatistics -uniqid
-Xplugin -Yinfer-argument-types -Ytyper-debug -usejavacp
-Xplugin-disable -Yinfer-debug -Ywarn-all -verbose
-Xplugin-list -Yinline -Ywarn-dead-code -version
-Xplugin-require -Ylog-classpath -Ywarn-inaccessible @
-Xpluginsdir -Yno-completion -Ywarn-nullary-override
-Xprint-icode -Yno-generic-signatures -Ywarn-nullary-unit

// see the choices
% scalac -Ylin
-Ylinearizer:dfs -Ylinearizer:dump -Ylinearizer:normal -Ylinearizer:rpo

// see the phases
% scalac -Xprint:
-Xprint:all -Xprint:flatten -Xprint:mixin -Xprint:selectivecps
-Xprint:cleanup -Xprint:icode -Xprint:namer -Xprint:specialize
-Xprint:closelim -Xprint:inliner -Xprint:packageobjects -Xprint:superaccessors
-Xprint:constructors -Xprint:jvm -Xprint:parser -Xprint:tailcalls
-Xprint:dce -Xprint:lambdalift -Xprint:pickler -Xprint:terminal
-Xprint:erasure -Xprint:lazyvals -Xprint:refchecks -Xprint:typer
-Xprint:explicitouter -Xprint:liftcode -Xprint:selectiveanf -Xprint:uncurry

// see the runner specific options in those runners
% scaladoc -doc
-doc-format:html -doc-generator -doc-no-compile -doc-source-url -doc-title -doc-version

Aydjen
Joined: 2009-08-21,
User offline. Last seen 1 year 28 weeks ago.
Re: bash completion now brewing

very very cool
thank you

Am 07.09.2011 um 19:25 schrieb Paul Phillips:

> I am glad to say that scala bash completion now comes automatically with scala if you use homebrew. ( https://github.com/mxcl/homebrew/ )
>
> brew install scala
>
> That's it. Tab away.
>

Kevin Wright 2
Joined: 2010-05-30,
User offline. Last seen 26 weeks 4 days ago.
Re: bash completion now brewing


On 7 September 2011 22:11, Paul Phillips <paulp [at] improving [dot] org> wrote:
On 9/7/11 12:34 PM, Heiko Seeberger wrote:
>> scala bash completion
>
> What's that? Any pointers or examples would be highly appreciated.

This is predicated on your using bash as a shell; or maybe there are other shells which understand bash completion.  It's tab completion for scala, scalac, fsc, scaladoc.

// see... everything
% scalac <tab>
-Dproperty=value          -Xprint-pos               -Yno-imports              -Ywarn-numeric-widen
-J<flag>                  -Xprint-types             -Yno-self-type-checks     -Ywarn-value-discard
-P                        -Xprompt                  -Yno-squeeze              -bootclasspath
-X                        -Xresident                -Ynotnull                 -classpath
-Xassem-extdirs           -Xscript                  -Ypmat-debug              -d
-Xassem-name              -Xshow-class              -Ypmat-naive              -dependencyfile
-Xassem-path              -Xshow-object             -Ypresentation-debug      -deprecation
-Xcheck-null              -Xshow-phases             -Ypresentation-delay      -encoding
-Xcheckinit               -Xsource-reader           -Ypresentation-log        -explaintypes
-Xdisable-assertions      -Xsourcedir               -Ypresentation-replay     -extdirs
-Xelide-below             -Xverify                  -Ypresentation-verbose    -help
-Xexperimental            -Y                        -Yprofile-class           -javabootclasspath
-Xfatal-warnings          -Ybuild-manager-debug     -Yprofile-memory          -javaextdirs
-Xfuture                  -Yclosure-elim            -Yrangepos                -no-specialization
-Xgenerate-phase-graph    -Ycompact-trees           -Yrecursion               -nobootcp
-Xlint                    -Ycompletion-debug        -Yrepl-debug              -nowarn
-Xlog-implicits           -Ydead-code               -Yrepl-sync               -optimise
-Xmax-classfile-name      -Ydebug                   -Yrich-exceptions         -print
-Xmigration               -Ydependent-method-types  -Yself-in-annots          -sourcepath
-Xno-forwarders           -Ydoc-debug               -Yshow-syms               -toolcp
-Xno-uescape              -Ygen-javap               -Yshow-trees              -unchecked
-Xnojline                 -Yide-debug               -Ystatistics              -uniqid
-Xplugin                  -Yinfer-argument-types    -Ytyper-debug             -usejavacp
-Xplugin-disable          -Yinfer-debug             -Ywarn-all                -verbose
-Xplugin-list             -Yinline                  -Ywarn-dead-code          -version
-Xplugin-require          -Ylog-classpath           -Ywarn-inaccessible       @<file>
-Xpluginsdir              -Yno-completion           -Ywarn-nullary-override
-Xprint-icode             -Yno-generic-signatures   -Ywarn-nullary-unit

// see the choices
% scalac -Ylin<tab>
-Ylinearizer:dfs     -Ylinearizer:dump    -Ylinearizer:normal  -Ylinearizer:rpo

// see the phases
% scalac -Xprint:<tab>
-Xprint:all             -Xprint:flatten         -Xprint:mixin           -Xprint:selectivecps
-Xprint:cleanup         -Xprint:icode           -Xprint:namer           -Xprint:specialize
-Xprint:closelim        -Xprint:inliner         -Xprint:packageobjects  -Xprint:superaccessors
-Xprint:constructors    -Xprint:jvm             -Xprint:parser          -Xprint:tailcalls
-Xprint:dce             -Xprint:lambdalift      -Xprint:pickler         -Xprint:terminal
-Xprint:erasure         -Xprint:lazyvals        -Xprint:refchecks       -Xprint:typer
-Xprint:explicitouter   -Xprint:liftcode        -Xprint:selectiveanf    -Xprint:uncurry

// see the runner specific options in those runners
% scaladoc -doc<tab>
-doc-format:html  -doc-generator    -doc-no-compile   -doc-source-url   -doc-title        -doc-version

Is it fair to assume that the phase names are hardcoded, or will it also incorporate these from any plugins specified?
extempore
Joined: 2008-12-17,
User offline. Last seen 35 weeks 3 days ago.
Re: bash completion now brewing

On 9/7/11 2:36 PM, Kevin Wright wrote:
> Is it fair to assume that the phase names are hardcoded, or will it also
> incorporate these from any plugins specified?

They're hardcoded.

Adam Jorgensen
Joined: 2011-04-17,
User offline. Last seen 42 years 45 weeks ago.
Re: bash completion now brewing
And what about ZSH support?

On 7 September 2011 23:40, Paul Phillips <paulp [at] improving [dot] org> wrote:
On 9/7/11 2:36 PM, Kevin Wright wrote:
Is it fair to assume that the phase names are hardcoded, or will it also
incorporate these from any plugins specified?

They're hardcoded.

Jon Pretty 4
Joined: 2011-09-09,
User offline. Last seen 42 years 45 weeks ago.
Re: bash completion now brewing

+1

Copyright © 2012 École Polytechnique Fédérale de Lausanne (EPFL), Lausanne, Switzerland