Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

-Xprint and -Xshow-phases are undocumented in -help/-X #11710

ches opened this issue Aug 26, 2019 · 1 comment


Copy link

commented Aug 26, 2019

Amusingly, -Xprint is mentioned in the notes section at the bottom of -X, but not actually in the option listing:

Phases are a list of names, ids, or ranges of ids: -Xprint:parser,typer,5-10

And of course, it'd be ever so helpful to know how to find that list of phase names from right here on the command line without intermediate Googling step ☺️

$ scalac -version
Scala compiler version 2.13.0 -- Copyright 2002-2019, LAMP/EPFL and Lightbend, Inc.

$ scalac -X
Usage: scalac <options> <source files>

Available advanced options:
  -Xcheckinit                      Wrap field accessors to throw an exception on uninitialized access.
  -Xdev                            Indicates user is a developer - issue warnings about anything which seems amiss
  -Xdisable-assertions             Generate no assertions or assumptions.
  -Xelide-below <n>                Calls to @elidable methods are omitted if method priority is lower than argument
  -Xgenerate-phase-graph <file>    Generate the phase graphs (outputs .dot files) to
  -Xlint:<warnings>                Enable recommended warnings
  -Xmacro-settings:<option>        Custom settings for macros.
  -Xmain-class <path>              Class for manifest's Main-Class entry (only useful with -d <jar>)
  -Xmaxerrs <n>                    Maximum errors to print
  -Xmaxwarns <n>                   Maximum warnings to print
  -Xmigration:<version>            Warn about constructs whose behavior may have changed since version.
  -Xmixin-force-forwarders:<mode>  Generate forwarder methods in classes inhering concrete methods from traits. Default: `true`, `help` to list choices.
  -Xno-forwarders                  Do not generate static forwarders in mirror classes.
  -Xno-patmat-analysis             Don't perform exhaustivity/unreachability analysis. Also, ignore @switch annotation.
  -Xno-uescape                     Disable handling of \u unicode escapes.
  -Xnojline                        Do not use JLine for editing.
  -Xplugin:<paths>                 Load a plugin from each classpath.
  -Xplugin-disable:<plugin>        Disable plugins by name.
  -Xplugin-list                    Print a synopsis of loaded plugins.
  -Xplugin-require:<plugin>        Abort if a named plugin is not loaded.
  -Xpluginsdir <path>              Path to search for plugin archives.
  -Xprompt                         Display a prompt after each error (debugging option).
  -Xreporter <classname>           Specify a custom reporter for compiler messages.
  -Xresident                       Compiler stays resident: read source filenames from standard input.
  -Xscript <object>                Treat the source file as a script and wrap it in a main method.
  -Xsource:<version>               Treat compiler input as Scala source for the specified version, see scala/bug#8126.
  -Xsource-reader <classname>      Specify a custom method for reading source files.
  -Xverify                         Verify generic signatures in generated bytecode.
  -Xxml:<propertys>                Configure XML parsing.

Deprecated settings:
  -Xexperimental                   Former graveyard for language-forking extensions.
                                     deprecated: Not used since 2.13.
  -Xfuture                         Replaced by -Xsource.
                                     deprecated: Not used since 2.13.

-- Note --
Boolean settings are false unless set: -Xdev -Xcheck-init:true -Xprompt:false
Multi-valued settings are comma-separated: -Xlint:infer-any,unused,-missing-interpolator
Phases are a list of names, ids, or ranges of ids: -Xprint:parser,typer,5-10 -Ylog:-4
Use _ to enable all: -language:_ -Xprint:_

This comment has been minimized.

Copy link

commented Aug 26, 2019

-Xprint and -Xshow-phases are now -Vprint and -Vphases. They remain as aliases. They also remain as outdated examples.

I'd like to augment the help output with aliases, maybe under -verbose?

And also indicate on the docs site page how old options are aliases to new ones. Most are easy to figure out, but a couple are not, and don't make me figure stuff out.

Also, resurrect offering similar-sounding options. Did you mean -Vphases?

Edit: actually, the examples in -help were already fixed, but just missed the 2.13.0 release.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
None yet
2 participants
You can’t perform that action at this time.