From a218fb3b85343a86ce01360e5fa4ea0a17126ee8 Mon Sep 17 00:00:00 2001 From: exoego Date: Tue, 1 May 2018 21:51:46 +0900 Subject: [PATCH 01/12] Document scalac compiler options. --- _data/compiler-options.yml | 1011 ++++++++++++++++++++++++++ _data/overviews.yml | 6 + _overviews/compiler-options/index.md | 181 +++++ _sass/layout/type-md.scss | 6 +- 4 files changed, 1203 insertions(+), 1 deletion(-) create mode 100644 _data/compiler-options.yml create mode 100644 _overviews/compiler-options/index.md diff --git a/_data/compiler-options.yml b/_data/compiler-options.yml new file mode 100644 index 0000000000..3d812c877d --- /dev/null +++ b/_data/compiler-options.yml @@ -0,0 +1,1011 @@ +- category: Standard Settings + description: "A set of standard options that are supported on the current development environment and will be supported in future releases." + options: +# Path related settings. + - option: -classpath + abbreviation: -cp + schema: + type: Path + arg: path + description: "Specify where to find user class files." + - option: -bootclasspath + schema: + type: Path + arg: path + default: Defaults.scalaBootClassPath + description: "Override location of bootstrap class files." + - option: -extdirs + schema: + type: Path + arg: path + default: Defaults.scalaExtDirs + description: "Override location of installed extensions." + - option: -javabootclasspath + schema: + type: Path + arg: path + default: Defaults.javaBootClassPath + description: "Override java boot classpath." + - option: -javaextdirs + schema: + type: Path + arg: path + default: Defaults.javaExtDirs + description: "Override java extdirs classpath." + - option: -sourcepath + schema: + type: Path + description: "Specify location(s) of source files." +# other settings + - option: -dependencyfile + schema: + type: String + arg: file + default: .scala_dependencies + description: "Set dependency tracking file." + - option: -deprecation + schema: + type: Boolean + description: "Emit warning and location for usages of deprecated APIs." + - option: -encoding + schema: + type: String + arg: encoding + default: Properties.sourceEncoding + description: "Specify character encoding used by source files." + - option: -explaintypes + schema: + type: Boolean + description: "Explain type errors in more detail." + - option: -feature + schema: + type: Boolean + description: "Emit warning and location for usages of features that should be imported explicitly." + - option: -g + schema: + type: Choice + arg: level + default: vars + description: "Set level of generated debugging info." + choices: + - choice: none + - choice: source + - choice: line + - choice: vars + - choice: notailcalls + - option: -help + schema: + type: Boolean + description: "Print a synopsis of standard options." + - option: -nowarn + schema: + type: Boolean + description: "Generate no warnings." + - option: -optimise + abbreviation: -optimize + schema: + type: Boolean + description: "Compiler flag for the optimizer in Scala 2.11." + deprecated: "In 2.12, `-optimise` enables `-opt:l:inline -opt-inline-from:**`. Check `-opt:help` for using the Scala 2.12 optimizer." + - option: -print + schema: + type: Boolean + description: "Print program with Scala-specific features removed." + - option: -target + scheam: + type: Choice + default: jvm-1.8 + description: "Target platform for object files. All JVM `1.5` - `1.7` targets are deprecated." + choices: + - choice: jvm-1.5 + - choice: jvm-1.6 + - choice: jvm-1.7 + - choice: jvm-1.8 + - option: -unchecked + schema: + type: Boolean + description: "Enable additional warnings where generated code depends on assumptions." + - option: -uniqid + schema: + type: Boolean + description: "Uniquely tag all identifiers in debugging output." + - option: -usejavacp + schema: + type: Boolean + description: "Utilize the `java.class.path` in classpath resolution." + - option: -usemanifestcp + schema: + type: Boolean + description: "Utilize the manifest in classpath resolution." + - option: -verbose + schema: + type: Boolean + description: "Output messages about what the compiler is doing." + - option: -version + schema: + type: Boolean + description: "Print product version and exit." + - option: -no-specialization + schema: + type: Boolean + description: "Ignore `@specialize` annotations." + - option: -language + schema: + type: Choice + multiple: true + arg: feat + description: "Enable or disable language features." + choices: + - choice: dynamics + description: "Allow direct or indirect subclasses of `scala.Dynamic`." + - choice: postfixOps + description: "Allow postfix operator notation, such as `1 to 10 toList`." + - choice: reflectiveCalls + description: "Allow reflective access to members of structural types." + - choice: implicitConversions + description: "Allow definition of implicit functions called views." + - choice: higherKinds + description: "Allow higher-kinded types." + - choice: existentials + description: "Existential types (besides wildcard types) can be written and inferred." + - choice: experimental.macros + description: "Allow macro definition (besides implementation and application." + - option: -release + schema: + type: String + arg: release + description: "Compile for a specific version of the Java platform. Supported targets: 6, 7, 8, 9." + + +- category: JVM Settings + description: "Settings influencing the runtime system." + options: + - option: -Jflag + schema: + type: Prefix + description: "Pass `flag` directly to the runtime system." + - option: -Dproperty=value + schema: + type: Prefix + description: "Pass `-Dproperty=value` directly to the runtime system." + - option: -nobootcp + schema: + type: Boolean + description: "Do not use the boot classpath for the scala jars." + + +- category: Plugin Settings + description: "" + options: + - option: -P + schema: + type: Prefix + arg: ":plugin:opt" + description: "Pass an option to a plugin in the form of `-P::`." + note: "If you use sbt, [compiler plugins support](https://www.scala-sbt.org/1.x/docs/Compiler-Plugins.html) may be useful." + + +- category: Advanced Settings + description: "Options that starts with `-X` are maybe renamed or removed in future releases." + options: + - option: -X + schema: + type: Boolean + description: "Print a synopsis of advanced options." + - option: -Xcheckinit + schema: + type: Boolean + description: "Wrap field accessors to throw an exception on uninitialized access." + - option: -Xdev + schema: + type: Boolean + description: "Indicates user is a developer - issue warnings about anything which seems amiss." + - option: -Xdisable-assertions + schema: + type: Boolean + description: "Generate no assertions or assumptions." + - option: -Xelide-below + schema: + type: Int + arg: min + default: Int.MinValue + description: "Calls to `@elidable` methods are omitted if method priority is lower than argument." + - option: -Xno-forwarders + schema: + type: Boolean + description: "Do not generate static forwarders in mirror classes." + - option: -Xgenerate-phase-graph + schema: + type: String + arg: file + description: "Generate the phase graphs (outputs .dot files) to fileX.dot." + - option: -Xlog-implicits + schema: + type: Boolean + description: "Show more detail on why some implicits are not applicable." + - option: -Xlog-implicit-conversions + schema: + type: Boolean + description: "Print a message whenever an implicit conversion is inserted." + - option: -Xlog-reflective-calls + schema: + type: Boolean + description: "Print a message when a reflective method call is generated." + - option: -Xlog-free-terms + schema: + type: Boolean + description: "Print a message when reification creates a free term." + - option: -Xlog-free-types + schema: + type: Boolean + description: "Print a message when reification resorts to generating a free type." + - option: -Xmax-classfile-name + schema: + type: Int + arg: max + default: 255 + min: 72 + max: 255 + description: "Maximum filename length for generated classes." + - option: -Xmaxerrs + schema: + type: Int + arg: max + default: 100 + description: "Maximum errors to print." + - option: -Xmaxwarns + schema: + type: Int + arg: max + default: 100 + description: "Maximum warnings to print." + - option: -Xmigration + schema: + type: ScalaVersion + arg: version + default: any + description: "Warn about constructs whose behavior may have changed since version." + - option: -Xno-uescape + schema: + type: Boolean + description: "Disable handling of \\u unicode escapes." + - option: -Xnojline + schema: + type: Boolean + description: "Do not use JLine for editing." + - option: -Xverify + schema: + type: Boolean + description: "Verify generic signatures in generated bytecode." + - option: -Xplugin + schema: + type: String + multiple: true + arg: path + description: "Load a plugin from each classpath." + - option: -Xplugin-disable + schema: + type: String + multiple: true + arg: plugin + description: "Disable plugins by name." + - option: -Xplugin-list + schema: + type: Boolean + description: "Print a synopsis of loaded plugins." + - option: -Xplugin-require + schema: + type: String + multiple: true + arg: plugin + description: "Abort if a named plugin is not loaded." + - option: -Xpluginsdir + schema: + type: String + arg: path + default: Defaults.scalaPluginPath + description: "Path to search for plugin archives." + - option: -Xprint + schema: + type: Phases + arg: phases + description: "Print out program after PHASES (see [Compilation Phases](#compilation-phases))" + - option: -Xprint-pos + schema: + type: Boolean + description: "Print tree positions, as offsets." + - option: -Xprint-types + schema: + type: Boolean + description: "Print tree types (debugging option)." + - option: -Xprint-args + schema: + type: Boolean + description: "Print all compiler arguments and exit." + - option: -Xprompt + schema: + type: Boolean + description: "Display a prompt after each error (debugging option)." + - option: -Xresident + schema: + type: Boolean + description: "Compiler stays resident: read source filenames from standard input." + - option: -Xscript + schema: + type: String + arg: object + description: "Treat the source file as a script and wrap it in a main method." + - option: -Xmain-class + schema: + type: String + arg: path + description: "Class for manifest's Main-Class entry (only useful with `-d `)" + - option: -Xshow-class + schema: + type: String + arg: class + description: "Show internal representation of class." + - option: -Xshow-object + schema: + type: String + arg: object + description: "Show internal representation of object." + - option: -Xshow-phases + schema: + type: Boolean + description: "Print a synopsis of compiler phases." + - option: -Xsource-reader + schema: + type: String + arg: classname + description: "Specify a custom method for reading source files." + - option: -Xreporter + schema: + type: String + arg: classname + default: scala.tools.nsc.reporters.ConsoleReporter + description: "Specify a custom reporter for compiler messages." + - option: -Xstrict-inference + schema: + type: Boolean + description: "Don't infer known-unsound types." + - option: -Xsource + schema: + type: Scala Version + arg: version + default: 2.13 + description: "Treat compiler input as Scala source for the specified version, see [scala/bug#8126](https://github.com/scala/bug/issues/8126)." + - option: -Xno-patmat-analysis + schema: + type: Boolean + description: "Don't perform exhaustivity/unreachability analysis. Also, ignore `@switch` annotation." + - option: -Xfull-lubs + schema: + type: Boolean + description: "Retains pre 2.10 behavior of less aggressive truncation of least upper bounds." + - option: -Xmixin-force-forwarders + schema: + type: Choice + arg: mode + default: true + description: "Generate forwarder methods in classes inhering concrete methods from traits." + choices: + - choice: true + description: "Always generate mixin forwarders." + - choice: junit + description: "Generate mixin forwarders for JUnit-annotated methods (JUnit 4 does not support default methods)." + - choice: false + description: "Only generate mixin forwarders required for program correctness." + - option: -Xxml + schema: + type: Choice + arg: property + description: "Configure XML parsing." + choices: + - choice: coalescing + description: "Convert PCData to Text and coalesce sibling nodes." + + + +- category: Private Settings + description: | + Options with `-Y` prefix are more experimental and unstable than those with `-X` prefix. + + Those influencing to language semantics are likely to be deprecated in Scala 2.13 (see [scala/scala-dev#430](https://github.com/scala/scala-dev/issues/430)). + + Some optimization-related options, e.g. `-opt:**` and `-opt-inline-form` are included in this section, since **REASON_HERE**. + options: + - option: -Y + schema: + type: Boolean + description: "Print a synopsis of private options." + - option: -Yoverride-objects + schema: + type: Boolean + description: "Allow member objects to be overridden." + - option: -Yoverride-vars + schema: + type: Boolean + description: "Allow vars to be overridden." + - option: -Ybreak-cycles + schema: + type: Boolean + description: "Attempt to break cycles encountered during typing." + - option: -Ybrowse + schema: + type: Phases + arg: phases + description: "Browse the abstract syntax tree after PHASES (see [Compilation Phases](#compilation-phases))" + - option: -Ycheck + schema: + type: Phases + arg: phases + description: "Check the tree at the end of PHASES (see [Compilation Phases](#compilation-phases))" + - option: -Yshow + schema: + type: Phases + arg: phases + description: "(Requires `-Xshow-class` or `-Xshow-object`) Show after PHASES (see [Compilation Phases](#compilation-phases))" + - option: -Ycompact-trees + schema: + type: Boolean + description: "Use compact tree printer when displaying trees." + - option: -Yno-completion + schema: + type: Boolean + description: "Disable tab-completion in the REPL." + - option: -Ydebug + schema: + type: Boolean + description: "Increase the quantity of debugging output." + - option: -Yresolve-term-conflict + schema: + type: Choice + arg: strategy + default: error + description: "Resolve term conflicts." + choices: + - choice: package + - choice: object + - choice: error + - option: -Ylog + schema: + type: Phases + arg: phases + description: "Log operations during PHASES (see [Compilation Phases](#compilation-phases))" + - option: -Ylog-classpath + schema: + type: Boolean + description: "Output information about what classpath is being applied." + - option: -Yno-generic-signatures + schema: + type: Boolean + description: "Suppress generation of generic signatures for Java." + - option: -Yno-imports + schema: + type: Boolean + description: "Compile without importing scala.*, java.lang.*, or Predef." + - option: -Yno-predef + schema: + type: Boolean + description: "Compile without importing Predef." + - option: -Yno-adapted-args + schema: + type: Boolean + description: "Do not adapt an argument list (either by inserting () or creating a tuple) to match the receiver." + - option: -Yrecursion + schema: + type: Int + arg: depth + default: 0 + min: 0 + max: Int.MaxValue + description: "Set recursion depth used when locking symbols." + - option: -Yshow-trees + schema: + type: Boolean + description: "(Requires `-Xprint:`) Print detailed ASTs in formatted form." + - option: -Yshow-trees-compact + schema: + type: Boolean + description: "(Requires `-Xprint:`) Print detailed ASTs in compact form." + - option: -Yshow-trees-stringified + schema: + type: Boolean + description: "(Requires `-Xprint:`) Print stringifications along with detailed ASTs." + - option: -Yshow-syms + schema: + type: Boolean + description: "Print the AST symbol hierarchy after each phase." + - option: -Yshow-symkinds + schema: + type: Boolean + description: "Print abbreviated symbol kinds next to symbol names." + - option: -Yshow-symowners + schema: + type: Boolean + description: "Print owner identifiers next to symbol names." + - option: -Yskip + schema: + type: Phases + arg: phases + description: "Skip PHASES (see [Compilation Phases](#compilation-phases))" + - option: -Ygen-asmp + schema: + type: String + arg: dir + description: "Generate a parallel output directory of .asmp files (ie ASM Textifier output)." + - option: -Ydump-classes + schema: + type: String + arg: dir + description: "Dump the generated bytecode to .class files (useful for reflective compilation that utilizes in-memory classloaders)." + - option: -Ystop-after + abbreviation: -stop + schema: + type: Phases + arg: phases + description: "Stop after PHASES (see [Compilation Phases](#compilation-phases))" + - option: -Ystop-before + schema: + type: Phases + arg: phases + description: "Stop before PHASES (see [Compilation Phases](#compilation-phases))" + - option: -Yrangepos + schema: + type: Boolean + description: "Use range positions for syntax trees." + - option: -Yshow-member-pos + schema: + type: String + arg: style + description: "Show start and end positions of members." + note: "`-Yrangepos` is enabled at the same time." + - option: -Yreify-copypaste + schema: + type: Boolean + description: "Dump the reified trees in copypasteable representation." + - option: -Ymacro-expand + schema: + type: Choice + arg: policy + default: normal + description: "Control expansion of macros, useful for scaladoc and presentation compiler." + choices: + - choice: none + - choice: normal + - choice: discard + - option: -Ymacro-no-expand + schema: + type: Boolean + description: "Don't expand macros. Might be useful for scaladoc and presentation compiler, but will crash anything which uses macros and gets past typer." + deprecated: "Use `-Ymacro-expand:none` instead." + - option: -Yrepl-sync + schema: + type: Boolean + description: "Do not use asynchronous code for REPL startup." + - option: -Yrepl-class-based + schema: + type: Boolean + description: "Use classes to wrap REPL snippets instead of objects." + - option: -Yrepl-outdir + schema: + type: String + arg: path + description: "Write repl-generated classfiles to given output directory (use \"\" to generate a temporary dir)" + - option: -Yinfer-argument-types + schema: + type: Boolean + description: "Infer types for arguments of overridden methods." + - option: -YdisableFlatCpCaching + schema: + type: Boolean + description: "Do not cache flat classpath representation of classpath elements from jars across compiler instances." + - option: -Yvirtpatmat + schema: + type: Boolean + description: "Enable pattern matcher virtualization." + - option: -Yexpose-empty-package +# TODO: internal only + internalOnly: true + schema: + type: Boolean + description: "Internal only: expose the empty package." + - option: -Ydelambdafy + schema: + type: Choice + arg: strategy + default: method + description: "Strategy used for translating lambdas into JVM code." + choices: + - choice: inline + - choice: method + - option: -Ybackend-parallelism + schema: + type: Int + arg: threads + default: 1 + min: 1 + max: 16 + description: "Maximum worker threads for backend." + - option: -Ybackend-worker-queue + description: "Backend threads worker queue size." + schema: + type: Int + arg: size + default: 0 + min: 0 + max: 1000 + - option: -Yjar-compression-level + schema: + type: Int + arg: level + default: Deflater.DEFAULT_COMPRESSION + min: Deflater.DEFAULT_COMPRESSION + max: Deflater.BEST_COMPRESSION + description: "Compression level to use when writing jar files." + - option: -Ycache-plugin-class-loader + schema: + type: Choice + default: none + description: "Policy for caching class loaders for compiler plugins that are dynamically loaded." + choices: + - choice: none + description: "Don't cache class loader." + - choice: last-modified + description: "Cache class loader, using file last-modified time to invalidate." + - option: -Ycache-macro-class-loader + schema: + type: Choice + default: none + description: "Policy for caching class loaders for macros that are dynamically loaded." + choices: + - choice: none + description: "Don't cache class loader." + - choice: last-modified + description: "Cache class loader, using file last-modified time to invalidate." + - option: -opt + schema: + type: Choice + multiple: true + description: "Enable optimizations. Check `-opt:help` for using the Scala 2.12 optimizer." + note: "if `inline` not contained and either `l:project` or `l:classpath` are contained, then `l:inline` is enabled." + choices: + - choice: unreachable-code + description: "Eliminate unreachable code, exception handlers guarding no instructions, redundant metadata (debug information, line numbers)." + - choice: simplify-jumps + description: "Simplify branching instructions, eliminate unnecessary ones." + - choice: compact-locals + description: "Eliminate empty slots in the sequence of local variables." + - choice: copy-propagation + description: "Eliminate redundant local variables and unused values (including closures). Enables unreachable-code." + - choice: redundant-casts + description: "Eliminate redundant casts using a type propagation analysis." + - choice: box-unbox + description: "Eliminate box-unbox pairs within the same method (also tuples, xRefs, value class instances). Enables unreachable-code." + - choice: "nullness-tracking" + description: "Track nullness / non-nullness of local variables and apply optimizations." + - choice: closure-invocations + description: "Rewrite closure invocations to the implementation method." + - choice: inline + description: "Inline method invocations according to `-Yopt-inline-heuristics` and `-opt-inline-from`." + - choice: l:none + description: "Disable optimizations. Takes precedence: `-opt:l:none,+box-unbox` / `-opt:l:none -opt:box-unbox` don't enable box-unbox." + note: "Unlike the other optimizer levels, `l:none` appears up in the `opt.value` set because it's not an expanding option." + - choice: l:default + description: "Enable default optimizations: `unreachable-code`." + - choice: l:method + description: "Enable intra-method optimizations: `unreachable-code`, `simplify-jumps`, `compact-locals`, `copy-propagation`, `redundant-casts`, `box-unbox`, `nullness-tracking`, `closure-invocations`." + - choice: l:inline + description: "Enable cross-method optimizations (note: inlining requires `-opt-inline-from`): `unreachable-code`, `simplify-jumps`, `compact-locals`, `copy-propagation`, `redundant-casts`, `box-unbox`, `nullness-tracking`, `closure-invocations`, `inline`." + - choice: l:project + description: "Enable cross-method optimizations within the current project." + deprecated: "Use `-opt:l:inline -opt-inline-from` instead." + - choice: l:classpath + description: "Enable cross-method optimizations across the entire classpath." + deprecated: "Use `-opt:l:inline -opt-inline-from` instead." + - option: -opt-inline-from + schema: + type: String + multiple: true + arg: pattern + description: "Patterns for classfile names from which to allow inlining, `help` for details." + - option: -Yopt-inline-heuristics + schema: + type: Choice + arg: strategy + default: default + description: "Set the heuristics for inlining decisions." + choices: + - choice: at-inline-annotated + - choice: everything + - choice: default + - option: -opt-warnings + schema: + type: Choice + multiple: true + default: at-inline-failed + description: "Enable optimizer warnings." + choices: + - choice: none + description: "No optimizer warnings." + - choice: at-inline-failed-summary + description: "One-line summary if there were `@inline` method calls that could not be inlined." + - choice: at-inline-failed + description: "A detailed warning for each `@inline` method call that could not be inlined." + - choice: any-inline-failed + description: "A detailed warning for every callsite that was chosen for inlining by the heuristics, but could not be inlined." + - choice: no-inline-mixed + description: "In mixed compilation, warn at callsites methods defined in java sources (the inlining decision cannot be made without bytecode)." + - choice: no-inline-missing-bytecode + description: "Warn if an inlining decision cannot be made because a the bytecode of a class or member cannot be found on the compilation classpath." + - choice: no-inline-missing-attribute + description: "Warn if an inlining decision cannot be made because a Scala classfile does not have a ScalaInlineInfo attribute." + - option: -Yopt-trace + schema: + type: String + arg: package/Class.method + description: "Trace the optimizer progress for methods; `_` to print all, prefix match to select." + - option: -Yopt-log-inline + schema: + type: String + arg: package/Class.method + description: "Print a summary of inliner activity; `_` to print all, prefix match to select." + - option: -Ystatistics + schema: + type: Phases + arg: phases + default: "parser,typer,patmat,erasure,cleanup,jvm" + description: "Print compiler statistics for specific phases. (see [Compilation Phases](#compilation-phases))" + - option: -Yhot-statistics-enabled + schema: + type: Boolean + description: "Enable `-Ystatistics` to print hot statistics." + - option: -Yprofile-enabled + schema: + type: Boolean + description: "Enable profiling." + - option: -Yprofile-destination + arg: file + schema: + type: String + description: "where to send profiling output - specify a file, default is to the console." + note: "`-Yprofile-enabled` is enabled at the same time." + - option: -Yprofile-external-tool + schema: + type: Phases + arg: phases + default: "typer" + description: "Enable profiling for a phase using an external tool hook. Generally only useful for a single phase." + note: "`-Yprofile-enabled` is enabled at the same time." + - option: -Yprofile-run-gc + schema: + type: Phases + arg: phases + default: "_" + description: "Run a GC between phases - this allows heap size to be accurate at the expense of more time. Specify a list of phases, or `all`." + note: "`-Yprofile-enabled` is enabled at the same time." +# Area-specific debug output. + - option: -Ydoc-debug + schema: + type: Boolean + description: "Trace all scaladoc activity." + - option: -Yide-debug + schema: + type: Boolean + description: "Generate, validate and output trees using the interactive compiler." + - option: -Yissue-debug + schema: + type: Boolean + description: "Print stack traces when a context issues an error." + - option: -Ymacro-debug-lite + schema: + type: Boolean + description: "Trace essential macro-related activities." + - option: -Ymacro-debug-verbose + schema: + type: Boolean + description: "Trace all macro-related activities: compilation, generation of synthetics, classloading, expansion, exceptions." + - option: -Ypos-debug + schema: + type: Boolean + description: "Trace position validation." + - option: -Yreify-debug + schema: + type: Boolean + description: "Trace reification." + - option: -Ytyper-debug + schema: + type: Boolean + description: "Trace all type assignments." + - option: -Ypatmat-debug + schema: + type: Boolean + description: "Trace pattern matching translation." + - option: -Ypatmat-exhaust-depth + schema: + type: Int + arg: off + default: 20 + min: 10 + max: Int.MaxValue + description: "off" + - option: -Yquasiquote-debug + schema: + type: Boolean + description: "Trace quasiquote-related activities." +# Groups of Settings. + - option: -Xfuture + schema: + type: Boolean + description: "Turn on future language features." + enablingIfNotSetByUser: futureSettings + - option: -Xexperimental + schema: + type: Boolean + description: "Enable experimental extensions in Scala 2.12 and earlier." + deprecated: "In 2.13 all options previously enabled by `-Xexperimental` are enabled by default or removed." + - option : -Xmacro-settings + schema: + type: String + multiple: true + description: "Custom settings for macros." +# * IDE-specific settings + - option: -Ypresentation-verbose + schema: + type: Boolean + description: "Print information about presentation compiler tasks." + - option: -Ypresentation-debug + schema: + type: Boolean + description: "Enable debugging output for the presentation compiler." + - option: -Ypresentation-any-thread + schema: + type: Boolean + description: "Allow use of the presentation compiler from any thread." + - option: -Ypresentation-strict + schema: + type: Boolean + description: "Do not report type errors in sources with syntax errors." + - option: -Ypresentation-log + schema: + type: String + arg: file + description: "Log presentation compiler events into file." + - option: -Ypresentation-replay + schema: + type: String + arg: file + description: "Replay presentation compiler events from file." + - option: -Ypresentation-delay + schema: + type: Int + arg: miliseconds + default: 0 + min: 0 + max: 999 + description: "Wait number of ms after typing before starting typechecking." + + + +- category: Warning Settings + description: "This section assembles the `-X` and `-Y` options those influence the printing of warnings." + options: + - option: -Xfatal-warnings + schema: + type: Boolean + description: "Fail the compilation if there are any warnings." + - option: -Ywarn-macros + schema: + type: Choice + arg: mode + description: "Enable lint warnings on macro expansions." + choices: + - choice: none + description: "Do not inspect expansions or their original trees when generating unused symbol warnings." + - choice: before + description: "Only inspect unexpanded user-written code for unused symbols." + - choice: after + description: "Only inspect expanded trees when generating unused symbol warnings." + - choice: both + description: "Inspect both user-written code and expanded trees when generating unused symbol warnings." + - option: -Ywarn-dead-code + schema: + type: Boolean + description: "Warn when dead code is identified." + - option: -Ywarn-value-discard + schema: + type: Boolean + description: "Warn when non-Unit expression results are unused." + note: "To reduce noises for common idiom, warning are suppressed if type of results are `this.type`." + - option: -Ywarn-numeric-widen + schema: + type: Boolean + description: "Warn when numerics are widened." + - option: -Ywarn-unused + schema: + type: Choice + multiple: true + arg: warn + default: _ + description: "Enable or disable specific `unused` warnings." + choices: + - choice: imports + description: "Warn if an import selector is not referenced." + - choice: patvars + description: "Warn if a variable bound in a pattern is unused." + - choice: privates + description: "Warn if a private member is unused." + - choice: locals + description: "Warn if a local definition is unused." + - choice: explicits + description: "Warn if an explicit parameter is unused." + - choice: implicits + description: "Warn if an implicit parameter is unused." + - choice: params + description: "Enable `-Ywarn-unused:explicits,implicits`." + - choice: linted + description: "Enable `-Ywarn-unused:imports,privates,locals,implicits`." + note: "Alias is `-Xlint:unused`." + - option: -Ywarn-unused-import + schema: + type: Boolean + description: "Warn when imports are unused." + - option: -Ywarn-extra-implicit + schema: + type: Boolean + description: "Warn when more than one implicit parameter section is defined." + - option: -Ywarn-self-implicit + schema: + type: Boolean + description: "Warn when an implicit resolves to an enclosing self-definition." + - option: -Xlint + schema: + type: Choice + multiple: true + arg: warn + default: _ + description: "Enable or disable specific warnings." + note: "If this options contains `unused`, it enables `-Ywarn-unused:linted`. Otherwise it disables `-Ywarn-unused:linted`." + choices: + - choice: adapted-args + description: "Warn if an argument list is modified to match the receiver." + note: "Alias is `-Ywarn-adapted-args`." + - choice: nullary-unit + description: "Warn when nullary methods return Unit." + note: "Alias is `-Ywarn-nullary-unit`." + - choice: inaccessible + description: "Warn about inaccessible types in method signatures." + note: "Alias is `-Ywarn-inaccessible`." + - choice: nullary-override + description: "Warn when non-nullary `def f()` overrides nullary `def f`." + note: "Alias is `-Ywarn-nullary-override`." + - choice: infer-any + description: "Warn when a type argument is inferred to be `Any`." + note: "Alias is `-Ywarn-infer-any`." + - choice: missing-interpolator + description: "A string literal appears to be missing an interpolator id." + - choice: doc-detached + description: "A Scaladoc comment appears to be detached from its element." + - choice: private-shadow + description: "A private field (or class parameter) shadows a superclass field." + - choice: type-parameter-shadow + description: "A local type parameter shadows a type already in scope." + - choice: poly-implicit-overload + description: "Parameterized overloaded implicit methods are not visible as view bounds." + - choice: option-implicit + description: "Option.apply used implicit view." + - choice: delayedinit-select + description: "Selecting member of DelayedInit." + - choice: by-name-right-associative + description: "By-name parameter of right associative operator." + - choice: package-object-classes + description: "Class or object defined in package object." + - choice: unsound-match + description: "Pattern match may not be typesafe." + - choice: stars-align + description: "Pattern sequence wildcard must align with sequence component." + - choice: constant + description: "Evaluation of a constant arithmetic expression results in an error." + - choice: unused + description: "Enable `-Ywarn-unused:imports,privates,locals,implicits`." diff --git a/_data/overviews.yml b/_data/overviews.yml index 005309a7de..302ee78af2 100644 --- a/_data/overviews.yml +++ b/_data/overviews.yml @@ -226,6 +226,12 @@ icon: puzzle-piece url: "plugins/index.html" description: "Compiler plugins permit customizing and extending the Scala compiler. This tutorial describes the plugin facility and walks you through how to create a simple plugin." + - title: Compiler Options + by: Community + icon: cog + url: "compiler-options/index.html" + description: "Various options to control how scalac compiles your code." + - category: Legacy description: "Guides covering features no longer relevant to recent Scala versions (2.11+)." diff --git a/_overviews/compiler-options/index.md b/_overviews/compiler-options/index.md new file mode 100644 index 0000000000..ae2ac68c17 --- /dev/null +++ b/_overviews/compiler-options/index.md @@ -0,0 +1,181 @@ +--- +layout: singlepage-overview +title: Scala Compiler Options + +discourse: true +--- + + + + +## Introduction + +Scala compiler `scalac` offers various **compiler options**, also referred as **compiler flags**, to change how to compile your program. + +Nowadays, most people are not running scalac from the command line. +Instead, they use sbt, IDE, and other tools as their interface to the compiler. +Therefore they may not even have scalac installed, and won't think to do `man scalac`. + +This page come to the rescue for the people to find... + +* What compiler options scalac offers +* How to use compiler option + + +## How to use compiler options + +### Use compiler option with scalac + +```bash +scalac [ ] +``` + +E.g. `scalac -encoding utf8 -Xfalta-warnings Hello.scala` + + + +### Use compiler option with sbt + + + +```scala +scalacOptions ++= Seq( + "-encoding", "utf8", // Option and arguments on same line + "-Xfatal-warnings", // New lines for each options + "-deprecation", + "-unchecked", + "-language:implicitConversions", + "-language:higherKinds", + "-language:existentials", + "-language:postfixOps" +) +``` + + + +{% for category in site.data.compiler-options %} +

{{ category.category }}

+{% if category.description %}{{ category.description | markdownify }}{% endif %} + +
+{% for option in category.options %} + {% capture option_argument_separator %}{% if option.schema.type contains "Choice" %}:{% else %} {% endif %}{% endcapture %} + {% capture option_argument_placeholder %}{% if option.schema.arg %}{{ option.schema.arg | upcase }}{% else %}ARG{% endif %}{% endcapture %} + {% capture option_argument %}{% if option.schema.type != "Boolean" and option.schema.type != "Prefix" %}{{ option_argument_separator }}{{ option_argument_placeholder }}{% if option.schema.multiple %}1,{{ option_argument_placeholder }}2{% endif %}{% endif %}{% endcapture %} +
+ {{ option.option | xml_escape }}{{ option_argument }} + {% if option.abbreviation %} or {{ option.abbreviation | xml_escape }}{{ option_argument }}{% endif %} +
+ {% if option.deprecated %}
Deprecated: {{ option.deprecated | markdownify | remove: '

' | remove: '

'}}
{% endif %} +
+ {{ option.description | markdownify }} + {% if option.schema.default %}Default: {{ option.schema.default | xml_escape }}
{% endif %} + {% if option.schema.min %}Min: {{ option.schema.min }}
{% endif %} + {% if option.schema.max %}Max: {{ option.schema.max }}
{% endif %} +
+ {% if option.note %}
Note: {{ option.note | markdownify | remove: '

' | remove: '

'}}
{% endif %} + {% if option.choices %} +
+
+ + {% for choice in option.choices %} +
{{ option.option | xml_escape }}{{ option_argument_separator }}{{ choice.choice | xml_escape }}
+ {% if choice.deprecated %}
Deprecated: {{ choice.deprecated | markdownify | remove: '

' | remove: '

'}}
{% endif %} + {% if choice.description %}
{{ choice.description | markdownify}}
{% endif %} + {% if choice.note %}
Note: {{ choice.note | markdownify | remove: '

' | remove: '

'}}
{% endif %} + {% endfor %} +
+
+ {% endif %} +{% endfor %} +
+ +{% endfor %} + + +## Additional resources + +### Compilation Phases + +
+
initial
+
initializing compiler
+ +
parse
+
parse source files
+ +
namer
+
create symbols
+ +
analyze
+
name and type analysis
+ +
refcheck
+
reference checking
+ +
uncurry
+
uncurry function types and applications
+ +
lambdalift
+
lambda lifter
+ +
typesasvalues
+
represent types as values
+ +
addaccessors
+
add accessors for constructor arguments
+ +
explicitouterclasses
+
make links from inner classes to enclosing one explicit
+ +
addconstructors
+
add explicit constructor for each class
+ +
tailcall
+
add tail-calls
+ +
wholeprog
+
perform whole program analysis
+ +
addinterfaces
+
add one interface per class
+ +
expandmixins
+
expand mixins by code copying
+ +
boxing
+
makes boxing explicit
+ +
erasure
+
type eraser
+ +
icode
+
generate icode
+ +
codegen
+
enable code generation
+ +
terminal
+
compilation terminated
+ +
all
+
matches all phases
+
+ \ No newline at end of file diff --git a/_sass/layout/type-md.scss b/_sass/layout/type-md.scss index 0964604b1a..38b09dbbd4 100755 --- a/_sass/layout/type-md.scss +++ b/_sass/layout/type-md.scss @@ -141,7 +141,11 @@ } li, - p { + p, + tr, + td, + dt, + dd { code { font-family: 'Consolas'; @include border-radius($border-radius-small); From f2c5cc229f89b249f75ec3b9fc2decfb3be12c85 Mon Sep 17 00:00:00 2001 From: exoego Date: Tue, 1 May 2018 22:13:52 +0900 Subject: [PATCH 02/12] Fix typo --- _overviews/compiler-options/index.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/_overviews/compiler-options/index.md b/_overviews/compiler-options/index.md index ae2ac68c17..3e65a94511 100644 --- a/_overviews/compiler-options/index.md +++ b/_overviews/compiler-options/index.md @@ -47,7 +47,7 @@ This page come to the rescue for the people to find... scalac [ ] ``` -E.g. `scalac -encoding utf8 -Xfalta-warnings Hello.scala` +E.g. `scalac -encoding utf8 -Xfatal-warnings Hello.scala` From 4f8eb61187f1eba3e256b004edcebb3f6fefd398 Mon Sep 17 00:00:00 2001 From: exoego Date: Wed, 2 May 2018 22:43:02 +0900 Subject: [PATCH 03/12] Move choices to schema since choices are valid for some types. --- _data/compiler-options.yml | 178 +++++++++++++-------------- _overviews/compiler-options/index.md | 4 +- 2 files changed, 91 insertions(+), 91 deletions(-) diff --git a/_data/compiler-options.yml b/_data/compiler-options.yml index 3d812c877d..37b1d077d3 100644 --- a/_data/compiler-options.yml +++ b/_data/compiler-options.yml @@ -66,13 +66,13 @@ type: Choice arg: level default: vars - description: "Set level of generated debugging info." - choices: + choices: - choice: none - choice: source - choice: line - choice: vars - choice: notailcalls + description: "Set level of generated debugging info." - option: -help schema: type: Boolean @@ -95,12 +95,12 @@ scheam: type: Choice default: jvm-1.8 - description: "Target platform for object files. All JVM `1.5` - `1.7` targets are deprecated." - choices: + choices: - choice: jvm-1.5 - choice: jvm-1.6 - choice: jvm-1.7 - choice: jvm-1.8 + description: "Target platform for object files. All JVM `1.5` - `1.7` targets are deprecated." - option: -unchecked schema: type: Boolean @@ -134,8 +134,7 @@ type: Choice multiple: true arg: feat - description: "Enable or disable language features." - choices: + choices: - choice: dynamics description: "Allow direct or indirect subclasses of `scala.Dynamic`." - choice: postfixOps @@ -150,6 +149,7 @@ description: "Existential types (besides wildcard types) can be written and inferred." - choice: experimental.macros description: "Allow macro definition (besides implementation and application." + description: "Enable or disable language features." - option: -release schema: type: String @@ -388,22 +388,22 @@ type: Choice arg: mode default: true - description: "Generate forwarder methods in classes inhering concrete methods from traits." - choices: + choices: - choice: true description: "Always generate mixin forwarders." - choice: junit description: "Generate mixin forwarders for JUnit-annotated methods (JUnit 4 does not support default methods)." - choice: false description: "Only generate mixin forwarders required for program correctness." + description: "Generate forwarder methods in classes inhering concrete methods from traits." - option: -Xxml schema: type: Choice arg: property - description: "Configure XML parsing." - choices: + choices: - choice: coalescing description: "Convert PCData to Text and coalesce sibling nodes." + description: "Configure XML parsing." @@ -463,11 +463,11 @@ type: Choice arg: strategy default: error - description: "Resolve term conflicts." - choices: + choices: - choice: package - choice: object - choice: error + description: "Resolve term conflicts." - option: -Ylog schema: type: Phases @@ -570,11 +570,11 @@ type: Choice arg: policy default: normal - description: "Control expansion of macros, useful for scaladoc and presentation compiler." - choices: + choices: - choice: none - choice: normal - choice: discard + description: "Control expansion of macros, useful for scaladoc and presentation compiler." - option: -Ymacro-no-expand schema: type: Boolean @@ -616,10 +616,10 @@ type: Choice arg: strategy default: method - description: "Strategy used for translating lambdas into JVM code." - choices: + choices: - choice: inline - choice: method + description: "Strategy used for translating lambdas into JVM code." - option: -Ybackend-parallelism schema: type: Int @@ -648,29 +648,27 @@ schema: type: Choice default: none - description: "Policy for caching class loaders for compiler plugins that are dynamically loaded." - choices: + choices: - choice: none description: "Don't cache class loader." - choice: last-modified description: "Cache class loader, using file last-modified time to invalidate." + description: "Policy for caching class loaders for compiler plugins that are dynamically loaded." - option: -Ycache-macro-class-loader schema: type: Choice default: none - description: "Policy for caching class loaders for macros that are dynamically loaded." - choices: + choices: - choice: none description: "Don't cache class loader." - choice: last-modified description: "Cache class loader, using file last-modified time to invalidate." + description: "Policy for caching class loaders for macros that are dynamically loaded." - option: -opt schema: type: Choice multiple: true - description: "Enable optimizations. Check `-opt:help` for using the Scala 2.12 optimizer." - note: "if `inline` not contained and either `l:project` or `l:classpath` are contained, then `l:inline` is enabled." - choices: + choices: - choice: unreachable-code description: "Eliminate unreachable code, exception handlers guarding no instructions, redundant metadata (debug information, line numbers)." - choice: simplify-jumps @@ -704,6 +702,8 @@ - choice: l:classpath description: "Enable cross-method optimizations across the entire classpath." deprecated: "Use `-opt:l:inline -opt-inline-from` instead." + description: "Enable optimizations. Check `-opt:help` for using the Scala 2.12 optimizer." + note: "if `inline` not contained and either `l:project` or `l:classpath` are contained, then `l:inline` is enabled." - option: -opt-inline-from schema: type: String @@ -715,18 +715,17 @@ type: Choice arg: strategy default: default - description: "Set the heuristics for inlining decisions." - choices: + choices: - choice: at-inline-annotated - choice: everything - choice: default + description: "Set the heuristics for inlining decisions." - option: -opt-warnings schema: type: Choice multiple: true default: at-inline-failed - description: "Enable optimizer warnings." - choices: + choices: - choice: none description: "No optimizer warnings." - choice: at-inline-failed-summary @@ -741,6 +740,7 @@ description: "Warn if an inlining decision cannot be made because a the bytecode of a class or member cannot be found on the compilation classpath." - choice: no-inline-missing-attribute description: "Warn if an inlining decision cannot be made because a Scala classfile does not have a ScalaInlineInfo attribute." + description: "Enable optimizer warnings." - option: -Yopt-trace schema: type: String @@ -899,8 +899,7 @@ schema: type: Choice arg: mode - description: "Enable lint warnings on macro expansions." - choices: + choices: - choice: none description: "Do not inspect expansions or their original trees when generating unused symbol warnings." - choice: before @@ -909,6 +908,7 @@ description: "Only inspect expanded trees when generating unused symbol warnings." - choice: both description: "Inspect both user-written code and expanded trees when generating unused symbol warnings." + description: "Enable lint warnings on macro expansions." - option: -Ywarn-dead-code schema: type: Boolean @@ -928,25 +928,25 @@ multiple: true arg: warn default: _ + choices: + - choice: imports + description: "Warn if an import selector is not referenced." + - choice: patvars + description: "Warn if a variable bound in a pattern is unused." + - choice: privates + description: "Warn if a private member is unused." + - choice: locals + description: "Warn if a local definition is unused." + - choice: explicits + description: "Warn if an explicit parameter is unused." + - choice: implicits + description: "Warn if an implicit parameter is unused." + - choice: params + description: "Enable `-Ywarn-unused:explicits,implicits`." + - choice: linted + description: "Enable `-Ywarn-unused:imports,privates,locals,implicits`." + note: "Alias is `-Xlint:unused`." description: "Enable or disable specific `unused` warnings." - choices: - - choice: imports - description: "Warn if an import selector is not referenced." - - choice: patvars - description: "Warn if a variable bound in a pattern is unused." - - choice: privates - description: "Warn if a private member is unused." - - choice: locals - description: "Warn if a local definition is unused." - - choice: explicits - description: "Warn if an explicit parameter is unused." - - choice: implicits - description: "Warn if an implicit parameter is unused." - - choice: params - description: "Enable `-Ywarn-unused:explicits,implicits`." - - choice: linted - description: "Enable `-Ywarn-unused:imports,privates,locals,implicits`." - note: "Alias is `-Xlint:unused`." - option: -Ywarn-unused-import schema: type: Boolean @@ -965,47 +965,47 @@ multiple: true arg: warn default: _ + choices: + - choice: adapted-args + description: "Warn if an argument list is modified to match the receiver." + note: "Alias is `-Ywarn-adapted-args`." + - choice: nullary-unit + description: "Warn when nullary methods return Unit." + note: "Alias is `-Ywarn-nullary-unit`." + - choice: inaccessible + description: "Warn about inaccessible types in method signatures." + note: "Alias is `-Ywarn-inaccessible`." + - choice: nullary-override + description: "Warn when non-nullary `def f()` overrides nullary `def f`." + note: "Alias is `-Ywarn-nullary-override`." + - choice: infer-any + description: "Warn when a type argument is inferred to be `Any`." + note: "Alias is `-Ywarn-infer-any`." + - choice: missing-interpolator + description: "A string literal appears to be missing an interpolator id." + - choice: doc-detached + description: "A Scaladoc comment appears to be detached from its element." + - choice: private-shadow + description: "A private field (or class parameter) shadows a superclass field." + - choice: type-parameter-shadow + description: "A local type parameter shadows a type already in scope." + - choice: poly-implicit-overload + description: "Parameterized overloaded implicit methods are not visible as view bounds." + - choice: option-implicit + description: "Option.apply used implicit view." + - choice: delayedinit-select + description: "Selecting member of DelayedInit." + - choice: by-name-right-associative + description: "By-name parameter of right associative operator." + - choice: package-object-classes + description: "Class or object defined in package object." + - choice: unsound-match + description: "Pattern match may not be typesafe." + - choice: stars-align + description: "Pattern sequence wildcard must align with sequence component." + - choice: constant + description: "Evaluation of a constant arithmetic expression results in an error." + - choice: unused + description: "Enable `-Ywarn-unused:imports,privates,locals,implicits`." description: "Enable or disable specific warnings." note: "If this options contains `unused`, it enables `-Ywarn-unused:linted`. Otherwise it disables `-Ywarn-unused:linted`." - choices: - - choice: adapted-args - description: "Warn if an argument list is modified to match the receiver." - note: "Alias is `-Ywarn-adapted-args`." - - choice: nullary-unit - description: "Warn when nullary methods return Unit." - note: "Alias is `-Ywarn-nullary-unit`." - - choice: inaccessible - description: "Warn about inaccessible types in method signatures." - note: "Alias is `-Ywarn-inaccessible`." - - choice: nullary-override - description: "Warn when non-nullary `def f()` overrides nullary `def f`." - note: "Alias is `-Ywarn-nullary-override`." - - choice: infer-any - description: "Warn when a type argument is inferred to be `Any`." - note: "Alias is `-Ywarn-infer-any`." - - choice: missing-interpolator - description: "A string literal appears to be missing an interpolator id." - - choice: doc-detached - description: "A Scaladoc comment appears to be detached from its element." - - choice: private-shadow - description: "A private field (or class parameter) shadows a superclass field." - - choice: type-parameter-shadow - description: "A local type parameter shadows a type already in scope." - - choice: poly-implicit-overload - description: "Parameterized overloaded implicit methods are not visible as view bounds." - - choice: option-implicit - description: "Option.apply used implicit view." - - choice: delayedinit-select - description: "Selecting member of DelayedInit." - - choice: by-name-right-associative - description: "By-name parameter of right associative operator." - - choice: package-object-classes - description: "Class or object defined in package object." - - choice: unsound-match - description: "Pattern match may not be typesafe." - - choice: stars-align - description: "Pattern sequence wildcard must align with sequence component." - - choice: constant - description: "Evaluation of a constant arithmetic expression results in an error." - - choice: unused - description: "Enable `-Ywarn-unused:imports,privates,locals,implicits`." diff --git a/_overviews/compiler-options/index.md b/_overviews/compiler-options/index.md index 3e65a94511..47536e5036 100644 --- a/_overviews/compiler-options/index.md +++ b/_overviews/compiler-options/index.md @@ -91,11 +91,11 @@ scalacOptions ++= Seq( {% if option.schema.max %}Max: {{ option.schema.max }}
{% endif %} {% if option.note %}
Note: {{ option.note | markdownify | remove: '

' | remove: '

'}}
{% endif %} - {% if option.choices %} + {% if option.schema.choices %}
- {% for choice in option.choices %} + {% for choice in option.schema.choices %}
{{ option.option | xml_escape }}{{ option_argument_separator }}{{ choice.choice | xml_escape }}
{% if choice.deprecated %}
Deprecated: {{ choice.deprecated | markdownify | remove: '

' | remove: '

'}}
{% endif %} {% if choice.description %}
{{ choice.description | markdownify}}
{% endif %} From c0b8084b6d6d137ea0c9f66d73d185e14be87981 Mon Sep 17 00:00:00 2001 From: exoego Date: Thu, 3 May 2018 06:28:59 +0900 Subject: [PATCH 04/12] Add quotes so that number and string can be distinguished --- _data/compiler-options.yml | 1022 ++++++++++++++++++------------------ 1 file changed, 510 insertions(+), 512 deletions(-) diff --git a/_data/compiler-options.yml b/_data/compiler-options.yml index 37b1d077d3..2d7d50d35c 100644 --- a/_data/compiler-options.yml +++ b/_data/compiler-options.yml @@ -1,413 +1,412 @@ -- category: Standard Settings +- category: "Standard Settings" description: "A set of standard options that are supported on the current development environment and will be supported in future releases." options: # Path related settings. - - option: -classpath - abbreviation: -cp + - option: "-classpath" + abbreviation: "-cp" schema: - type: Path - arg: path + type: "Path" + arg: "path" description: "Specify where to find user class files." - - option: -bootclasspath + - option: "-bootclasspath" schema: - type: Path - arg: path - default: Defaults.scalaBootClassPath + type: "Path" + arg: "path" + default: "Defaults.scalaBootClassPath" description: "Override location of bootstrap class files." - - option: -extdirs + - option: "-extdirs" schema: - type: Path - arg: path - default: Defaults.scalaExtDirs + type: "Path" + arg: "path" + default: "Defaults.scalaExtDirs" description: "Override location of installed extensions." - - option: -javabootclasspath + - option: "-javabootclasspath" schema: - type: Path - arg: path - default: Defaults.javaBootClassPath + type: "Path" + arg: "path" + default: "Defaults.javaBootClassPath" description: "Override java boot classpath." - - option: -javaextdirs + - option: "-javaextdirs" schema: - type: Path - arg: path - default: Defaults.javaExtDirs + type: "Path" + arg: "path" + default: "Defaults.javaExtDirs" description: "Override java extdirs classpath." - - option: -sourcepath + - option: "-sourcepath" schema: - type: Path + type: "Path" description: "Specify location(s) of source files." -# other settings - - option: -dependencyfile + - option: "-dependencyfile" schema: - type: String - arg: file - default: .scala_dependencies + type: "String" + arg: "file" + default: ".scala_dependencies" description: "Set dependency tracking file." - - option: -deprecation + - option: "-deprecation" schema: - type: Boolean + type: "Boolean" description: "Emit warning and location for usages of deprecated APIs." - - option: -encoding + - option: "-encoding" schema: - type: String - arg: encoding - default: Properties.sourceEncoding + type: "String" + arg: "encoding" + default: "Properties.sourceEncoding" description: "Specify character encoding used by source files." - - option: -explaintypes + - option: "-explaintypes" schema: - type: Boolean + type: "Boolean" description: "Explain type errors in more detail." - - option: -feature + - option: "-feature" schema: - type: Boolean + type: "Boolean" description: "Emit warning and location for usages of features that should be imported explicitly." - - option: -g + - option: "-g" schema: - type: Choice - arg: level - default: vars + type: "Choice" + arg: "level" + default: "vars" choices: - - choice: none - - choice: source - - choice: line - - choice: vars - - choice: notailcalls + - choice: "none" + - choice: "source" + - choice: "line" + - choice: "vars" + - choice: "notailcalls" description: "Set level of generated debugging info." - - option: -help + - option: "-help" schema: - type: Boolean + type: "Boolean" description: "Print a synopsis of standard options." - - option: -nowarn + - option: "-nowarn" schema: - type: Boolean + type: "Boolean" description: "Generate no warnings." - - option: -optimise - abbreviation: -optimize + - option: "-optimise" + abbreviation: "-optimize" schema: - type: Boolean + type: "Boolean" description: "Compiler flag for the optimizer in Scala 2.11." deprecated: "In 2.12, `-optimise` enables `-opt:l:inline -opt-inline-from:**`. Check `-opt:help` for using the Scala 2.12 optimizer." - - option: -print + - option: "-print" schema: - type: Boolean + type: "Boolean" description: "Print program with Scala-specific features removed." - - option: -target + - option: "-target" scheam: - type: Choice - default: jvm-1.8 + type: "Choice" + default: "jvm-1.8" choices: - - choice: jvm-1.5 - - choice: jvm-1.6 - - choice: jvm-1.7 - - choice: jvm-1.8 + - choice: "jvm-1.5" + - choice: "jvm-1.6" + - choice: "jvm-1.7" + - choice: "jvm-1.8" description: "Target platform for object files. All JVM `1.5` - `1.7` targets are deprecated." - - option: -unchecked + - option: "-unchecked" schema: - type: Boolean + type: "Boolean" description: "Enable additional warnings where generated code depends on assumptions." - - option: -uniqid + - option: "-uniqid" schema: - type: Boolean + type: "Boolean" description: "Uniquely tag all identifiers in debugging output." - - option: -usejavacp + - option: "-usejavacp" schema: - type: Boolean + type: "Boolean" description: "Utilize the `java.class.path` in classpath resolution." - - option: -usemanifestcp + - option: "-usemanifestcp" schema: - type: Boolean + type: "Boolean" description: "Utilize the manifest in classpath resolution." - - option: -verbose + - option: "-verbose" schema: - type: Boolean + type: "Boolean" description: "Output messages about what the compiler is doing." - - option: -version + - option: "-version" schema: - type: Boolean + type: "Boolean" description: "Print product version and exit." - - option: -no-specialization + - option: "-no-specialization" schema: - type: Boolean + type: "Boolean" description: "Ignore `@specialize` annotations." - - option: -language + - option: "-language" schema: - type: Choice + type: "Choice" multiple: true - arg: feat + arg: "feat" choices: - - choice: dynamics + - choice: "dynamics" description: "Allow direct or indirect subclasses of `scala.Dynamic`." - - choice: postfixOps + - choice: "postfixOps" description: "Allow postfix operator notation, such as `1 to 10 toList`." - - choice: reflectiveCalls + - choice: "reflectiveCalls" description: "Allow reflective access to members of structural types." - - choice: implicitConversions + - choice: "implicitConversions" description: "Allow definition of implicit functions called views." - - choice: higherKinds + - choice: "higherKinds" description: "Allow higher-kinded types." - - choice: existentials + - choice: "existentials" description: "Existential types (besides wildcard types) can be written and inferred." - - choice: experimental.macros + - choice: "experimental.macros" description: "Allow macro definition (besides implementation and application." description: "Enable or disable language features." - - option: -release + - option: "-release" schema: - type: String - arg: release + type: "String" + arg: "release" description: "Compile for a specific version of the Java platform. Supported targets: 6, 7, 8, 9." -- category: JVM Settings +- category: "JVM Settings" description: "Settings influencing the runtime system." options: - - option: -Jflag + - option: "-Jflag" schema: - type: Prefix + type: "Prefix" description: "Pass `flag` directly to the runtime system." - - option: -Dproperty=value + - option: "-Dproperty=value" schema: - type: Prefix + type: "Prefix" description: "Pass `-Dproperty=value` directly to the runtime system." - - option: -nobootcp + - option: "-nobootcp" schema: - type: Boolean + type: "Boolean" description: "Do not use the boot classpath for the scala jars." -- category: Plugin Settings +- category: "Plugin Settings" description: "" options: - - option: -P + - option: "-P" schema: - type: Prefix + type: "Prefix" arg: ":plugin:opt" description: "Pass an option to a plugin in the form of `-P::`." note: "If you use sbt, [compiler plugins support](https://www.scala-sbt.org/1.x/docs/Compiler-Plugins.html) may be useful." -- category: Advanced Settings +- category: "Advanced Settings" description: "Options that starts with `-X` are maybe renamed or removed in future releases." options: - - option: -X + - option: "-X" schema: - type: Boolean + type: "Boolean" description: "Print a synopsis of advanced options." - - option: -Xcheckinit + - option: "-Xcheckinit" schema: - type: Boolean + type: "Boolean" description: "Wrap field accessors to throw an exception on uninitialized access." - - option: -Xdev + - option: "-Xdev" schema: - type: Boolean + type: "Boolean" description: "Indicates user is a developer - issue warnings about anything which seems amiss." - - option: -Xdisable-assertions + - option: "-Xdisable-assertions" schema: - type: Boolean + type: "Boolean" description: "Generate no assertions or assumptions." - - option: -Xelide-below + - option: "-Xelide-below" schema: - type: Int - arg: min - default: Int.MinValue + type: "Int" + arg: "min" + default: "Int.MinValue" description: "Calls to `@elidable` methods are omitted if method priority is lower than argument." - - option: -Xno-forwarders + - option: "-Xno-forwarders" schema: - type: Boolean + type: "Boolean" description: "Do not generate static forwarders in mirror classes." - - option: -Xgenerate-phase-graph + - option: "-Xgenerate-phase-graph" schema: - type: String - arg: file + type: "String" + arg: "file" description: "Generate the phase graphs (outputs .dot files) to fileX.dot." - - option: -Xlog-implicits + - option: "-Xlog-implicits" schema: - type: Boolean + type: "Boolean" description: "Show more detail on why some implicits are not applicable." - - option: -Xlog-implicit-conversions + - option: "-Xlog-implicit-conversions" schema: - type: Boolean + type: "Boolean" description: "Print a message whenever an implicit conversion is inserted." - - option: -Xlog-reflective-calls + - option: "-Xlog-reflective-calls" schema: - type: Boolean + type: "Boolean" description: "Print a message when a reflective method call is generated." - - option: -Xlog-free-terms + - option: "-Xlog-free-terms" schema: - type: Boolean + type: "Boolean" description: "Print a message when reification creates a free term." - - option: -Xlog-free-types + - option: "-Xlog-free-types" schema: - type: Boolean + type: "Boolean" description: "Print a message when reification resorts to generating a free type." - - option: -Xmax-classfile-name + - option: "-Xmax-classfile-name" schema: - type: Int - arg: max + type: "Int" + arg: "max" default: 255 min: 72 max: 255 description: "Maximum filename length for generated classes." - - option: -Xmaxerrs + - option: "-Xmaxerrs" schema: - type: Int - arg: max + type: "Int" + arg: "max" default: 100 description: "Maximum errors to print." - - option: -Xmaxwarns + - option: "-Xmaxwarns" schema: - type: Int - arg: max + type: "Int" + arg: "max" default: 100 description: "Maximum warnings to print." - - option: -Xmigration + - option: "-Xmigration" schema: - type: ScalaVersion - arg: version - default: any + type: "ScalaVersion" + arg: "version" + default: "any" description: "Warn about constructs whose behavior may have changed since version." - - option: -Xno-uescape + - option: "-Xno-uescape" schema: - type: Boolean + type: "Boolean" description: "Disable handling of \\u unicode escapes." - - option: -Xnojline + - option: "-Xnojline" schema: - type: Boolean + type: "Boolean" description: "Do not use JLine for editing." - - option: -Xverify + - option: "-Xverify" schema: - type: Boolean + type: "Boolean" description: "Verify generic signatures in generated bytecode." - - option: -Xplugin + - option: "-Xplugin" schema: - type: String + type: "String" multiple: true - arg: path + arg: "path" description: "Load a plugin from each classpath." - - option: -Xplugin-disable + - option: "-Xplugin-disable" schema: - type: String + type: "String" multiple: true - arg: plugin + arg: "plugin" description: "Disable plugins by name." - - option: -Xplugin-list + - option: "-Xplugin-list" schema: - type: Boolean + type: "Boolean" description: "Print a synopsis of loaded plugins." - - option: -Xplugin-require + - option: "-Xplugin-require" schema: - type: String + type: "String" multiple: true - arg: plugin + arg: "plugin" description: "Abort if a named plugin is not loaded." - - option: -Xpluginsdir + - option: "-Xpluginsdir" schema: - type: String - arg: path - default: Defaults.scalaPluginPath + type: "String" + arg: "path" + default: "Defaults.scalaPluginPath" description: "Path to search for plugin archives." - - option: -Xprint + - option: "-Xprint" schema: - type: Phases - arg: phases + type: "Phases" + arg: "phases" description: "Print out program after PHASES (see [Compilation Phases](#compilation-phases))" - - option: -Xprint-pos + - option: "-Xprint-pos" schema: - type: Boolean + type: "Boolean" description: "Print tree positions, as offsets." - - option: -Xprint-types + - option: "-Xprint-types" schema: - type: Boolean + type: "Boolean" description: "Print tree types (debugging option)." - - option: -Xprint-args + - option: "-Xprint-args" schema: - type: Boolean + type: "Boolean" description: "Print all compiler arguments and exit." - - option: -Xprompt + - option: "-Xprompt" schema: - type: Boolean + type: "Boolean" description: "Display a prompt after each error (debugging option)." - - option: -Xresident + - option: "-Xresident" schema: - type: Boolean + type: "Boolean" description: "Compiler stays resident: read source filenames from standard input." - - option: -Xscript + - option: "-Xscript" schema: - type: String - arg: object + type: "String" + arg: "object" description: "Treat the source file as a script and wrap it in a main method." - - option: -Xmain-class + - option: "-Xmain-class" schema: - type: String - arg: path + type: "String" + arg: "path" description: "Class for manifest's Main-Class entry (only useful with `-d `)" - - option: -Xshow-class + - option: "-Xshow-class" schema: - type: String - arg: class + type: "String" + arg: "class" description: "Show internal representation of class." - - option: -Xshow-object + - option: "-Xshow-object" schema: - type: String - arg: object + type: "String" + arg: "object" description: "Show internal representation of object." - - option: -Xshow-phases + - option: "-Xshow-phases" schema: - type: Boolean + type: "Boolean" description: "Print a synopsis of compiler phases." - - option: -Xsource-reader + - option: "-Xsource-reader" schema: - type: String - arg: classname + type: "String" + arg: "classname" description: "Specify a custom method for reading source files." - - option: -Xreporter + - option: "-Xreporter" schema: - type: String - arg: classname - default: scala.tools.nsc.reporters.ConsoleReporter + type: "String" + arg: "classname" + default: "scala.tools.nsc.reporters.ConsoleReporter" description: "Specify a custom reporter for compiler messages." - - option: -Xstrict-inference + - option: "-Xstrict-inference" schema: - type: Boolean + type: "Boolean" description: "Don't infer known-unsound types." - - option: -Xsource + - option: "-Xsource" schema: - type: Scala Version - arg: version - default: 2.13 + type: "Scala Version" + arg: "version" + default: "2.13" description: "Treat compiler input as Scala source for the specified version, see [scala/bug#8126](https://github.com/scala/bug/issues/8126)." - - option: -Xno-patmat-analysis + - option: "-Xno-patmat-analysis" schema: - type: Boolean + type: "Boolean" description: "Don't perform exhaustivity/unreachability analysis. Also, ignore `@switch` annotation." - - option: -Xfull-lubs + - option: "-Xfull-lubs" schema: - type: Boolean + type: "Boolean" description: "Retains pre 2.10 behavior of less aggressive truncation of least upper bounds." - - option: -Xmixin-force-forwarders + - option: "-Xmixin-force-forwarders" schema: - type: Choice - arg: mode - default: true + type: "Choice" + arg: "mode" + default: "true" choices: - - choice: true + - choice: "true" description: "Always generate mixin forwarders." - - choice: junit + - choice: "junit" description: "Generate mixin forwarders for JUnit-annotated methods (JUnit 4 does not support default methods)." - - choice: false + - choice: "false" description: "Only generate mixin forwarders required for program correctness." description: "Generate forwarder methods in classes inhering concrete methods from traits." - - option: -Xxml + - option: "-Xxml" schema: - type: Choice - arg: property + type: "Choice" + arg: "property" choices: - - choice: coalescing + - choice: "coalescing" description: "Convert PCData to Text and coalesce sibling nodes." description: "Configure XML parsing." -- category: Private Settings +- category: "Private Settings" description: | Options with `-Y` prefix are more experimental and unstable than those with `-X` prefix. @@ -415,472 +414,471 @@ Some optimization-related options, e.g. `-opt:**` and `-opt-inline-form` are included in this section, since **REASON_HERE**. options: - - option: -Y + - option: "-Y" schema: - type: Boolean + type: "Boolean" description: "Print a synopsis of private options." - - option: -Yoverride-objects + - option: "-Yoverride-objects" schema: - type: Boolean + type: "Boolean" description: "Allow member objects to be overridden." - - option: -Yoverride-vars + - option: "-Yoverride-vars" schema: - type: Boolean + type: "Boolean" description: "Allow vars to be overridden." - - option: -Ybreak-cycles + - option: "-Ybreak-cycles" schema: - type: Boolean + type: "Boolean" description: "Attempt to break cycles encountered during typing." - - option: -Ybrowse + - option: "-Ybrowse" schema: - type: Phases - arg: phases + type: "Phases" + arg: "phases" description: "Browse the abstract syntax tree after PHASES (see [Compilation Phases](#compilation-phases))" - - option: -Ycheck + - option: "-Ycheck" schema: - type: Phases - arg: phases + type: "Phases" + arg: "phases" description: "Check the tree at the end of PHASES (see [Compilation Phases](#compilation-phases))" - - option: -Yshow + - option: "-Yshow" schema: - type: Phases - arg: phases + type: "Phases" + arg: "phases" description: "(Requires `-Xshow-class` or `-Xshow-object`) Show after PHASES (see [Compilation Phases](#compilation-phases))" - - option: -Ycompact-trees + - option: "-Ycompact-trees" schema: - type: Boolean + type: "Boolean" description: "Use compact tree printer when displaying trees." - - option: -Yno-completion + - option: "-Yno-completion" schema: - type: Boolean + type: "Boolean" description: "Disable tab-completion in the REPL." - - option: -Ydebug + - option: "-Ydebug" schema: - type: Boolean + type: "Boolean" description: "Increase the quantity of debugging output." - - option: -Yresolve-term-conflict + - option: "-Yresolve-term-conflict" schema: - type: Choice - arg: strategy - default: error + type: "Choice" + arg: "strategy" + default: "error" choices: - - choice: package - - choice: object - - choice: error + - choice: "package" + - choice: "object" + - choice: "error" description: "Resolve term conflicts." - - option: -Ylog + - option: "-Ylog" schema: - type: Phases - arg: phases + type: "Phases" + arg: "phases" description: "Log operations during PHASES (see [Compilation Phases](#compilation-phases))" - - option: -Ylog-classpath + - option: "-Ylog-classpath" schema: - type: Boolean + type: "Boolean" description: "Output information about what classpath is being applied." - - option: -Yno-generic-signatures + - option: "-Yno-generic-signatures" schema: - type: Boolean + type: "Boolean" description: "Suppress generation of generic signatures for Java." - - option: -Yno-imports + - option: "-Yno-imports" schema: - type: Boolean + type: "Boolean" description: "Compile without importing scala.*, java.lang.*, or Predef." - - option: -Yno-predef + - option: "-Yno-predef" schema: - type: Boolean + type: "Boolean" description: "Compile without importing Predef." - - option: -Yno-adapted-args + - option: "-Yno-adapted-args" schema: - type: Boolean + type: "Boolean" description: "Do not adapt an argument list (either by inserting () or creating a tuple) to match the receiver." - - option: -Yrecursion + - option: "-Yrecursion" schema: - type: Int - arg: depth + type: "Int" + arg: "depth" default: 0 min: 0 max: Int.MaxValue description: "Set recursion depth used when locking symbols." - - option: -Yshow-trees + - option: "-Yshow-trees" schema: - type: Boolean + type: "Boolean" description: "(Requires `-Xprint:`) Print detailed ASTs in formatted form." - - option: -Yshow-trees-compact + - option: "-Yshow-trees-compact" schema: - type: Boolean + type: "Boolean" description: "(Requires `-Xprint:`) Print detailed ASTs in compact form." - - option: -Yshow-trees-stringified + - option: "-Yshow-trees-stringified" schema: - type: Boolean + type: "Boolean" description: "(Requires `-Xprint:`) Print stringifications along with detailed ASTs." - - option: -Yshow-syms + - option: "-Yshow-syms" schema: - type: Boolean + type: "Boolean" description: "Print the AST symbol hierarchy after each phase." - - option: -Yshow-symkinds + - option: "-Yshow-symkinds" schema: - type: Boolean + type: "Boolean" description: "Print abbreviated symbol kinds next to symbol names." - - option: -Yshow-symowners + - option: "-Yshow-symowners" schema: - type: Boolean + type: "Boolean" description: "Print owner identifiers next to symbol names." - - option: -Yskip + - option: "-Yskip" schema: - type: Phases - arg: phases + type: "Phases" + arg: "phases" description: "Skip PHASES (see [Compilation Phases](#compilation-phases))" - - option: -Ygen-asmp + - option: "-Ygen-asmp" schema: - type: String - arg: dir + type: "String" + arg: "dir" description: "Generate a parallel output directory of .asmp files (ie ASM Textifier output)." - - option: -Ydump-classes + - option: "-Ydump-classes" schema: - type: String - arg: dir + type: "String" + arg: "dir" description: "Dump the generated bytecode to .class files (useful for reflective compilation that utilizes in-memory classloaders)." - - option: -Ystop-after - abbreviation: -stop + - option: "-Ystop-after" + abbreviation: "-stop" schema: - type: Phases - arg: phases + type: "Phases" + arg: "phases" description: "Stop after PHASES (see [Compilation Phases](#compilation-phases))" - - option: -Ystop-before + - option: "-Ystop-before" schema: - type: Phases - arg: phases + type: "Phases" + arg: "phases" description: "Stop before PHASES (see [Compilation Phases](#compilation-phases))" - - option: -Yrangepos + - option: "-Yrangepos" schema: - type: Boolean + type: "Boolean" description: "Use range positions for syntax trees." - - option: -Yshow-member-pos + - option: "-Yshow-member-pos" schema: - type: String - arg: style + type: "String" + arg: "style" description: "Show start and end positions of members." note: "`-Yrangepos` is enabled at the same time." - - option: -Yreify-copypaste + - option: "-Yreify-copypaste" schema: - type: Boolean + type: "Boolean" description: "Dump the reified trees in copypasteable representation." - - option: -Ymacro-expand + - option: "-Ymacro-expand" schema: - type: Choice - arg: policy - default: normal + type: "Choice" + arg: "policy" + default: "normal" choices: - - choice: none - - choice: normal - - choice: discard + - choice: "none" + - choice: "normal" + - choice: "discard" description: "Control expansion of macros, useful for scaladoc and presentation compiler." - - option: -Ymacro-no-expand + - option: "-Ymacro-no-expand" schema: - type: Boolean + type: "Boolean" description: "Don't expand macros. Might be useful for scaladoc and presentation compiler, but will crash anything which uses macros and gets past typer." deprecated: "Use `-Ymacro-expand:none` instead." - - option: -Yrepl-sync + - option: "-Yrepl-sync" schema: - type: Boolean + type: "Boolean" description: "Do not use asynchronous code for REPL startup." - - option: -Yrepl-class-based + - option: "-Yrepl-class-based" schema: - type: Boolean + type: "Boolean" description: "Use classes to wrap REPL snippets instead of objects." - - option: -Yrepl-outdir + - option: "-Yrepl-outdir" schema: - type: String - arg: path + type: "String" + arg: "path" description: "Write repl-generated classfiles to given output directory (use \"\" to generate a temporary dir)" - - option: -Yinfer-argument-types + - option: "-Yinfer-argument-types" schema: - type: Boolean + type: "Boolean" description: "Infer types for arguments of overridden methods." - - option: -YdisableFlatCpCaching + - option: "-YdisableFlatCpCaching" schema: - type: Boolean + type: "Boolean" description: "Do not cache flat classpath representation of classpath elements from jars across compiler instances." - - option: -Yvirtpatmat + - option: "-Yvirtpatmat" schema: - type: Boolean + type: "Boolean" description: "Enable pattern matcher virtualization." - - option: -Yexpose-empty-package + - option: "-Yexpose-empty-package" # TODO: internal only internalOnly: true schema: - type: Boolean + type: "Boolean" description: "Internal only: expose the empty package." - - option: -Ydelambdafy + - option: "-Ydelambdafy" schema: - type: Choice - arg: strategy - default: method + type: "Choice" + arg: "strategy" + default: "method" choices: - - choice: inline - - choice: method + - choice: "inline" + - choice: "method" description: "Strategy used for translating lambdas into JVM code." - - option: -Ybackend-parallelism + - option: "-Ybackend-parallelism" schema: - type: Int - arg: threads + type: "Int" + arg: "threads" default: 1 min: 1 max: 16 description: "Maximum worker threads for backend." - - option: -Ybackend-worker-queue + - option: "-Ybackend-worker-queue" description: "Backend threads worker queue size." schema: - type: Int - arg: size + type: "Int" + arg: "size" default: 0 min: 0 max: 1000 - - option: -Yjar-compression-level + - option: "-Yjar-compression-level" schema: - type: Int - arg: level - default: Deflater.DEFAULT_COMPRESSION - min: Deflater.DEFAULT_COMPRESSION - max: Deflater.BEST_COMPRESSION + type: "Int" + arg: "level" + default: "Deflater.DEFAULT_COMPRESSION" + min: "Deflater.DEFAULT_COMPRESSION" + max: "Deflater.BEST_COMPRESSION" description: "Compression level to use when writing jar files." - - option: -Ycache-plugin-class-loader + - option: "-Ycache-plugin-class-loader" schema: - type: Choice - default: none + type: "Choice" + default: "none" choices: - - choice: none + - choice: "none" description: "Don't cache class loader." - - choice: last-modified + - choice: "last-modified" description: "Cache class loader, using file last-modified time to invalidate." description: "Policy for caching class loaders for compiler plugins that are dynamically loaded." - - option: -Ycache-macro-class-loader + - option: "-Ycache-macro-class-loader" schema: - type: Choice - default: none + type: "Choice" + default: "none" choices: - - choice: none + - choice: "none" description: "Don't cache class loader." - - choice: last-modified + - choice: "last-modified" description: "Cache class loader, using file last-modified time to invalidate." description: "Policy for caching class loaders for macros that are dynamically loaded." - - option: -opt + - option: "-opt" schema: - type: Choice + type: "Choice" multiple: true choices: - - choice: unreachable-code + - choice: "unreachable-code" description: "Eliminate unreachable code, exception handlers guarding no instructions, redundant metadata (debug information, line numbers)." - - choice: simplify-jumps + - choice: "simplify-jumps" description: "Simplify branching instructions, eliminate unnecessary ones." - - choice: compact-locals + - choice: "compact-locals" description: "Eliminate empty slots in the sequence of local variables." - - choice: copy-propagation + - choice: "copy-propagation" description: "Eliminate redundant local variables and unused values (including closures). Enables unreachable-code." - - choice: redundant-casts + - choice: "redundant-casts" description: "Eliminate redundant casts using a type propagation analysis." - - choice: box-unbox + - choice: "box-unbox" description: "Eliminate box-unbox pairs within the same method (also tuples, xRefs, value class instances). Enables unreachable-code." - choice: "nullness-tracking" description: "Track nullness / non-nullness of local variables and apply optimizations." - - choice: closure-invocations + - choice: "closure-invocations" description: "Rewrite closure invocations to the implementation method." - - choice: inline + - choice: "inline" description: "Inline method invocations according to `-Yopt-inline-heuristics` and `-opt-inline-from`." - - choice: l:none + - choice: "l:none" description: "Disable optimizations. Takes precedence: `-opt:l:none,+box-unbox` / `-opt:l:none -opt:box-unbox` don't enable box-unbox." note: "Unlike the other optimizer levels, `l:none` appears up in the `opt.value` set because it's not an expanding option." - - choice: l:default + - choice: "l:default" description: "Enable default optimizations: `unreachable-code`." - - choice: l:method + - choice: "l:method" description: "Enable intra-method optimizations: `unreachable-code`, `simplify-jumps`, `compact-locals`, `copy-propagation`, `redundant-casts`, `box-unbox`, `nullness-tracking`, `closure-invocations`." - - choice: l:inline + - choice: "l:inline" description: "Enable cross-method optimizations (note: inlining requires `-opt-inline-from`): `unreachable-code`, `simplify-jumps`, `compact-locals`, `copy-propagation`, `redundant-casts`, `box-unbox`, `nullness-tracking`, `closure-invocations`, `inline`." - - choice: l:project + - choice: "l:project" description: "Enable cross-method optimizations within the current project." deprecated: "Use `-opt:l:inline -opt-inline-from` instead." - - choice: l:classpath + - choice: "l:classpath" description: "Enable cross-method optimizations across the entire classpath." deprecated: "Use `-opt:l:inline -opt-inline-from` instead." description: "Enable optimizations. Check `-opt:help` for using the Scala 2.12 optimizer." note: "if `inline` not contained and either `l:project` or `l:classpath` are contained, then `l:inline` is enabled." - - option: -opt-inline-from + - option: "-opt-inline-from" schema: - type: String + type: "String" multiple: true - arg: pattern + arg: "pattern" description: "Patterns for classfile names from which to allow inlining, `help` for details." - - option: -Yopt-inline-heuristics + - option: "-Yopt-inline-heuristics" schema: - type: Choice - arg: strategy - default: default + type: "Choice" + arg: "strategy" + default: "default" choices: - - choice: at-inline-annotated - - choice: everything - - choice: default + - choice: "at-inline-annotated" + - choice: "everything" + - choice: "default" description: "Set the heuristics for inlining decisions." - - option: -opt-warnings + - option: "-opt-warnings" schema: - type: Choice + type: "Choice" multiple: true - default: at-inline-failed + default: "at-inline-failed" choices: - - choice: none + - choice: "none" description: "No optimizer warnings." - - choice: at-inline-failed-summary + - choice: "at-inline-failed-summary" description: "One-line summary if there were `@inline` method calls that could not be inlined." - - choice: at-inline-failed + - choice: "at-inline-failed" description: "A detailed warning for each `@inline` method call that could not be inlined." - - choice: any-inline-failed + - choice: "any-inline-failed" description: "A detailed warning for every callsite that was chosen for inlining by the heuristics, but could not be inlined." - - choice: no-inline-mixed + - choice: "no-inline-mixed" description: "In mixed compilation, warn at callsites methods defined in java sources (the inlining decision cannot be made without bytecode)." - - choice: no-inline-missing-bytecode + - choice: "no-inline-missing-bytecode" description: "Warn if an inlining decision cannot be made because a the bytecode of a class or member cannot be found on the compilation classpath." - - choice: no-inline-missing-attribute + - choice: "no-inline-missing-attribute" description: "Warn if an inlining decision cannot be made because a Scala classfile does not have a ScalaInlineInfo attribute." description: "Enable optimizer warnings." - - option: -Yopt-trace + - option: "-Yopt-trace" schema: - type: String - arg: package/Class.method + type: "String" + arg: "package/Class.method" description: "Trace the optimizer progress for methods; `_` to print all, prefix match to select." - - option: -Yopt-log-inline + - option: "-Yopt-log-inline" schema: - type: String - arg: package/Class.method + type: "String" + arg: "package/Class.method" description: "Print a summary of inliner activity; `_` to print all, prefix match to select." - - option: -Ystatistics + - option: "-Ystatistics" schema: - type: Phases - arg: phases + type: "Phases" + arg: "phases" default: "parser,typer,patmat,erasure,cleanup,jvm" description: "Print compiler statistics for specific phases. (see [Compilation Phases](#compilation-phases))" - - option: -Yhot-statistics-enabled + - option: "-Yhot-statistics-enabled" schema: - type: Boolean + type: "Boolean" description: "Enable `-Ystatistics` to print hot statistics." - - option: -Yprofile-enabled + - option: "-Yprofile-enabled" schema: - type: Boolean + type: "Boolean" description: "Enable profiling." - - option: -Yprofile-destination - arg: file + - option: "-Yprofile-destination" + arg: "file" schema: - type: String + type: "String" description: "where to send profiling output - specify a file, default is to the console." note: "`-Yprofile-enabled` is enabled at the same time." - - option: -Yprofile-external-tool + - option: "-Yprofile-external-tool" schema: - type: Phases - arg: phases + type: "Phases" + arg: "phases" default: "typer" description: "Enable profiling for a phase using an external tool hook. Generally only useful for a single phase." note: "`-Yprofile-enabled` is enabled at the same time." - - option: -Yprofile-run-gc + - option: "-Yprofile-run-gc" schema: - type: Phases - arg: phases + type: "Phases" + arg: "phases" default: "_" description: "Run a GC between phases - this allows heap size to be accurate at the expense of more time. Specify a list of phases, or `all`." note: "`-Yprofile-enabled` is enabled at the same time." # Area-specific debug output. - - option: -Ydoc-debug + - option: "-Ydoc-debug" schema: - type: Boolean + type: "Boolean" description: "Trace all scaladoc activity." - - option: -Yide-debug + - option: "-Yide-debug" schema: - type: Boolean + type: "Boolean" description: "Generate, validate and output trees using the interactive compiler." - - option: -Yissue-debug + - option: "-Yissue-debug" schema: - type: Boolean + type: "Boolean" description: "Print stack traces when a context issues an error." - - option: -Ymacro-debug-lite + - option: "-Ymacro-debug-lite" schema: - type: Boolean + type: "Boolean" description: "Trace essential macro-related activities." - - option: -Ymacro-debug-verbose + - option: "-Ymacro-debug-verbose" schema: - type: Boolean + type: "Boolean" description: "Trace all macro-related activities: compilation, generation of synthetics, classloading, expansion, exceptions." - - option: -Ypos-debug + - option: "-Ypos-debug" schema: - type: Boolean + type: "Boolean" description: "Trace position validation." - - option: -Yreify-debug + - option: "-Yreify-debug" schema: - type: Boolean + type: "Boolean" description: "Trace reification." - - option: -Ytyper-debug + - option: "-Ytyper-debug" schema: - type: Boolean + type: "Boolean" description: "Trace all type assignments." - - option: -Ypatmat-debug + - option: "-Ypatmat-debug" schema: - type: Boolean + type: "Boolean" description: "Trace pattern matching translation." - - option: -Ypatmat-exhaust-depth + - option: "-Ypatmat-exhaust-depth" schema: - type: Int - arg: off + type: "Int" + arg: "off" default: 20 min: 10 max: Int.MaxValue description: "off" - - option: -Yquasiquote-debug + - option: "-Yquasiquote-debug" schema: - type: Boolean + type: "Boolean" description: "Trace quasiquote-related activities." # Groups of Settings. - - option: -Xfuture + - option: "-Xfuture" schema: - type: Boolean + type: "Boolean" description: "Turn on future language features." - enablingIfNotSetByUser: futureSettings - - option: -Xexperimental + - option: "-Xexperimental" schema: - type: Boolean + type: "Boolean" description: "Enable experimental extensions in Scala 2.12 and earlier." deprecated: "In 2.13 all options previously enabled by `-Xexperimental` are enabled by default or removed." - - option : -Xmacro-settings + - option : "-Xmacro-settings" schema: - type: String + type: "String" multiple: true description: "Custom settings for macros." # * IDE-specific settings - - option: -Ypresentation-verbose + - option: "-Ypresentation-verbose" schema: - type: Boolean + type: "Boolean" description: "Print information about presentation compiler tasks." - - option: -Ypresentation-debug + - option: "-Ypresentation-debug" schema: - type: Boolean + type: "Boolean" description: "Enable debugging output for the presentation compiler." - - option: -Ypresentation-any-thread + - option: "-Ypresentation-any-thread" schema: - type: Boolean + type: "Boolean" description: "Allow use of the presentation compiler from any thread." - - option: -Ypresentation-strict + - option: "-Ypresentation-strict" schema: - type: Boolean + type: "Boolean" description: "Do not report type errors in sources with syntax errors." - - option: -Ypresentation-log + - option: "-Ypresentation-log" schema: - type: String - arg: file + type: "String" + arg: "file" description: "Log presentation compiler events into file." - - option: -Ypresentation-replay + - option: "-Ypresentation-replay" schema: - type: String - arg: file + type: "String" + arg: "file" description: "Replay presentation compiler events from file." - - option: -Ypresentation-delay + - option: "-Ypresentation-delay" schema: - type: Int - arg: miliseconds + type: "Int" + arg: "miliseconds" default: 0 min: 0 max: 999 @@ -888,124 +886,124 @@ -- category: Warning Settings +- category: "Warning Settings" description: "This section assembles the `-X` and `-Y` options those influence the printing of warnings." options: - - option: -Xfatal-warnings + - option: "-Xfatal-warnings" schema: - type: Boolean + type: "Boolean" description: "Fail the compilation if there are any warnings." - - option: -Ywarn-macros + - option: "-Ywarn-macros" schema: - type: Choice - arg: mode + type: "Choice" + arg: "mode" choices: - - choice: none + - choice: "none" description: "Do not inspect expansions or their original trees when generating unused symbol warnings." - - choice: before + - choice: "before" description: "Only inspect unexpanded user-written code for unused symbols." - - choice: after + - choice: "after" description: "Only inspect expanded trees when generating unused symbol warnings." - - choice: both + - choice: "both" description: "Inspect both user-written code and expanded trees when generating unused symbol warnings." description: "Enable lint warnings on macro expansions." - - option: -Ywarn-dead-code + - option: "-Ywarn-dead-code" schema: - type: Boolean + type: "Boolean" description: "Warn when dead code is identified." - - option: -Ywarn-value-discard + - option: "-Ywarn-value-discard" schema: - type: Boolean + type: "Boolean" description: "Warn when non-Unit expression results are unused." note: "To reduce noises for common idiom, warning are suppressed if type of results are `this.type`." - - option: -Ywarn-numeric-widen + - option: "-Ywarn-numeric-widen" schema: - type: Boolean + type: "Boolean" description: "Warn when numerics are widened." - - option: -Ywarn-unused + - option: "-Ywarn-unused" schema: - type: Choice + type: "Choice" multiple: true - arg: warn - default: _ + arg: "warn" + default: "_" choices: - - choice: imports + - choice: "imports" description: "Warn if an import selector is not referenced." - - choice: patvars + - choice: "patvars" description: "Warn if a variable bound in a pattern is unused." - - choice: privates + - choice: "privates" description: "Warn if a private member is unused." - - choice: locals + - choice: "locals" description: "Warn if a local definition is unused." - - choice: explicits + - choice: "explicits" description: "Warn if an explicit parameter is unused." - - choice: implicits + - choice: "implicits" description: "Warn if an implicit parameter is unused." - - choice: params + - choice: "params" description: "Enable `-Ywarn-unused:explicits,implicits`." - - choice: linted + - choice: "linted" description: "Enable `-Ywarn-unused:imports,privates,locals,implicits`." note: "Alias is `-Xlint:unused`." description: "Enable or disable specific `unused` warnings." - - option: -Ywarn-unused-import + - option: "-Ywarn-unused-import" schema: - type: Boolean + type: "Boolean" description: "Warn when imports are unused." - - option: -Ywarn-extra-implicit + - option: "-Ywarn-extra-implicit" schema: - type: Boolean + type: "Boolean" description: "Warn when more than one implicit parameter section is defined." - - option: -Ywarn-self-implicit + - option: "-Ywarn-self-implicit" schema: - type: Boolean + type: "Boolean" description: "Warn when an implicit resolves to an enclosing self-definition." - - option: -Xlint + - option: "-Xlint" schema: - type: Choice + type: "Choice" multiple: true - arg: warn - default: _ + arg: "warn" + default: "_" choices: - - choice: adapted-args + - choice: "adapted-args" description: "Warn if an argument list is modified to match the receiver." note: "Alias is `-Ywarn-adapted-args`." - - choice: nullary-unit + - choice: "nullary-unit" description: "Warn when nullary methods return Unit." note: "Alias is `-Ywarn-nullary-unit`." - - choice: inaccessible + - choice: "inaccessible" description: "Warn about inaccessible types in method signatures." note: "Alias is `-Ywarn-inaccessible`." - - choice: nullary-override + - choice: "nullary-override" description: "Warn when non-nullary `def f()` overrides nullary `def f`." note: "Alias is `-Ywarn-nullary-override`." - - choice: infer-any + - choice: "infer-any" description: "Warn when a type argument is inferred to be `Any`." note: "Alias is `-Ywarn-infer-any`." - - choice: missing-interpolator + - choice: "missing-interpolator" description: "A string literal appears to be missing an interpolator id." - - choice: doc-detached + - choice: "doc-detached" description: "A Scaladoc comment appears to be detached from its element." - - choice: private-shadow + - choice: "private-shadow" description: "A private field (or class parameter) shadows a superclass field." - - choice: type-parameter-shadow + - choice: "type-parameter-shadow" description: "A local type parameter shadows a type already in scope." - - choice: poly-implicit-overload + - choice: "poly-implicit-overload" description: "Parameterized overloaded implicit methods are not visible as view bounds." - - choice: option-implicit + - choice: "option-implicit" description: "Option.apply used implicit view." - - choice: delayedinit-select + - choice: "delayedinit-select" description: "Selecting member of DelayedInit." - - choice: by-name-right-associative + - choice: "by-name-right-associative" description: "By-name parameter of right associative operator." - - choice: package-object-classes + - choice: "package-object-classes" description: "Class or object defined in package object." - - choice: unsound-match + - choice: "unsound-match" description: "Pattern match may not be typesafe." - - choice: stars-align + - choice: "stars-align" description: "Pattern sequence wildcard must align with sequence component." - - choice: constant + - choice: "constant" description: "Evaluation of a constant arithmetic expression results in an error." - - choice: unused + - choice: "unused" description: "Enable `-Ywarn-unused:imports,privates,locals,implicits`." description: "Enable or disable specific warnings." note: "If this options contains `unused`, it enables `-Ywarn-unused:linted`. Otherwise it disables `-Ywarn-unused:linted`." From e5dd280f3743077480e04b1dcd3f75c5f06102d3 Mon Sep 17 00:00:00 2001 From: exoego Date: Thu, 3 May 2018 06:49:35 +0900 Subject: [PATCH 05/12] Make abbreviations multiple --- _data/compiler-options.yml | 9 ++++++--- _overviews/compiler-options/index.md | 6 +++++- 2 files changed, 11 insertions(+), 4 deletions(-) diff --git a/_data/compiler-options.yml b/_data/compiler-options.yml index 2d7d50d35c..8b815f0d14 100644 --- a/_data/compiler-options.yml +++ b/_data/compiler-options.yml @@ -3,11 +3,12 @@ options: # Path related settings. - option: "-classpath" - abbreviation: "-cp" schema: type: "Path" arg: "path" description: "Specify where to find user class files." + abbreviations: + - "-cp" - option: "-bootclasspath" schema: type: "Path" @@ -81,10 +82,11 @@ type: "Boolean" description: "Generate no warnings." - option: "-optimise" - abbreviation: "-optimize" schema: type: "Boolean" description: "Compiler flag for the optimizer in Scala 2.11." + abbreviations: + - "-optimize" deprecated: "In 2.12, `-optimise` enables `-opt:l:inline -opt-inline-from:**`. Check `-opt:help` for using the Scala 2.12 optimizer." - option: "-print" schema: @@ -540,11 +542,12 @@ arg: "dir" description: "Dump the generated bytecode to .class files (useful for reflective compilation that utilizes in-memory classloaders)." - option: "-Ystop-after" - abbreviation: "-stop" schema: type: "Phases" arg: "phases" description: "Stop after PHASES (see [Compilation Phases](#compilation-phases))" + abbreviations: + - "-stop" - option: "-Ystop-before" schema: type: "Phases" diff --git a/_overviews/compiler-options/index.md b/_overviews/compiler-options/index.md index 47536e5036..69e2338a82 100644 --- a/_overviews/compiler-options/index.md +++ b/_overviews/compiler-options/index.md @@ -81,7 +81,11 @@ scalacOptions ++= Seq( {% capture option_argument %}{% if option.schema.type != "Boolean" and option.schema.type != "Prefix" %}{{ option_argument_separator }}{{ option_argument_placeholder }}{% if option.schema.multiple %}1,{{ option_argument_placeholder }}2{% endif %}{% endif %}{% endcapture %}
{{ option.option | xml_escape }}{{ option_argument }} - {% if option.abbreviation %} or {{ option.abbreviation | xml_escape }}{{ option_argument }}{% endif %} + {% if option.abbreviations %} + {% for abbreviation in option.abbreviations %} + or {{ abbreviation | xml_escape }}{{ option_argument }} + {% endfor %} + {% endif %}
{% if option.deprecated %}
Deprecated: {{ option.deprecated | markdownify | remove: '

' | remove: '

'}}
{% endif %}
From 15ce710f546d4d47b20519edb9bdaffcd46a9eb7 Mon Sep 17 00:00:00 2001 From: exoego Date: Thu, 3 May 2018 06:51:43 +0900 Subject: [PATCH 06/12] Indent array elements uniformly (no indent) --- _data/compiler-options.yml | 1944 ++++++++++++++++++------------------ 1 file changed, 972 insertions(+), 972 deletions(-) diff --git a/_data/compiler-options.yml b/_data/compiler-options.yml index 8b815f0d14..1c01c40fbd 100644 --- a/_data/compiler-options.yml +++ b/_data/compiler-options.yml @@ -2,409 +2,409 @@ description: "A set of standard options that are supported on the current development environment and will be supported in future releases." options: # Path related settings. - - option: "-classpath" - schema: - type: "Path" - arg: "path" - description: "Specify where to find user class files." - abbreviations: - - "-cp" - - option: "-bootclasspath" - schema: - type: "Path" - arg: "path" - default: "Defaults.scalaBootClassPath" - description: "Override location of bootstrap class files." - - option: "-extdirs" - schema: - type: "Path" - arg: "path" - default: "Defaults.scalaExtDirs" - description: "Override location of installed extensions." - - option: "-javabootclasspath" - schema: - type: "Path" - arg: "path" - default: "Defaults.javaBootClassPath" - description: "Override java boot classpath." - - option: "-javaextdirs" - schema: - type: "Path" - arg: "path" - default: "Defaults.javaExtDirs" - description: "Override java extdirs classpath." - - option: "-sourcepath" - schema: - type: "Path" - description: "Specify location(s) of source files." - - option: "-dependencyfile" - schema: - type: "String" - arg: "file" - default: ".scala_dependencies" - description: "Set dependency tracking file." - - option: "-deprecation" - schema: - type: "Boolean" - description: "Emit warning and location for usages of deprecated APIs." - - option: "-encoding" - schema: - type: "String" - arg: "encoding" - default: "Properties.sourceEncoding" - description: "Specify character encoding used by source files." - - option: "-explaintypes" - schema: - type: "Boolean" - description: "Explain type errors in more detail." - - option: "-feature" - schema: - type: "Boolean" - description: "Emit warning and location for usages of features that should be imported explicitly." - - option: "-g" - schema: - type: "Choice" - arg: "level" - default: "vars" - choices: - - choice: "none" - - choice: "source" - - choice: "line" - - choice: "vars" - - choice: "notailcalls" - description: "Set level of generated debugging info." - - option: "-help" - schema: - type: "Boolean" - description: "Print a synopsis of standard options." - - option: "-nowarn" - schema: - type: "Boolean" - description: "Generate no warnings." - - option: "-optimise" - schema: - type: "Boolean" - description: "Compiler flag for the optimizer in Scala 2.11." - abbreviations: - - "-optimize" - deprecated: "In 2.12, `-optimise` enables `-opt:l:inline -opt-inline-from:**`. Check `-opt:help` for using the Scala 2.12 optimizer." - - option: "-print" - schema: - type: "Boolean" - description: "Print program with Scala-specific features removed." - - option: "-target" - scheam: - type: "Choice" - default: "jvm-1.8" - choices: - - choice: "jvm-1.5" - - choice: "jvm-1.6" - - choice: "jvm-1.7" - - choice: "jvm-1.8" - description: "Target platform for object files. All JVM `1.5` - `1.7` targets are deprecated." - - option: "-unchecked" - schema: - type: "Boolean" - description: "Enable additional warnings where generated code depends on assumptions." - - option: "-uniqid" - schema: - type: "Boolean" - description: "Uniquely tag all identifiers in debugging output." - - option: "-usejavacp" - schema: - type: "Boolean" - description: "Utilize the `java.class.path` in classpath resolution." - - option: "-usemanifestcp" - schema: - type: "Boolean" - description: "Utilize the manifest in classpath resolution." - - option: "-verbose" - schema: - type: "Boolean" - description: "Output messages about what the compiler is doing." - - option: "-version" - schema: - type: "Boolean" - description: "Print product version and exit." - - option: "-no-specialization" - schema: - type: "Boolean" - description: "Ignore `@specialize` annotations." - - option: "-language" - schema: - type: "Choice" - multiple: true - arg: "feat" - choices: - - choice: "dynamics" - description: "Allow direct or indirect subclasses of `scala.Dynamic`." - - choice: "postfixOps" - description: "Allow postfix operator notation, such as `1 to 10 toList`." - - choice: "reflectiveCalls" - description: "Allow reflective access to members of structural types." - - choice: "implicitConversions" - description: "Allow definition of implicit functions called views." - - choice: "higherKinds" - description: "Allow higher-kinded types." - - choice: "existentials" - description: "Existential types (besides wildcard types) can be written and inferred." - - choice: "experimental.macros" - description: "Allow macro definition (besides implementation and application." - description: "Enable or disable language features." - - option: "-release" - schema: - type: "String" - arg: "release" - description: "Compile for a specific version of the Java platform. Supported targets: 6, 7, 8, 9." + - option: "-classpath" + schema: + type: "Path" + arg: "path" + description: "Specify where to find user class files." + abbreviations: + - "-cp" + - option: "-bootclasspath" + schema: + type: "Path" + arg: "path" + default: "Defaults.scalaBootClassPath" + description: "Override location of bootstrap class files." + - option: "-extdirs" + schema: + type: "Path" + arg: "path" + default: "Defaults.scalaExtDirs" + description: "Override location of installed extensions." + - option: "-javabootclasspath" + schema: + type: "Path" + arg: "path" + default: "Defaults.javaBootClassPath" + description: "Override java boot classpath." + - option: "-javaextdirs" + schema: + type: "Path" + arg: "path" + default: "Defaults.javaExtDirs" + description: "Override java extdirs classpath." + - option: "-sourcepath" + schema: + type: "Path" + description: "Specify location(s) of source files." + - option: "-dependencyfile" + schema: + type: "String" + arg: "file" + default: ".scala_dependencies" + description: "Set dependency tracking file." + - option: "-deprecation" + schema: + type: "Boolean" + description: "Emit warning and location for usages of deprecated APIs." + - option: "-encoding" + schema: + type: "String" + arg: "encoding" + default: "Properties.sourceEncoding" + description: "Specify character encoding used by source files." + - option: "-explaintypes" + schema: + type: "Boolean" + description: "Explain type errors in more detail." + - option: "-feature" + schema: + type: "Boolean" + description: "Emit warning and location for usages of features that should be imported explicitly." + - option: "-g" + schema: + type: "Choice" + arg: "level" + default: "vars" + choices: + - choice: "none" + - choice: "source" + - choice: "line" + - choice: "vars" + - choice: "notailcalls" + description: "Set level of generated debugging info." + - option: "-help" + schema: + type: "Boolean" + description: "Print a synopsis of standard options." + - option: "-nowarn" + schema: + type: "Boolean" + description: "Generate no warnings." + - option: "-optimise" + schema: + type: "Boolean" + description: "Compiler flag for the optimizer in Scala 2.11." + abbreviations: + - "-optimize" + deprecated: "In 2.12, `-optimise` enables `-opt:l:inline -opt-inline-from:**`. Check `-opt:help` for using the Scala 2.12 optimizer." + - option: "-print" + schema: + type: "Boolean" + description: "Print program with Scala-specific features removed." + - option: "-target" + scheam: + type: "Choice" + default: "jvm-1.8" + choices: + - choice: "jvm-1.5" + - choice: "jvm-1.6" + - choice: "jvm-1.7" + - choice: "jvm-1.8" + description: "Target platform for object files. All JVM `1.5` - `1.7` targets are deprecated." + - option: "-unchecked" + schema: + type: "Boolean" + description: "Enable additional warnings where generated code depends on assumptions." + - option: "-uniqid" + schema: + type: "Boolean" + description: "Uniquely tag all identifiers in debugging output." + - option: "-usejavacp" + schema: + type: "Boolean" + description: "Utilize the `java.class.path` in classpath resolution." + - option: "-usemanifestcp" + schema: + type: "Boolean" + description: "Utilize the manifest in classpath resolution." + - option: "-verbose" + schema: + type: "Boolean" + description: "Output messages about what the compiler is doing." + - option: "-version" + schema: + type: "Boolean" + description: "Print product version and exit." + - option: "-no-specialization" + schema: + type: "Boolean" + description: "Ignore `@specialize` annotations." + - option: "-language" + schema: + type: "Choice" + multiple: true + arg: "feat" + choices: + - choice: "dynamics" + description: "Allow direct or indirect subclasses of `scala.Dynamic`." + - choice: "postfixOps" + description: "Allow postfix operator notation, such as `1 to 10 toList`." + - choice: "reflectiveCalls" + description: "Allow reflective access to members of structural types." + - choice: "implicitConversions" + description: "Allow definition of implicit functions called views." + - choice: "higherKinds" + description: "Allow higher-kinded types." + - choice: "existentials" + description: "Existential types (besides wildcard types) can be written and inferred." + - choice: "experimental.macros" + description: "Allow macro definition (besides implementation and application." + description: "Enable or disable language features." + - option: "-release" + schema: + type: "String" + arg: "release" + description: "Compile for a specific version of the Java platform. Supported targets: 6, 7, 8, 9." - category: "JVM Settings" description: "Settings influencing the runtime system." options: - - option: "-Jflag" - schema: - type: "Prefix" - description: "Pass `flag` directly to the runtime system." - - option: "-Dproperty=value" - schema: - type: "Prefix" - description: "Pass `-Dproperty=value` directly to the runtime system." - - option: "-nobootcp" - schema: - type: "Boolean" - description: "Do not use the boot classpath for the scala jars." + - option: "-Jflag" + schema: + type: "Prefix" + description: "Pass `flag` directly to the runtime system." + - option: "-Dproperty=value" + schema: + type: "Prefix" + description: "Pass `-Dproperty=value` directly to the runtime system." + - option: "-nobootcp" + schema: + type: "Boolean" + description: "Do not use the boot classpath for the scala jars." - category: "Plugin Settings" description: "" options: - - option: "-P" - schema: - type: "Prefix" - arg: ":plugin:opt" - description: "Pass an option to a plugin in the form of `-P::`." - note: "If you use sbt, [compiler plugins support](https://www.scala-sbt.org/1.x/docs/Compiler-Plugins.html) may be useful." + - option: "-P" + schema: + type: "Prefix" + arg: ":plugin:opt" + description: "Pass an option to a plugin in the form of `-P::`." + note: "If you use sbt, [compiler plugins support](https://www.scala-sbt.org/1.x/docs/Compiler-Plugins.html) may be useful." - category: "Advanced Settings" description: "Options that starts with `-X` are maybe renamed or removed in future releases." options: - - option: "-X" - schema: - type: "Boolean" - description: "Print a synopsis of advanced options." - - option: "-Xcheckinit" - schema: - type: "Boolean" - description: "Wrap field accessors to throw an exception on uninitialized access." - - option: "-Xdev" - schema: - type: "Boolean" - description: "Indicates user is a developer - issue warnings about anything which seems amiss." - - option: "-Xdisable-assertions" - schema: - type: "Boolean" - description: "Generate no assertions or assumptions." - - option: "-Xelide-below" - schema: - type: "Int" - arg: "min" - default: "Int.MinValue" - description: "Calls to `@elidable` methods are omitted if method priority is lower than argument." - - option: "-Xno-forwarders" - schema: - type: "Boolean" - description: "Do not generate static forwarders in mirror classes." - - option: "-Xgenerate-phase-graph" - schema: - type: "String" - arg: "file" - description: "Generate the phase graphs (outputs .dot files) to fileX.dot." - - option: "-Xlog-implicits" - schema: - type: "Boolean" - description: "Show more detail on why some implicits are not applicable." - - option: "-Xlog-implicit-conversions" - schema: - type: "Boolean" - description: "Print a message whenever an implicit conversion is inserted." - - option: "-Xlog-reflective-calls" - schema: - type: "Boolean" - description: "Print a message when a reflective method call is generated." - - option: "-Xlog-free-terms" - schema: - type: "Boolean" - description: "Print a message when reification creates a free term." - - option: "-Xlog-free-types" - schema: - type: "Boolean" - description: "Print a message when reification resorts to generating a free type." - - option: "-Xmax-classfile-name" - schema: - type: "Int" - arg: "max" - default: 255 - min: 72 - max: 255 - description: "Maximum filename length for generated classes." - - option: "-Xmaxerrs" - schema: - type: "Int" - arg: "max" - default: 100 - description: "Maximum errors to print." - - option: "-Xmaxwarns" - schema: - type: "Int" - arg: "max" - default: 100 - description: "Maximum warnings to print." - - option: "-Xmigration" - schema: - type: "ScalaVersion" - arg: "version" - default: "any" - description: "Warn about constructs whose behavior may have changed since version." - - option: "-Xno-uescape" - schema: - type: "Boolean" - description: "Disable handling of \\u unicode escapes." - - option: "-Xnojline" - schema: - type: "Boolean" - description: "Do not use JLine for editing." - - option: "-Xverify" - schema: - type: "Boolean" - description: "Verify generic signatures in generated bytecode." - - option: "-Xplugin" - schema: - type: "String" - multiple: true - arg: "path" - description: "Load a plugin from each classpath." - - option: "-Xplugin-disable" - schema: - type: "String" - multiple: true - arg: "plugin" - description: "Disable plugins by name." - - option: "-Xplugin-list" - schema: - type: "Boolean" - description: "Print a synopsis of loaded plugins." - - option: "-Xplugin-require" - schema: - type: "String" - multiple: true - arg: "plugin" - description: "Abort if a named plugin is not loaded." - - option: "-Xpluginsdir" - schema: - type: "String" - arg: "path" - default: "Defaults.scalaPluginPath" - description: "Path to search for plugin archives." - - option: "-Xprint" - schema: - type: "Phases" - arg: "phases" - description: "Print out program after PHASES (see [Compilation Phases](#compilation-phases))" - - option: "-Xprint-pos" - schema: - type: "Boolean" - description: "Print tree positions, as offsets." - - option: "-Xprint-types" - schema: - type: "Boolean" - description: "Print tree types (debugging option)." - - option: "-Xprint-args" - schema: - type: "Boolean" - description: "Print all compiler arguments and exit." - - option: "-Xprompt" - schema: - type: "Boolean" - description: "Display a prompt after each error (debugging option)." - - option: "-Xresident" - schema: - type: "Boolean" - description: "Compiler stays resident: read source filenames from standard input." - - option: "-Xscript" - schema: - type: "String" - arg: "object" - description: "Treat the source file as a script and wrap it in a main method." - - option: "-Xmain-class" - schema: - type: "String" - arg: "path" - description: "Class for manifest's Main-Class entry (only useful with `-d `)" - - option: "-Xshow-class" - schema: - type: "String" - arg: "class" - description: "Show internal representation of class." - - option: "-Xshow-object" - schema: - type: "String" - arg: "object" - description: "Show internal representation of object." - - option: "-Xshow-phases" - schema: - type: "Boolean" - description: "Print a synopsis of compiler phases." - - option: "-Xsource-reader" - schema: - type: "String" - arg: "classname" - description: "Specify a custom method for reading source files." - - option: "-Xreporter" - schema: - type: "String" - arg: "classname" - default: "scala.tools.nsc.reporters.ConsoleReporter" - description: "Specify a custom reporter for compiler messages." - - option: "-Xstrict-inference" - schema: - type: "Boolean" - description: "Don't infer known-unsound types." - - option: "-Xsource" - schema: - type: "Scala Version" - arg: "version" - default: "2.13" - description: "Treat compiler input as Scala source for the specified version, see [scala/bug#8126](https://github.com/scala/bug/issues/8126)." - - option: "-Xno-patmat-analysis" - schema: - type: "Boolean" - description: "Don't perform exhaustivity/unreachability analysis. Also, ignore `@switch` annotation." - - option: "-Xfull-lubs" - schema: - type: "Boolean" - description: "Retains pre 2.10 behavior of less aggressive truncation of least upper bounds." - - option: "-Xmixin-force-forwarders" - schema: - type: "Choice" - arg: "mode" - default: "true" - choices: - - choice: "true" - description: "Always generate mixin forwarders." - - choice: "junit" - description: "Generate mixin forwarders for JUnit-annotated methods (JUnit 4 does not support default methods)." - - choice: "false" - description: "Only generate mixin forwarders required for program correctness." - description: "Generate forwarder methods in classes inhering concrete methods from traits." - - option: "-Xxml" - schema: - type: "Choice" - arg: "property" - choices: - - choice: "coalescing" - description: "Convert PCData to Text and coalesce sibling nodes." - description: "Configure XML parsing." + - option: "-X" + schema: + type: "Boolean" + description: "Print a synopsis of advanced options." + - option: "-Xcheckinit" + schema: + type: "Boolean" + description: "Wrap field accessors to throw an exception on uninitialized access." + - option: "-Xdev" + schema: + type: "Boolean" + description: "Indicates user is a developer - issue warnings about anything which seems amiss." + - option: "-Xdisable-assertions" + schema: + type: "Boolean" + description: "Generate no assertions or assumptions." + - option: "-Xelide-below" + schema: + type: "Int" + arg: "min" + default: "Int.MinValue" + description: "Calls to `@elidable` methods are omitted if method priority is lower than argument." + - option: "-Xno-forwarders" + schema: + type: "Boolean" + description: "Do not generate static forwarders in mirror classes." + - option: "-Xgenerate-phase-graph" + schema: + type: "String" + arg: "file" + description: "Generate the phase graphs (outputs .dot files) to fileX.dot." + - option: "-Xlog-implicits" + schema: + type: "Boolean" + description: "Show more detail on why some implicits are not applicable." + - option: "-Xlog-implicit-conversions" + schema: + type: "Boolean" + description: "Print a message whenever an implicit conversion is inserted." + - option: "-Xlog-reflective-calls" + schema: + type: "Boolean" + description: "Print a message when a reflective method call is generated." + - option: "-Xlog-free-terms" + schema: + type: "Boolean" + description: "Print a message when reification creates a free term." + - option: "-Xlog-free-types" + schema: + type: "Boolean" + description: "Print a message when reification resorts to generating a free type." + - option: "-Xmax-classfile-name" + schema: + type: "Int" + arg: "max" + default: 255 + min: 72 + max: 255 + description: "Maximum filename length for generated classes." + - option: "-Xmaxerrs" + schema: + type: "Int" + arg: "max" + default: 100 + description: "Maximum errors to print." + - option: "-Xmaxwarns" + schema: + type: "Int" + arg: "max" + default: 100 + description: "Maximum warnings to print." + - option: "-Xmigration" + schema: + type: "ScalaVersion" + arg: "version" + default: "any" + description: "Warn about constructs whose behavior may have changed since version." + - option: "-Xno-uescape" + schema: + type: "Boolean" + description: "Disable handling of \\u unicode escapes." + - option: "-Xnojline" + schema: + type: "Boolean" + description: "Do not use JLine for editing." + - option: "-Xverify" + schema: + type: "Boolean" + description: "Verify generic signatures in generated bytecode." + - option: "-Xplugin" + schema: + type: "String" + multiple: true + arg: "path" + description: "Load a plugin from each classpath." + - option: "-Xplugin-disable" + schema: + type: "String" + multiple: true + arg: "plugin" + description: "Disable plugins by name." + - option: "-Xplugin-list" + schema: + type: "Boolean" + description: "Print a synopsis of loaded plugins." + - option: "-Xplugin-require" + schema: + type: "String" + multiple: true + arg: "plugin" + description: "Abort if a named plugin is not loaded." + - option: "-Xpluginsdir" + schema: + type: "String" + arg: "path" + default: "Defaults.scalaPluginPath" + description: "Path to search for plugin archives." + - option: "-Xprint" + schema: + type: "Phases" + arg: "phases" + description: "Print out program after PHASES (see [Compilation Phases](#compilation-phases))" + - option: "-Xprint-pos" + schema: + type: "Boolean" + description: "Print tree positions, as offsets." + - option: "-Xprint-types" + schema: + type: "Boolean" + description: "Print tree types (debugging option)." + - option: "-Xprint-args" + schema: + type: "Boolean" + description: "Print all compiler arguments and exit." + - option: "-Xprompt" + schema: + type: "Boolean" + description: "Display a prompt after each error (debugging option)." + - option: "-Xresident" + schema: + type: "Boolean" + description: "Compiler stays resident: read source filenames from standard input." + - option: "-Xscript" + schema: + type: "String" + arg: "object" + description: "Treat the source file as a script and wrap it in a main method." + - option: "-Xmain-class" + schema: + type: "String" + arg: "path" + description: "Class for manifest's Main-Class entry (only useful with `-d `)" + - option: "-Xshow-class" + schema: + type: "String" + arg: "class" + description: "Show internal representation of class." + - option: "-Xshow-object" + schema: + type: "String" + arg: "object" + description: "Show internal representation of object." + - option: "-Xshow-phases" + schema: + type: "Boolean" + description: "Print a synopsis of compiler phases." + - option: "-Xsource-reader" + schema: + type: "String" + arg: "classname" + description: "Specify a custom method for reading source files." + - option: "-Xreporter" + schema: + type: "String" + arg: "classname" + default: "scala.tools.nsc.reporters.ConsoleReporter" + description: "Specify a custom reporter for compiler messages." + - option: "-Xstrict-inference" + schema: + type: "Boolean" + description: "Don't infer known-unsound types." + - option: "-Xsource" + schema: + type: "Scala Version" + arg: "version" + default: "2.13" + description: "Treat compiler input as Scala source for the specified version, see [scala/bug#8126](https://github.com/scala/bug/issues/8126)." + - option: "-Xno-patmat-analysis" + schema: + type: "Boolean" + description: "Don't perform exhaustivity/unreachability analysis. Also, ignore `@switch` annotation." + - option: "-Xfull-lubs" + schema: + type: "Boolean" + description: "Retains pre 2.10 behavior of less aggressive truncation of least upper bounds." + - option: "-Xmixin-force-forwarders" + schema: + type: "Choice" + arg: "mode" + default: "true" + choices: + - choice: "true" + description: "Always generate mixin forwarders." + - choice: "junit" + description: "Generate mixin forwarders for JUnit-annotated methods (JUnit 4 does not support default methods)." + - choice: "false" + description: "Only generate mixin forwarders required for program correctness." + description: "Generate forwarder methods in classes inhering concrete methods from traits." + - option: "-Xxml" + schema: + type: "Choice" + arg: "property" + choices: + - choice: "coalescing" + description: "Convert PCData to Text and coalesce sibling nodes." + description: "Configure XML parsing." @@ -416,597 +416,597 @@ Some optimization-related options, e.g. `-opt:**` and `-opt-inline-form` are included in this section, since **REASON_HERE**. options: - - option: "-Y" - schema: - type: "Boolean" - description: "Print a synopsis of private options." - - option: "-Yoverride-objects" - schema: - type: "Boolean" - description: "Allow member objects to be overridden." - - option: "-Yoverride-vars" - schema: - type: "Boolean" - description: "Allow vars to be overridden." - - option: "-Ybreak-cycles" - schema: - type: "Boolean" - description: "Attempt to break cycles encountered during typing." - - option: "-Ybrowse" - schema: - type: "Phases" - arg: "phases" - description: "Browse the abstract syntax tree after PHASES (see [Compilation Phases](#compilation-phases))" - - option: "-Ycheck" - schema: - type: "Phases" - arg: "phases" - description: "Check the tree at the end of PHASES (see [Compilation Phases](#compilation-phases))" - - option: "-Yshow" - schema: - type: "Phases" - arg: "phases" - description: "(Requires `-Xshow-class` or `-Xshow-object`) Show after PHASES (see [Compilation Phases](#compilation-phases))" - - option: "-Ycompact-trees" - schema: - type: "Boolean" - description: "Use compact tree printer when displaying trees." - - option: "-Yno-completion" - schema: - type: "Boolean" - description: "Disable tab-completion in the REPL." - - option: "-Ydebug" - schema: - type: "Boolean" - description: "Increase the quantity of debugging output." - - option: "-Yresolve-term-conflict" - schema: - type: "Choice" - arg: "strategy" - default: "error" - choices: - - choice: "package" - - choice: "object" - - choice: "error" - description: "Resolve term conflicts." - - option: "-Ylog" - schema: - type: "Phases" - arg: "phases" - description: "Log operations during PHASES (see [Compilation Phases](#compilation-phases))" - - option: "-Ylog-classpath" - schema: - type: "Boolean" - description: "Output information about what classpath is being applied." - - option: "-Yno-generic-signatures" - schema: - type: "Boolean" - description: "Suppress generation of generic signatures for Java." - - option: "-Yno-imports" - schema: - type: "Boolean" - description: "Compile without importing scala.*, java.lang.*, or Predef." - - option: "-Yno-predef" - schema: - type: "Boolean" - description: "Compile without importing Predef." - - option: "-Yno-adapted-args" - schema: - type: "Boolean" - description: "Do not adapt an argument list (either by inserting () or creating a tuple) to match the receiver." - - option: "-Yrecursion" - schema: - type: "Int" - arg: "depth" - default: 0 - min: 0 - max: Int.MaxValue - description: "Set recursion depth used when locking symbols." - - option: "-Yshow-trees" - schema: - type: "Boolean" - description: "(Requires `-Xprint:`) Print detailed ASTs in formatted form." - - option: "-Yshow-trees-compact" - schema: - type: "Boolean" - description: "(Requires `-Xprint:`) Print detailed ASTs in compact form." - - option: "-Yshow-trees-stringified" - schema: - type: "Boolean" - description: "(Requires `-Xprint:`) Print stringifications along with detailed ASTs." - - option: "-Yshow-syms" - schema: - type: "Boolean" - description: "Print the AST symbol hierarchy after each phase." - - option: "-Yshow-symkinds" - schema: - type: "Boolean" - description: "Print abbreviated symbol kinds next to symbol names." - - option: "-Yshow-symowners" - schema: - type: "Boolean" - description: "Print owner identifiers next to symbol names." - - option: "-Yskip" - schema: - type: "Phases" - arg: "phases" - description: "Skip PHASES (see [Compilation Phases](#compilation-phases))" - - option: "-Ygen-asmp" - schema: - type: "String" - arg: "dir" - description: "Generate a parallel output directory of .asmp files (ie ASM Textifier output)." - - option: "-Ydump-classes" - schema: - type: "String" - arg: "dir" - description: "Dump the generated bytecode to .class files (useful for reflective compilation that utilizes in-memory classloaders)." - - option: "-Ystop-after" - schema: - type: "Phases" - arg: "phases" - description: "Stop after PHASES (see [Compilation Phases](#compilation-phases))" - abbreviations: - - "-stop" - - option: "-Ystop-before" - schema: - type: "Phases" - arg: "phases" - description: "Stop before PHASES (see [Compilation Phases](#compilation-phases))" - - option: "-Yrangepos" - schema: - type: "Boolean" - description: "Use range positions for syntax trees." - - option: "-Yshow-member-pos" - schema: - type: "String" - arg: "style" - description: "Show start and end positions of members." - note: "`-Yrangepos` is enabled at the same time." - - option: "-Yreify-copypaste" - schema: - type: "Boolean" - description: "Dump the reified trees in copypasteable representation." - - option: "-Ymacro-expand" - schema: - type: "Choice" - arg: "policy" - default: "normal" - choices: - - choice: "none" - - choice: "normal" - - choice: "discard" - description: "Control expansion of macros, useful for scaladoc and presentation compiler." - - option: "-Ymacro-no-expand" - schema: - type: "Boolean" - description: "Don't expand macros. Might be useful for scaladoc and presentation compiler, but will crash anything which uses macros and gets past typer." - deprecated: "Use `-Ymacro-expand:none` instead." - - option: "-Yrepl-sync" - schema: - type: "Boolean" - description: "Do not use asynchronous code for REPL startup." - - option: "-Yrepl-class-based" - schema: - type: "Boolean" - description: "Use classes to wrap REPL snippets instead of objects." - - option: "-Yrepl-outdir" - schema: - type: "String" - arg: "path" - description: "Write repl-generated classfiles to given output directory (use \"\" to generate a temporary dir)" - - option: "-Yinfer-argument-types" - schema: - type: "Boolean" - description: "Infer types for arguments of overridden methods." - - option: "-YdisableFlatCpCaching" - schema: - type: "Boolean" - description: "Do not cache flat classpath representation of classpath elements from jars across compiler instances." - - option: "-Yvirtpatmat" - schema: - type: "Boolean" - description: "Enable pattern matcher virtualization." - - option: "-Yexpose-empty-package" + - option: "-Y" + schema: + type: "Boolean" + description: "Print a synopsis of private options." + - option: "-Yoverride-objects" + schema: + type: "Boolean" + description: "Allow member objects to be overridden." + - option: "-Yoverride-vars" + schema: + type: "Boolean" + description: "Allow vars to be overridden." + - option: "-Ybreak-cycles" + schema: + type: "Boolean" + description: "Attempt to break cycles encountered during typing." + - option: "-Ybrowse" + schema: + type: "Phases" + arg: "phases" + description: "Browse the abstract syntax tree after PHASES (see [Compilation Phases](#compilation-phases))" + - option: "-Ycheck" + schema: + type: "Phases" + arg: "phases" + description: "Check the tree at the end of PHASES (see [Compilation Phases](#compilation-phases))" + - option: "-Yshow" + schema: + type: "Phases" + arg: "phases" + description: "(Requires `-Xshow-class` or `-Xshow-object`) Show after PHASES (see [Compilation Phases](#compilation-phases))" + - option: "-Ycompact-trees" + schema: + type: "Boolean" + description: "Use compact tree printer when displaying trees." + - option: "-Yno-completion" + schema: + type: "Boolean" + description: "Disable tab-completion in the REPL." + - option: "-Ydebug" + schema: + type: "Boolean" + description: "Increase the quantity of debugging output." + - option: "-Yresolve-term-conflict" + schema: + type: "Choice" + arg: "strategy" + default: "error" + choices: + - choice: "package" + - choice: "object" + - choice: "error" + description: "Resolve term conflicts." + - option: "-Ylog" + schema: + type: "Phases" + arg: "phases" + description: "Log operations during PHASES (see [Compilation Phases](#compilation-phases))" + - option: "-Ylog-classpath" + schema: + type: "Boolean" + description: "Output information about what classpath is being applied." + - option: "-Yno-generic-signatures" + schema: + type: "Boolean" + description: "Suppress generation of generic signatures for Java." + - option: "-Yno-imports" + schema: + type: "Boolean" + description: "Compile without importing scala.*, java.lang.*, or Predef." + - option: "-Yno-predef" + schema: + type: "Boolean" + description: "Compile without importing Predef." + - option: "-Yno-adapted-args" + schema: + type: "Boolean" + description: "Do not adapt an argument list (either by inserting () or creating a tuple) to match the receiver." + - option: "-Yrecursion" + schema: + type: "Int" + arg: "depth" + default: 0 + min: 0 + max: Int.MaxValue + description: "Set recursion depth used when locking symbols." + - option: "-Yshow-trees" + schema: + type: "Boolean" + description: "(Requires `-Xprint:`) Print detailed ASTs in formatted form." + - option: "-Yshow-trees-compact" + schema: + type: "Boolean" + description: "(Requires `-Xprint:`) Print detailed ASTs in compact form." + - option: "-Yshow-trees-stringified" + schema: + type: "Boolean" + description: "(Requires `-Xprint:`) Print stringifications along with detailed ASTs." + - option: "-Yshow-syms" + schema: + type: "Boolean" + description: "Print the AST symbol hierarchy after each phase." + - option: "-Yshow-symkinds" + schema: + type: "Boolean" + description: "Print abbreviated symbol kinds next to symbol names." + - option: "-Yshow-symowners" + schema: + type: "Boolean" + description: "Print owner identifiers next to symbol names." + - option: "-Yskip" + schema: + type: "Phases" + arg: "phases" + description: "Skip PHASES (see [Compilation Phases](#compilation-phases))" + - option: "-Ygen-asmp" + schema: + type: "String" + arg: "dir" + description: "Generate a parallel output directory of .asmp files (ie ASM Textifier output)." + - option: "-Ydump-classes" + schema: + type: "String" + arg: "dir" + description: "Dump the generated bytecode to .class files (useful for reflective compilation that utilizes in-memory classloaders)." + - option: "-Ystop-after" + schema: + type: "Phases" + arg: "phases" + description: "Stop after PHASES (see [Compilation Phases](#compilation-phases))" + abbreviations: + - "-stop" + - option: "-Ystop-before" + schema: + type: "Phases" + arg: "phases" + description: "Stop before PHASES (see [Compilation Phases](#compilation-phases))" + - option: "-Yrangepos" + schema: + type: "Boolean" + description: "Use range positions for syntax trees." + - option: "-Yshow-member-pos" + schema: + type: "String" + arg: "style" + description: "Show start and end positions of members." + note: "`-Yrangepos` is enabled at the same time." + - option: "-Yreify-copypaste" + schema: + type: "Boolean" + description: "Dump the reified trees in copypasteable representation." + - option: "-Ymacro-expand" + schema: + type: "Choice" + arg: "policy" + default: "normal" + choices: + - choice: "none" + - choice: "normal" + - choice: "discard" + description: "Control expansion of macros, useful for scaladoc and presentation compiler." + - option: "-Ymacro-no-expand" + schema: + type: "Boolean" + description: "Don't expand macros. Might be useful for scaladoc and presentation compiler, but will crash anything which uses macros and gets past typer." + deprecated: "Use `-Ymacro-expand:none` instead." + - option: "-Yrepl-sync" + schema: + type: "Boolean" + description: "Do not use asynchronous code for REPL startup." + - option: "-Yrepl-class-based" + schema: + type: "Boolean" + description: "Use classes to wrap REPL snippets instead of objects." + - option: "-Yrepl-outdir" + schema: + type: "String" + arg: "path" + description: "Write repl-generated classfiles to given output directory (use \"\" to generate a temporary dir)" + - option: "-Yinfer-argument-types" + schema: + type: "Boolean" + description: "Infer types for arguments of overridden methods." + - option: "-YdisableFlatCpCaching" + schema: + type: "Boolean" + description: "Do not cache flat classpath representation of classpath elements from jars across compiler instances." + - option: "-Yvirtpatmat" + schema: + type: "Boolean" + description: "Enable pattern matcher virtualization." + - option: "-Yexpose-empty-package" # TODO: internal only - internalOnly: true - schema: - type: "Boolean" - description: "Internal only: expose the empty package." - - option: "-Ydelambdafy" - schema: - type: "Choice" - arg: "strategy" - default: "method" - choices: - - choice: "inline" - - choice: "method" - description: "Strategy used for translating lambdas into JVM code." - - option: "-Ybackend-parallelism" - schema: - type: "Int" - arg: "threads" - default: 1 - min: 1 - max: 16 - description: "Maximum worker threads for backend." - - option: "-Ybackend-worker-queue" - description: "Backend threads worker queue size." - schema: - type: "Int" - arg: "size" - default: 0 - min: 0 - max: 1000 - - option: "-Yjar-compression-level" - schema: - type: "Int" - arg: "level" - default: "Deflater.DEFAULT_COMPRESSION" - min: "Deflater.DEFAULT_COMPRESSION" - max: "Deflater.BEST_COMPRESSION" - description: "Compression level to use when writing jar files." - - option: "-Ycache-plugin-class-loader" - schema: - type: "Choice" - default: "none" - choices: - - choice: "none" - description: "Don't cache class loader." - - choice: "last-modified" - description: "Cache class loader, using file last-modified time to invalidate." - description: "Policy for caching class loaders for compiler plugins that are dynamically loaded." - - option: "-Ycache-macro-class-loader" - schema: - type: "Choice" - default: "none" - choices: - - choice: "none" - description: "Don't cache class loader." - - choice: "last-modified" - description: "Cache class loader, using file last-modified time to invalidate." - description: "Policy for caching class loaders for macros that are dynamically loaded." - - option: "-opt" - schema: - type: "Choice" - multiple: true - choices: - - choice: "unreachable-code" - description: "Eliminate unreachable code, exception handlers guarding no instructions, redundant metadata (debug information, line numbers)." - - choice: "simplify-jumps" - description: "Simplify branching instructions, eliminate unnecessary ones." - - choice: "compact-locals" - description: "Eliminate empty slots in the sequence of local variables." - - choice: "copy-propagation" - description: "Eliminate redundant local variables and unused values (including closures). Enables unreachable-code." - - choice: "redundant-casts" - description: "Eliminate redundant casts using a type propagation analysis." - - choice: "box-unbox" - description: "Eliminate box-unbox pairs within the same method (also tuples, xRefs, value class instances). Enables unreachable-code." - - choice: "nullness-tracking" - description: "Track nullness / non-nullness of local variables and apply optimizations." - - choice: "closure-invocations" - description: "Rewrite closure invocations to the implementation method." - - choice: "inline" - description: "Inline method invocations according to `-Yopt-inline-heuristics` and `-opt-inline-from`." - - choice: "l:none" - description: "Disable optimizations. Takes precedence: `-opt:l:none,+box-unbox` / `-opt:l:none -opt:box-unbox` don't enable box-unbox." - note: "Unlike the other optimizer levels, `l:none` appears up in the `opt.value` set because it's not an expanding option." - - choice: "l:default" - description: "Enable default optimizations: `unreachable-code`." - - choice: "l:method" - description: "Enable intra-method optimizations: `unreachable-code`, `simplify-jumps`, `compact-locals`, `copy-propagation`, `redundant-casts`, `box-unbox`, `nullness-tracking`, `closure-invocations`." - - choice: "l:inline" - description: "Enable cross-method optimizations (note: inlining requires `-opt-inline-from`): `unreachable-code`, `simplify-jumps`, `compact-locals`, `copy-propagation`, `redundant-casts`, `box-unbox`, `nullness-tracking`, `closure-invocations`, `inline`." - - choice: "l:project" - description: "Enable cross-method optimizations within the current project." - deprecated: "Use `-opt:l:inline -opt-inline-from` instead." - - choice: "l:classpath" - description: "Enable cross-method optimizations across the entire classpath." - deprecated: "Use `-opt:l:inline -opt-inline-from` instead." - description: "Enable optimizations. Check `-opt:help` for using the Scala 2.12 optimizer." - note: "if `inline` not contained and either `l:project` or `l:classpath` are contained, then `l:inline` is enabled." - - option: "-opt-inline-from" - schema: - type: "String" - multiple: true - arg: "pattern" - description: "Patterns for classfile names from which to allow inlining, `help` for details." - - option: "-Yopt-inline-heuristics" - schema: - type: "Choice" - arg: "strategy" - default: "default" - choices: - - choice: "at-inline-annotated" - - choice: "everything" - - choice: "default" - description: "Set the heuristics for inlining decisions." - - option: "-opt-warnings" - schema: - type: "Choice" - multiple: true - default: "at-inline-failed" - choices: - - choice: "none" - description: "No optimizer warnings." - - choice: "at-inline-failed-summary" - description: "One-line summary if there were `@inline` method calls that could not be inlined." - - choice: "at-inline-failed" - description: "A detailed warning for each `@inline` method call that could not be inlined." - - choice: "any-inline-failed" - description: "A detailed warning for every callsite that was chosen for inlining by the heuristics, but could not be inlined." - - choice: "no-inline-mixed" - description: "In mixed compilation, warn at callsites methods defined in java sources (the inlining decision cannot be made without bytecode)." - - choice: "no-inline-missing-bytecode" - description: "Warn if an inlining decision cannot be made because a the bytecode of a class or member cannot be found on the compilation classpath." - - choice: "no-inline-missing-attribute" - description: "Warn if an inlining decision cannot be made because a Scala classfile does not have a ScalaInlineInfo attribute." - description: "Enable optimizer warnings." - - option: "-Yopt-trace" - schema: - type: "String" - arg: "package/Class.method" - description: "Trace the optimizer progress for methods; `_` to print all, prefix match to select." - - option: "-Yopt-log-inline" - schema: - type: "String" - arg: "package/Class.method" - description: "Print a summary of inliner activity; `_` to print all, prefix match to select." - - option: "-Ystatistics" - schema: - type: "Phases" - arg: "phases" - default: "parser,typer,patmat,erasure,cleanup,jvm" - description: "Print compiler statistics for specific phases. (see [Compilation Phases](#compilation-phases))" - - option: "-Yhot-statistics-enabled" - schema: - type: "Boolean" - description: "Enable `-Ystatistics` to print hot statistics." - - option: "-Yprofile-enabled" - schema: - type: "Boolean" - description: "Enable profiling." - - option: "-Yprofile-destination" - arg: "file" - schema: - type: "String" - description: "where to send profiling output - specify a file, default is to the console." - note: "`-Yprofile-enabled` is enabled at the same time." - - option: "-Yprofile-external-tool" - schema: - type: "Phases" - arg: "phases" - default: "typer" - description: "Enable profiling for a phase using an external tool hook. Generally only useful for a single phase." - note: "`-Yprofile-enabled` is enabled at the same time." - - option: "-Yprofile-run-gc" - schema: - type: "Phases" - arg: "phases" - default: "_" - description: "Run a GC between phases - this allows heap size to be accurate at the expense of more time. Specify a list of phases, or `all`." - note: "`-Yprofile-enabled` is enabled at the same time." + internalOnly: true + schema: + type: "Boolean" + description: "Internal only: expose the empty package." + - option: "-Ydelambdafy" + schema: + type: "Choice" + arg: "strategy" + default: "method" + choices: + - choice: "inline" + - choice: "method" + description: "Strategy used for translating lambdas into JVM code." + - option: "-Ybackend-parallelism" + schema: + type: "Int" + arg: "threads" + default: 1 + min: 1 + max: 16 + description: "Maximum worker threads for backend." + - option: "-Ybackend-worker-queue" + description: "Backend threads worker queue size." + schema: + type: "Int" + arg: "size" + default: 0 + min: 0 + max: 1000 + - option: "-Yjar-compression-level" + schema: + type: "Int" + arg: "level" + default: "Deflater.DEFAULT_COMPRESSION" + min: "Deflater.DEFAULT_COMPRESSION" + max: "Deflater.BEST_COMPRESSION" + description: "Compression level to use when writing jar files." + - option: "-Ycache-plugin-class-loader" + schema: + type: "Choice" + default: "none" + choices: + - choice: "none" + description: "Don't cache class loader." + - choice: "last-modified" + description: "Cache class loader, using file last-modified time to invalidate." + description: "Policy for caching class loaders for compiler plugins that are dynamically loaded." + - option: "-Ycache-macro-class-loader" + schema: + type: "Choice" + default: "none" + choices: + - choice: "none" + description: "Don't cache class loader." + - choice: "last-modified" + description: "Cache class loader, using file last-modified time to invalidate." + description: "Policy for caching class loaders for macros that are dynamically loaded." + - option: "-opt" + schema: + type: "Choice" + multiple: true + choices: + - choice: "unreachable-code" + description: "Eliminate unreachable code, exception handlers guarding no instructions, redundant metadata (debug information, line numbers)." + - choice: "simplify-jumps" + description: "Simplify branching instructions, eliminate unnecessary ones." + - choice: "compact-locals" + description: "Eliminate empty slots in the sequence of local variables." + - choice: "copy-propagation" + description: "Eliminate redundant local variables and unused values (including closures). Enables unreachable-code." + - choice: "redundant-casts" + description: "Eliminate redundant casts using a type propagation analysis." + - choice: "box-unbox" + description: "Eliminate box-unbox pairs within the same method (also tuples, xRefs, value class instances). Enables unreachable-code." + - choice: "nullness-tracking" + description: "Track nullness / non-nullness of local variables and apply optimizations." + - choice: "closure-invocations" + description: "Rewrite closure invocations to the implementation method." + - choice: "inline" + description: "Inline method invocations according to `-Yopt-inline-heuristics` and `-opt-inline-from`." + - choice: "l:none" + description: "Disable optimizations. Takes precedence: `-opt:l:none,+box-unbox` / `-opt:l:none -opt:box-unbox` don't enable box-unbox." + note: "Unlike the other optimizer levels, `l:none` appears up in the `opt.value` set because it's not an expanding option." + - choice: "l:default" + description: "Enable default optimizations: `unreachable-code`." + - choice: "l:method" + description: "Enable intra-method optimizations: `unreachable-code`, `simplify-jumps`, `compact-locals`, `copy-propagation`, `redundant-casts`, `box-unbox`, `nullness-tracking`, `closure-invocations`." + - choice: "l:inline" + description: "Enable cross-method optimizations (note: inlining requires `-opt-inline-from`): `unreachable-code`, `simplify-jumps`, `compact-locals`, `copy-propagation`, `redundant-casts`, `box-unbox`, `nullness-tracking`, `closure-invocations`, `inline`." + - choice: "l:project" + description: "Enable cross-method optimizations within the current project." + deprecated: "Use `-opt:l:inline -opt-inline-from` instead." + - choice: "l:classpath" + description: "Enable cross-method optimizations across the entire classpath." + deprecated: "Use `-opt:l:inline -opt-inline-from` instead." + description: "Enable optimizations. Check `-opt:help` for using the Scala 2.12 optimizer." + note: "if `inline` not contained and either `l:project` or `l:classpath` are contained, then `l:inline` is enabled." + - option: "-opt-inline-from" + schema: + type: "String" + multiple: true + arg: "pattern" + description: "Patterns for classfile names from which to allow inlining, `help` for details." + - option: "-Yopt-inline-heuristics" + schema: + type: "Choice" + arg: "strategy" + default: "default" + choices: + - choice: "at-inline-annotated" + - choice: "everything" + - choice: "default" + description: "Set the heuristics for inlining decisions." + - option: "-opt-warnings" + schema: + type: "Choice" + multiple: true + default: "at-inline-failed" + choices: + - choice: "none" + description: "No optimizer warnings." + - choice: "at-inline-failed-summary" + description: "One-line summary if there were `@inline` method calls that could not be inlined." + - choice: "at-inline-failed" + description: "A detailed warning for each `@inline` method call that could not be inlined." + - choice: "any-inline-failed" + description: "A detailed warning for every callsite that was chosen for inlining by the heuristics, but could not be inlined." + - choice: "no-inline-mixed" + description: "In mixed compilation, warn at callsites methods defined in java sources (the inlining decision cannot be made without bytecode)." + - choice: "no-inline-missing-bytecode" + description: "Warn if an inlining decision cannot be made because a the bytecode of a class or member cannot be found on the compilation classpath." + - choice: "no-inline-missing-attribute" + description: "Warn if an inlining decision cannot be made because a Scala classfile does not have a ScalaInlineInfo attribute." + description: "Enable optimizer warnings." + - option: "-Yopt-trace" + schema: + type: "String" + arg: "package/Class.method" + description: "Trace the optimizer progress for methods; `_` to print all, prefix match to select." + - option: "-Yopt-log-inline" + schema: + type: "String" + arg: "package/Class.method" + description: "Print a summary of inliner activity; `_` to print all, prefix match to select." + - option: "-Ystatistics" + schema: + type: "Phases" + arg: "phases" + default: "parser,typer,patmat,erasure,cleanup,jvm" + description: "Print compiler statistics for specific phases. (see [Compilation Phases](#compilation-phases))" + - option: "-Yhot-statistics-enabled" + schema: + type: "Boolean" + description: "Enable `-Ystatistics` to print hot statistics." + - option: "-Yprofile-enabled" + schema: + type: "Boolean" + description: "Enable profiling." + - option: "-Yprofile-destination" + arg: "file" + schema: + type: "String" + description: "where to send profiling output - specify a file, default is to the console." + note: "`-Yprofile-enabled` is enabled at the same time." + - option: "-Yprofile-external-tool" + schema: + type: "Phases" + arg: "phases" + default: "typer" + description: "Enable profiling for a phase using an external tool hook. Generally only useful for a single phase." + note: "`-Yprofile-enabled` is enabled at the same time." + - option: "-Yprofile-run-gc" + schema: + type: "Phases" + arg: "phases" + default: "_" + description: "Run a GC between phases - this allows heap size to be accurate at the expense of more time. Specify a list of phases, or `all`." + note: "`-Yprofile-enabled` is enabled at the same time." # Area-specific debug output. - - option: "-Ydoc-debug" - schema: - type: "Boolean" - description: "Trace all scaladoc activity." - - option: "-Yide-debug" - schema: - type: "Boolean" - description: "Generate, validate and output trees using the interactive compiler." - - option: "-Yissue-debug" - schema: - type: "Boolean" - description: "Print stack traces when a context issues an error." - - option: "-Ymacro-debug-lite" - schema: - type: "Boolean" - description: "Trace essential macro-related activities." - - option: "-Ymacro-debug-verbose" - schema: - type: "Boolean" - description: "Trace all macro-related activities: compilation, generation of synthetics, classloading, expansion, exceptions." - - option: "-Ypos-debug" - schema: - type: "Boolean" - description: "Trace position validation." - - option: "-Yreify-debug" - schema: - type: "Boolean" - description: "Trace reification." - - option: "-Ytyper-debug" - schema: - type: "Boolean" - description: "Trace all type assignments." - - option: "-Ypatmat-debug" - schema: - type: "Boolean" - description: "Trace pattern matching translation." - - option: "-Ypatmat-exhaust-depth" - schema: - type: "Int" - arg: "off" - default: 20 - min: 10 - max: Int.MaxValue - description: "off" - - option: "-Yquasiquote-debug" - schema: - type: "Boolean" - description: "Trace quasiquote-related activities." + - option: "-Ydoc-debug" + schema: + type: "Boolean" + description: "Trace all scaladoc activity." + - option: "-Yide-debug" + schema: + type: "Boolean" + description: "Generate, validate and output trees using the interactive compiler." + - option: "-Yissue-debug" + schema: + type: "Boolean" + description: "Print stack traces when a context issues an error." + - option: "-Ymacro-debug-lite" + schema: + type: "Boolean" + description: "Trace essential macro-related activities." + - option: "-Ymacro-debug-verbose" + schema: + type: "Boolean" + description: "Trace all macro-related activities: compilation, generation of synthetics, classloading, expansion, exceptions." + - option: "-Ypos-debug" + schema: + type: "Boolean" + description: "Trace position validation." + - option: "-Yreify-debug" + schema: + type: "Boolean" + description: "Trace reification." + - option: "-Ytyper-debug" + schema: + type: "Boolean" + description: "Trace all type assignments." + - option: "-Ypatmat-debug" + schema: + type: "Boolean" + description: "Trace pattern matching translation." + - option: "-Ypatmat-exhaust-depth" + schema: + type: "Int" + arg: "off" + default: 20 + min: 10 + max: Int.MaxValue + description: "off" + - option: "-Yquasiquote-debug" + schema: + type: "Boolean" + description: "Trace quasiquote-related activities." # Groups of Settings. - - option: "-Xfuture" - schema: - type: "Boolean" - description: "Turn on future language features." - - option: "-Xexperimental" - schema: - type: "Boolean" - description: "Enable experimental extensions in Scala 2.12 and earlier." - deprecated: "In 2.13 all options previously enabled by `-Xexperimental` are enabled by default or removed." - - option : "-Xmacro-settings" - schema: - type: "String" - multiple: true - description: "Custom settings for macros." + - option: "-Xfuture" + schema: + type: "Boolean" + description: "Turn on future language features." + - option: "-Xexperimental" + schema: + type: "Boolean" + description: "Enable experimental extensions in Scala 2.12 and earlier." + deprecated: "In 2.13 all options previously enabled by `-Xexperimental` are enabled by default or removed." + - option : "-Xmacro-settings" + schema: + type: "String" + multiple: true + description: "Custom settings for macros." # * IDE-specific settings - - option: "-Ypresentation-verbose" - schema: - type: "Boolean" - description: "Print information about presentation compiler tasks." - - option: "-Ypresentation-debug" - schema: - type: "Boolean" - description: "Enable debugging output for the presentation compiler." - - option: "-Ypresentation-any-thread" - schema: - type: "Boolean" - description: "Allow use of the presentation compiler from any thread." - - option: "-Ypresentation-strict" - schema: - type: "Boolean" - description: "Do not report type errors in sources with syntax errors." - - option: "-Ypresentation-log" - schema: - type: "String" - arg: "file" - description: "Log presentation compiler events into file." - - option: "-Ypresentation-replay" - schema: - type: "String" - arg: "file" - description: "Replay presentation compiler events from file." - - option: "-Ypresentation-delay" - schema: - type: "Int" - arg: "miliseconds" - default: 0 - min: 0 - max: 999 - description: "Wait number of ms after typing before starting typechecking." + - option: "-Ypresentation-verbose" + schema: + type: "Boolean" + description: "Print information about presentation compiler tasks." + - option: "-Ypresentation-debug" + schema: + type: "Boolean" + description: "Enable debugging output for the presentation compiler." + - option: "-Ypresentation-any-thread" + schema: + type: "Boolean" + description: "Allow use of the presentation compiler from any thread." + - option: "-Ypresentation-strict" + schema: + type: "Boolean" + description: "Do not report type errors in sources with syntax errors." + - option: "-Ypresentation-log" + schema: + type: "String" + arg: "file" + description: "Log presentation compiler events into file." + - option: "-Ypresentation-replay" + schema: + type: "String" + arg: "file" + description: "Replay presentation compiler events from file." + - option: "-Ypresentation-delay" + schema: + type: "Int" + arg: "miliseconds" + default: 0 + min: 0 + max: 999 + description: "Wait number of ms after typing before starting typechecking." - category: "Warning Settings" description: "This section assembles the `-X` and `-Y` options those influence the printing of warnings." options: - - option: "-Xfatal-warnings" - schema: - type: "Boolean" - description: "Fail the compilation if there are any warnings." - - option: "-Ywarn-macros" - schema: - type: "Choice" - arg: "mode" - choices: - - choice: "none" - description: "Do not inspect expansions or their original trees when generating unused symbol warnings." - - choice: "before" - description: "Only inspect unexpanded user-written code for unused symbols." - - choice: "after" - description: "Only inspect expanded trees when generating unused symbol warnings." - - choice: "both" - description: "Inspect both user-written code and expanded trees when generating unused symbol warnings." - description: "Enable lint warnings on macro expansions." - - option: "-Ywarn-dead-code" - schema: - type: "Boolean" - description: "Warn when dead code is identified." - - option: "-Ywarn-value-discard" - schema: - type: "Boolean" - description: "Warn when non-Unit expression results are unused." - note: "To reduce noises for common idiom, warning are suppressed if type of results are `this.type`." - - option: "-Ywarn-numeric-widen" - schema: - type: "Boolean" - description: "Warn when numerics are widened." - - option: "-Ywarn-unused" - schema: - type: "Choice" - multiple: true - arg: "warn" - default: "_" - choices: - - choice: "imports" - description: "Warn if an import selector is not referenced." - - choice: "patvars" - description: "Warn if a variable bound in a pattern is unused." - - choice: "privates" - description: "Warn if a private member is unused." - - choice: "locals" - description: "Warn if a local definition is unused." - - choice: "explicits" - description: "Warn if an explicit parameter is unused." - - choice: "implicits" - description: "Warn if an implicit parameter is unused." - - choice: "params" - description: "Enable `-Ywarn-unused:explicits,implicits`." - - choice: "linted" - description: "Enable `-Ywarn-unused:imports,privates,locals,implicits`." - note: "Alias is `-Xlint:unused`." - description: "Enable or disable specific `unused` warnings." - - option: "-Ywarn-unused-import" - schema: - type: "Boolean" - description: "Warn when imports are unused." - - option: "-Ywarn-extra-implicit" - schema: - type: "Boolean" - description: "Warn when more than one implicit parameter section is defined." - - option: "-Ywarn-self-implicit" - schema: - type: "Boolean" - description: "Warn when an implicit resolves to an enclosing self-definition." - - option: "-Xlint" - schema: - type: "Choice" - multiple: true - arg: "warn" - default: "_" - choices: - - choice: "adapted-args" - description: "Warn if an argument list is modified to match the receiver." - note: "Alias is `-Ywarn-adapted-args`." - - choice: "nullary-unit" - description: "Warn when nullary methods return Unit." - note: "Alias is `-Ywarn-nullary-unit`." - - choice: "inaccessible" - description: "Warn about inaccessible types in method signatures." - note: "Alias is `-Ywarn-inaccessible`." - - choice: "nullary-override" - description: "Warn when non-nullary `def f()` overrides nullary `def f`." - note: "Alias is `-Ywarn-nullary-override`." - - choice: "infer-any" - description: "Warn when a type argument is inferred to be `Any`." - note: "Alias is `-Ywarn-infer-any`." - - choice: "missing-interpolator" - description: "A string literal appears to be missing an interpolator id." - - choice: "doc-detached" - description: "A Scaladoc comment appears to be detached from its element." - - choice: "private-shadow" - description: "A private field (or class parameter) shadows a superclass field." - - choice: "type-parameter-shadow" - description: "A local type parameter shadows a type already in scope." - - choice: "poly-implicit-overload" - description: "Parameterized overloaded implicit methods are not visible as view bounds." - - choice: "option-implicit" - description: "Option.apply used implicit view." - - choice: "delayedinit-select" - description: "Selecting member of DelayedInit." - - choice: "by-name-right-associative" - description: "By-name parameter of right associative operator." - - choice: "package-object-classes" - description: "Class or object defined in package object." - - choice: "unsound-match" - description: "Pattern match may not be typesafe." - - choice: "stars-align" - description: "Pattern sequence wildcard must align with sequence component." - - choice: "constant" - description: "Evaluation of a constant arithmetic expression results in an error." - - choice: "unused" - description: "Enable `-Ywarn-unused:imports,privates,locals,implicits`." - description: "Enable or disable specific warnings." - note: "If this options contains `unused`, it enables `-Ywarn-unused:linted`. Otherwise it disables `-Ywarn-unused:linted`." + - option: "-Xfatal-warnings" + schema: + type: "Boolean" + description: "Fail the compilation if there are any warnings." + - option: "-Ywarn-macros" + schema: + type: "Choice" + arg: "mode" + choices: + - choice: "none" + description: "Do not inspect expansions or their original trees when generating unused symbol warnings." + - choice: "before" + description: "Only inspect unexpanded user-written code for unused symbols." + - choice: "after" + description: "Only inspect expanded trees when generating unused symbol warnings." + - choice: "both" + description: "Inspect both user-written code and expanded trees when generating unused symbol warnings." + description: "Enable lint warnings on macro expansions." + - option: "-Ywarn-dead-code" + schema: + type: "Boolean" + description: "Warn when dead code is identified." + - option: "-Ywarn-value-discard" + schema: + type: "Boolean" + description: "Warn when non-Unit expression results are unused." + note: "To reduce noises for common idiom, warning are suppressed if type of results are `this.type`." + - option: "-Ywarn-numeric-widen" + schema: + type: "Boolean" + description: "Warn when numerics are widened." + - option: "-Ywarn-unused" + schema: + type: "Choice" + multiple: true + arg: "warn" + default: "_" + choices: + - choice: "imports" + description: "Warn if an import selector is not referenced." + - choice: "patvars" + description: "Warn if a variable bound in a pattern is unused." + - choice: "privates" + description: "Warn if a private member is unused." + - choice: "locals" + description: "Warn if a local definition is unused." + - choice: "explicits" + description: "Warn if an explicit parameter is unused." + - choice: "implicits" + description: "Warn if an implicit parameter is unused." + - choice: "params" + description: "Enable `-Ywarn-unused:explicits,implicits`." + - choice: "linted" + description: "Enable `-Ywarn-unused:imports,privates,locals,implicits`." + note: "Alias is `-Xlint:unused`." + description: "Enable or disable specific `unused` warnings." + - option: "-Ywarn-unused-import" + schema: + type: "Boolean" + description: "Warn when imports are unused." + - option: "-Ywarn-extra-implicit" + schema: + type: "Boolean" + description: "Warn when more than one implicit parameter section is defined." + - option: "-Ywarn-self-implicit" + schema: + type: "Boolean" + description: "Warn when an implicit resolves to an enclosing self-definition." + - option: "-Xlint" + schema: + type: "Choice" + multiple: true + arg: "warn" + default: "_" + choices: + - choice: "adapted-args" + description: "Warn if an argument list is modified to match the receiver." + note: "Alias is `-Ywarn-adapted-args`." + - choice: "nullary-unit" + description: "Warn when nullary methods return Unit." + note: "Alias is `-Ywarn-nullary-unit`." + - choice: "inaccessible" + description: "Warn about inaccessible types in method signatures." + note: "Alias is `-Ywarn-inaccessible`." + - choice: "nullary-override" + description: "Warn when non-nullary `def f()` overrides nullary `def f`." + note: "Alias is `-Ywarn-nullary-override`." + - choice: "infer-any" + description: "Warn when a type argument is inferred to be `Any`." + note: "Alias is `-Ywarn-infer-any`." + - choice: "missing-interpolator" + description: "A string literal appears to be missing an interpolator id." + - choice: "doc-detached" + description: "A Scaladoc comment appears to be detached from its element." + - choice: "private-shadow" + description: "A private field (or class parameter) shadows a superclass field." + - choice: "type-parameter-shadow" + description: "A local type parameter shadows a type already in scope." + - choice: "poly-implicit-overload" + description: "Parameterized overloaded implicit methods are not visible as view bounds." + - choice: "option-implicit" + description: "Option.apply used implicit view." + - choice: "delayedinit-select" + description: "Selecting member of DelayedInit." + - choice: "by-name-right-associative" + description: "By-name parameter of right associative operator." + - choice: "package-object-classes" + description: "Class or object defined in package object." + - choice: "unsound-match" + description: "Pattern match may not be typesafe." + - choice: "stars-align" + description: "Pattern sequence wildcard must align with sequence component." + - choice: "constant" + description: "Evaluation of a constant arithmetic expression results in an error." + - choice: "unused" + description: "Enable `-Ywarn-unused:imports,privates,locals,implicits`." + description: "Enable or disable specific warnings." + note: "If this options contains `unused`, it enables `-Ywarn-unused:linted`. Otherwise it disables `-Ywarn-unused:linted`." From 7a30e3b1fcc3dcf103d3604e9ab2b565dd796b77 Mon Sep 17 00:00:00 2001 From: exoego Date: Thu, 3 May 2018 07:03:42 +0900 Subject: [PATCH 07/12] Reorder to reduce difference from the generated one --- _data/compiler-options.yml | 145 ++++++++++++++++++------------------- 1 file changed, 71 insertions(+), 74 deletions(-) diff --git a/_data/compiler-options.yml b/_data/compiler-options.yml index 1c01c40fbd..5f1a70a38a 100644 --- a/_data/compiler-options.yml +++ b/_data/compiler-options.yml @@ -1,7 +1,6 @@ - category: "Standard Settings" description: "A set of standard options that are supported on the current development environment and will be supported in future releases." options: -# Path related settings. - option: "-classpath" schema: type: "Path" @@ -9,6 +8,43 @@ description: "Specify where to find user class files." abbreviations: - "-cp" + - option: "-no-specialization" + schema: + type: "Boolean" + description: "Ignore `@specialize` annotations." + - option: "-language" + schema: + type: "Choice" + multiple: true + arg: "feat" + choices: + - choice: "dynamics" + description: "Allow direct or indirect subclasses of `scala.Dynamic`." + - choice: "postfixOps" + description: "Allow postfix operator notation, such as `1 to 10 toList`." + - choice: "reflectiveCalls" + description: "Allow reflective access to members of structural types." + - choice: "implicitConversions" + description: "Allow definition of implicit functions called views." + - choice: "higherKinds" + description: "Allow higher-kinded types." + - choice: "existentials" + description: "Existential types (besides wildcard types) can be written and inferred." + - choice: "experimental.macros" + description: "Allow macro definition (besides implementation and application." + description: "Enable or disable language features." + - option: "-release" + schema: + type: "String" + arg: "release" + description: "Compile for a specific version of the Java platform. Supported targets: 6, 7, 8, 9." + - option: "-optimise" + schema: + type: "Boolean" + description: "Compiler flag for the optimizer in Scala 2.11." + abbreviations: + - "-optimize" + deprecated: "In 2.12, `-optimise` enables `-opt:l:inline -opt-inline-from:**`. Check `-opt:help` for using the Scala 2.12 optimizer." - option: "-bootclasspath" schema: type: "Path" @@ -81,13 +117,6 @@ schema: type: "Boolean" description: "Generate no warnings." - - option: "-optimise" - schema: - type: "Boolean" - description: "Compiler flag for the optimizer in Scala 2.11." - abbreviations: - - "-optimize" - deprecated: "In 2.12, `-optimise` enables `-opt:l:inline -opt-inline-from:**`. Check `-opt:help` for using the Scala 2.12 optimizer." - option: "-print" schema: type: "Boolean" @@ -126,36 +155,6 @@ schema: type: "Boolean" description: "Print product version and exit." - - option: "-no-specialization" - schema: - type: "Boolean" - description: "Ignore `@specialize` annotations." - - option: "-language" - schema: - type: "Choice" - multiple: true - arg: "feat" - choices: - - choice: "dynamics" - description: "Allow direct or indirect subclasses of `scala.Dynamic`." - - choice: "postfixOps" - description: "Allow postfix operator notation, such as `1 to 10 toList`." - - choice: "reflectiveCalls" - description: "Allow reflective access to members of structural types." - - choice: "implicitConversions" - description: "Allow definition of implicit functions called views." - - choice: "higherKinds" - description: "Allow higher-kinded types." - - choice: "existentials" - description: "Existential types (besides wildcard types) can be written and inferred." - - choice: "experimental.macros" - description: "Allow macro definition (besides implementation and application." - description: "Enable or disable language features." - - option: "-release" - schema: - type: "String" - arg: "release" - description: "Compile for a specific version of the Java platform. Supported targets: 6, 7, 8, 9." - category: "JVM Settings" @@ -405,6 +404,20 @@ - choice: "coalescing" description: "Convert PCData to Text and coalesce sibling nodes." description: "Configure XML parsing." + - option: "-Xfuture" + schema: + type: "Boolean" + description: "Turn on future language features." + - option: "-Xexperimental" + schema: + type: "Boolean" + description: "Enable experimental extensions in Scala 2.12 and earlier." + deprecated: "In 2.13 all options previously enabled by `-Xexperimental` are enabled by default or removed." + - option : "-Xmacro-settings" + schema: + type: "String" + multiple: true + description: "Custom settings for macros." @@ -603,6 +616,26 @@ schema: type: "Boolean" description: "Do not cache flat classpath representation of classpath elements from jars across compiler instances." + - option: "-Ycache-plugin-class-loader" + schema: + type: "Choice" + default: "none" + choices: + - choice: "none" + description: "Don't cache class loader." + - choice: "last-modified" + description: "Cache class loader, using file last-modified time to invalidate." + description: "Policy for caching class loaders for compiler plugins that are dynamically loaded." + - option: "-Ycache-macro-class-loader" + schema: + type: "Choice" + default: "none" + choices: + - choice: "none" + description: "Don't cache class loader." + - choice: "last-modified" + description: "Cache class loader, using file last-modified time to invalidate." + description: "Policy for caching class loaders for macros that are dynamically loaded." - option: "-Yvirtpatmat" schema: type: "Boolean" @@ -646,26 +679,6 @@ min: "Deflater.DEFAULT_COMPRESSION" max: "Deflater.BEST_COMPRESSION" description: "Compression level to use when writing jar files." - - option: "-Ycache-plugin-class-loader" - schema: - type: "Choice" - default: "none" - choices: - - choice: "none" - description: "Don't cache class loader." - - choice: "last-modified" - description: "Cache class loader, using file last-modified time to invalidate." - description: "Policy for caching class loaders for compiler plugins that are dynamically loaded." - - option: "-Ycache-macro-class-loader" - schema: - type: "Choice" - default: "none" - choices: - - choice: "none" - description: "Don't cache class loader." - - choice: "last-modified" - description: "Cache class loader, using file last-modified time to invalidate." - description: "Policy for caching class loaders for macros that are dynamically loaded." - option: "-opt" schema: type: "Choice" @@ -836,22 +849,6 @@ schema: type: "Boolean" description: "Trace quasiquote-related activities." -# Groups of Settings. - - option: "-Xfuture" - schema: - type: "Boolean" - description: "Turn on future language features." - - option: "-Xexperimental" - schema: - type: "Boolean" - description: "Enable experimental extensions in Scala 2.12 and earlier." - deprecated: "In 2.13 all options previously enabled by `-Xexperimental` are enabled by default or removed." - - option : "-Xmacro-settings" - schema: - type: "String" - multiple: true - description: "Custom settings for macros." -# * IDE-specific settings - option: "-Ypresentation-verbose" schema: type: "Boolean" From 3f5ea020ea9196fbd04d0d35e7a96c407755b1b7 Mon Sep 17 00:00:00 2001 From: exoego Date: Thu, 3 May 2018 09:07:52 +0900 Subject: [PATCH 08/12] Use generated YAML from Scala 2.12.6 --- _data/compiler-options.yml | 279 +++++++++++++++++-------------------- 1 file changed, 129 insertions(+), 150 deletions(-) diff --git a/_data/compiler-options.yml b/_data/compiler-options.yml index 5f1a70a38a..295a38f582 100644 --- a/_data/compiler-options.yml +++ b/_data/compiler-options.yml @@ -5,46 +5,56 @@ schema: type: "Path" arg: "path" + default: "." description: "Specify where to find user class files." abbreviations: - "-cp" + - option: "-d" + schema: + type: "String" + arg: "directory|jar" + default: "." + description: "destination for generated classfiles." - option: "-no-specialization" schema: type: "Boolean" - description: "Ignore `@specialize` annotations." + description: "Ignore @specialize annotations." - option: "-language" schema: type: "Choice" + arg: "feature" multiple: true - arg: "feat" choices: - choice: "dynamics" - description: "Allow direct or indirect subclasses of `scala.Dynamic`." + description: "Allow direct or indirect subclasses of scala.Dynamic" - choice: "postfixOps" - description: "Allow postfix operator notation, such as `1 to 10 toList`." + description: "Allow postfix operator notation, such as `1 to 10 toList`" - choice: "reflectiveCalls" - description: "Allow reflective access to members of structural types." + description: "Allow reflective access to members of structural types" - choice: "implicitConversions" - description: "Allow definition of implicit functions called views." + description: "Allow definition of implicit functions called views" - choice: "higherKinds" - description: "Allow higher-kinded types." + description: "Allow higher-kinded types" - choice: "existentials" - description: "Existential types (besides wildcard types) can be written and inferred." + description: "Existential types (besides wildcard types) can be written and inferred" - choice: "experimental.macros" - description: "Allow macro definition (besides implementation and application." - description: "Enable or disable language features." + description: "Allow macro definition (besides implementation and application)" + description: "Enable or disable language features: `_` for all, `-language:help` to list choices." - option: "-release" schema: type: "String" arg: "release" - description: "Compile for a specific version of the Java platform. Supported targets: 6, 7, 8, 9." + description: "Compile for a specific version of the Java platform. Supported targets: 6, 7, 8, 9" - option: "-optimise" schema: type: "Boolean" - description: "Compiler flag for the optimizer in Scala 2.11." + description: "Compiler flag for the optimizer in Scala 2.11" abbreviations: - "-optimize" - deprecated: "In 2.12, `-optimise` enables `-opt:l:inline -opt-inline-from:**`. Check `-opt:help` for using the Scala 2.12 optimizer." + - option: "value-overrides" + schema: + type: "Boolean" + description: "Generated value class method overrides an implementation." - option: "-bootclasspath" schema: type: "Path" @@ -56,7 +66,7 @@ type: "Path" arg: "path" default: "Defaults.scalaExtDirs" - description: "Override location of installed extensions." + description: "Override location of installed extensions." - option: "-javabootclasspath" schema: type: "Path" @@ -72,6 +82,7 @@ - option: "-sourcepath" schema: type: "Path" + arg: "path" description: "Specify location(s) of source files." - option: "-dependencyfile" schema: @@ -108,11 +119,11 @@ - choice: "line" - choice: "vars" - choice: "notailcalls" - description: "Set level of generated debugging info." + description: "Set level of generated debugging info. Choices: (none,source,line,vars,notailcalls), default: vars." - option: "-help" schema: type: "Boolean" - description: "Print a synopsis of standard options." + description: "Print a synopsis of standard options" - option: "-nowarn" schema: type: "Boolean" @@ -122,15 +133,16 @@ type: "Boolean" description: "Print program with Scala-specific features removed." - option: "-target" - scheam: + schema: type: "Choice" + arg: "target" default: "jvm-1.8" choices: - choice: "jvm-1.5" - choice: "jvm-1.6" - choice: "jvm-1.7" - choice: "jvm-1.8" - description: "Target platform for object files. All JVM `1.5` - `1.7` targets are deprecated." + description: "Target platform for object files. All JVM 1.5 - 1.7 targets are deprecated. Choices: (jvm-1.5,jvm-1.6,jvm-1.7,jvm-1.8), default: jvm-1.8." - option: "-unchecked" schema: type: "Boolean" @@ -142,7 +154,7 @@ - option: "-usejavacp" schema: type: "Boolean" - description: "Utilize the `java.class.path` in classpath resolution." + description: "Utilize the java.class.path in classpath resolution." - option: "-usemanifestcp" schema: type: "Boolean" @@ -155,36 +167,31 @@ schema: type: "Boolean" description: "Print product version and exit." - - - category: "JVM Settings" description: "Settings influencing the runtime system." options: - option: "-Jflag" schema: type: "Prefix" - description: "Pass `flag` directly to the runtime system." + description: "Pass flag directly to the runtime system." - option: "-Dproperty=value" schema: type: "Prefix" - description: "Pass `-Dproperty=value` directly to the runtime system." + description: "Pass -Dproperty=value directly to the runtime system." - option: "-nobootcp" schema: type: "Boolean" description: "Do not use the boot classpath for the scala jars." - - - category: "Plugin Settings" description: "" options: - option: "-P" schema: - type: "Prefix" - arg: ":plugin:opt" - description: "Pass an option to a plugin in the form of `-P::`." + type: "String" + arg: "plugin:opt" + multiple: true + description: "Pass an option to a plugin" note: "If you use sbt, [compiler plugins support](https://www.scala-sbt.org/1.x/docs/Compiler-Plugins.html) may be useful." - - - category: "Advanced Settings" description: "Options that starts with `-X` are maybe renamed or removed in future releases." options: @@ -199,7 +206,7 @@ - option: "-Xdev" schema: type: "Boolean" - description: "Indicates user is a developer - issue warnings about anything which seems amiss." + description: "Indicates user is a developer - issue warnings about anything which seems amiss" - option: "-Xdisable-assertions" schema: type: "Boolean" @@ -207,9 +214,8 @@ - option: "-Xelide-below" schema: type: "Int" - arg: "min" default: "Int.MinValue" - description: "Calls to `@elidable` methods are omitted if method priority is lower than argument." + description: "Calls to @elidable methods are omitted if method priority is lower than argument" - option: "-Xno-forwarders" schema: type: "Boolean" @@ -230,7 +236,7 @@ - option: "-Xlog-reflective-calls" schema: type: "Boolean" - description: "Print a message when a reflective method call is generated." + description: "Print a message when a reflective method call is generated" - option: "-Xlog-free-terms" schema: type: "Boolean" @@ -242,28 +248,25 @@ - option: "-Xmax-classfile-name" schema: type: "Int" - arg: "max" default: 255 min: 72 max: 255 - description: "Maximum filename length for generated classes." + description: "Maximum filename length for generated classes" - option: "-Xmaxerrs" schema: type: "Int" - arg: "max" default: 100 - description: "Maximum errors to print." + description: "Maximum errors to print" - option: "-Xmaxwarns" schema: type: "Int" - arg: "max" default: 100 - description: "Maximum warnings to print." + description: "Maximum warnings to print" - option: "-Xmigration" schema: type: "ScalaVersion" arg: "version" - default: "any" + default: "none" description: "Warn about constructs whose behavior may have changed since version." - option: "-Xno-uescape" schema: @@ -280,14 +283,14 @@ - option: "-Xplugin" schema: type: "String" + arg: "paths" multiple: true - arg: "path" description: "Load a plugin from each classpath." - option: "-Xplugin-disable" schema: type: "String" - multiple: true arg: "plugin" + multiple: true description: "Disable plugins by name." - option: "-Xplugin-list" schema: @@ -296,8 +299,8 @@ - option: "-Xplugin-require" schema: type: "String" - multiple: true arg: "plugin" + multiple: true description: "Abort if a named plugin is not loaded." - option: "-Xpluginsdir" schema: @@ -308,8 +311,7 @@ - option: "-Xprint" schema: type: "Phases" - arg: "phases" - description: "Print out program after PHASES (see [Compilation Phases](#compilation-phases))" + description: "Print out program after phases (see [Compilation Phases](#compilation-phases))" - option: "-Xprint-pos" schema: type: "Boolean" @@ -339,7 +341,7 @@ schema: type: "String" arg: "path" - description: "Class for manifest's Main-Class entry (only useful with `-d `)" + description: "Class for manifest's Main-Class entry (only useful with -d jar)" - option: "-Xshow-class" schema: type: "String" @@ -368,17 +370,17 @@ - option: "-Xstrict-inference" schema: type: "Boolean" - description: "Don't infer known-unsound types." + description: "Don't infer known-unsound types" - option: "-Xsource" schema: - type: "Scala Version" + type: "ScalaVersion" arg: "version" - default: "2.13" + default: "2.12.0" description: "Treat compiler input as Scala source for the specified version, see [scala/bug#8126](https://github.com/scala/bug/issues/8126)." - option: "-Xno-patmat-analysis" schema: type: "Boolean" - description: "Don't perform exhaustivity/unreachability analysis. Also, ignore `@switch` annotation." + description: "Don't perform exhaustivity/unreachability analysis. Also, ignore @switch annotation." - option: "-Xfull-lubs" schema: type: "Boolean" @@ -395,15 +397,16 @@ description: "Generate mixin forwarders for JUnit-annotated methods (JUnit 4 does not support default methods)." - choice: "false" description: "Only generate mixin forwarders required for program correctness." - description: "Generate forwarder methods in classes inhering concrete methods from traits." + description: "Generate forwarder methods in classes inhering concrete methods from traits. Default: `true`, `help` to list choices." - option: "-Xxml" schema: type: "Choice" arg: "property" + multiple: true choices: - choice: "coalescing" - description: "Convert PCData to Text and coalesce sibling nodes." - description: "Configure XML parsing." + description: "Convert PCData to Text and coalesce sibling nodes" + description: "Configure XML parsing.: `_` for all, `-Xxml:help` to list choices." - option: "-Xfuture" schema: type: "Boolean" @@ -413,14 +416,12 @@ type: "Boolean" description: "Enable experimental extensions in Scala 2.12 and earlier." deprecated: "In 2.13 all options previously enabled by `-Xexperimental` are enabled by default or removed." - - option : "-Xmacro-settings" + - option: "-Xmacro-settings" schema: type: "String" + arg: "option" multiple: true description: "Custom settings for macros." - - - - category: "Private Settings" description: | Options with `-Y` prefix are more experimental and unstable than those with `-X` prefix. @@ -444,22 +445,19 @@ - option: "-Ybreak-cycles" schema: type: "Boolean" - description: "Attempt to break cycles encountered during typing." + description: "Attempt to break cycles encountered during typing" - option: "-Ybrowse" schema: type: "Phases" - arg: "phases" - description: "Browse the abstract syntax tree after PHASES (see [Compilation Phases](#compilation-phases))" + description: "Browse the abstract syntax tree after phases (see [Compilation Phases](#compilation-phases))" - option: "-Ycheck" schema: type: "Phases" - arg: "phases" description: "Check the tree at the end of PHASES (see [Compilation Phases](#compilation-phases))" - option: "-Yshow" schema: type: "Phases" - arg: "phases" - description: "(Requires `-Xshow-class` or `-Xshow-object`) Show after PHASES (see [Compilation Phases](#compilation-phases))" + description: "(Requires -Xshow-class or -Xshow-object) Show after PHASES (see [Compilation Phases](#compilation-phases))" - option: "-Ycompact-trees" schema: type: "Boolean" @@ -481,12 +479,11 @@ - choice: "package" - choice: "object" - choice: "error" - description: "Resolve term conflicts." + description: "Resolve term conflicts. Choices: (package,object,error), default: error." - option: "-Ylog" schema: type: "Phases" - arg: "phases" - description: "Log operations during PHASES (see [Compilation Phases](#compilation-phases))" + description: "Log operations during phases" - option: "-Ylog-classpath" schema: type: "Boolean" @@ -510,23 +507,22 @@ - option: "-Yrecursion" schema: type: "Int" - arg: "depth" default: 0 min: 0 - max: Int.MaxValue + max: 2147483647 description: "Set recursion depth used when locking symbols." - option: "-Yshow-trees" schema: type: "Boolean" - description: "(Requires `-Xprint:`) Print detailed ASTs in formatted form." + description: "(Requires -Xprint:) Print detailed ASTs in formatted form." - option: "-Yshow-trees-compact" schema: type: "Boolean" - description: "(Requires `-Xprint:`) Print detailed ASTs in compact form." + description: "(Requires -Xprint:) Print detailed ASTs in compact form." - option: "-Yshow-trees-stringified" schema: type: "Boolean" - description: "(Requires `-Xprint:`) Print stringifications along with detailed ASTs." + description: "(Requires -Xprint:) Print stringifications along with detailed ASTs." - option: "-Yshow-syms" schema: type: "Boolean" @@ -542,8 +538,7 @@ - option: "-Yskip" schema: type: "Phases" - arg: "phases" - description: "Skip PHASES (see [Compilation Phases](#compilation-phases))" + description: "Skip phases (see [Compilation Phases](#compilation-phases))" - option: "-Ygen-asmp" schema: type: "String" @@ -557,14 +552,12 @@ - option: "-Ystop-after" schema: type: "Phases" - arg: "phases" description: "Stop after PHASES (see [Compilation Phases](#compilation-phases))" abbreviations: - "-stop" - option: "-Ystop-before" schema: type: "Phases" - arg: "phases" description: "Stop before PHASES (see [Compilation Phases](#compilation-phases))" - option: "-Yrangepos" schema: @@ -573,8 +566,8 @@ - option: "-Yshow-member-pos" schema: type: "String" - arg: "style" - description: "Show start and end positions of members." + arg: "output style" + description: "Show start and end positions of members" note: "`-Yrangepos` is enabled at the same time." - option: "-Yreify-copypaste" schema: @@ -586,10 +579,10 @@ arg: "policy" default: "normal" choices: - - choice: "none" - choice: "normal" + - choice: "none" - choice: "discard" - description: "Control expansion of macros, useful for scaladoc and presentation compiler." + description: "Control expansion of macros, useful for scaladoc and presentation compiler. Choices: (normal,none,discard), default: normal." - option: "-Ymacro-no-expand" schema: type: "Boolean" @@ -598,11 +591,11 @@ - option: "-Yrepl-sync" schema: type: "Boolean" - description: "Do not use asynchronous code for REPL startup." + description: "Do not use asynchronous code for repl startup" - option: "-Yrepl-class-based" schema: type: "Boolean" - description: "Use classes to wrap REPL snippets instead of objects." + description: "Use classes to wrap REPL snippets instead of objects" - option: "-Yrepl-outdir" schema: type: "String" @@ -619,30 +612,34 @@ - option: "-Ycache-plugin-class-loader" schema: type: "Choice" + arg: "policy" default: "none" choices: - choice: "none" - description: "Don't cache class loader." + description: "Don't cache class loader" - choice: "last-modified" - description: "Cache class loader, using file last-modified time to invalidate." - description: "Policy for caching class loaders for compiler plugins that are dynamically loaded." + description: "Cache class loader, using file last-modified time to invalidate" + description: "Policy for caching class loaders for compiler plugins that are dynamically loaded. Default: `none`, `help` to list choices." - option: "-Ycache-macro-class-loader" schema: type: "Choice" + arg: "policy" default: "none" choices: - choice: "none" - description: "Don't cache class loader." + description: "Don't cache class loader" - choice: "last-modified" - description: "Cache class loader, using file last-modified time to invalidate." - description: "Policy for caching class loaders for macros that are dynamically loaded." + description: "Cache class loader, using file last-modified time to invalidate" + description: "Policy for caching class loaders for macros that are dynamically loaded. Default: `none`, `help` to list choices." + - option: "-Ypartial-unification" + schema: + type: "Boolean" + description: "Enable partial unification in type constructor inference" - option: "-Yvirtpatmat" schema: type: "Boolean" - description: "Enable pattern matcher virtualization." + description: "Enable pattern matcher virtualization" - option: "-Yexpose-empty-package" -# TODO: internal only - internalOnly: true schema: type: "Boolean" description: "Internal only: expose the empty package." @@ -654,34 +651,32 @@ choices: - choice: "inline" - choice: "method" - description: "Strategy used for translating lambdas into JVM code." + description: "Strategy used for translating lambdas into JVM code. Choices: (inline,method), default: method." - option: "-Ybackend-parallelism" schema: type: "Int" - arg: "threads" default: 1 min: 1 max: 16 - description: "Maximum worker threads for backend." + description: "maximum worker threads for backend" - option: "-Ybackend-worker-queue" - description: "Backend threads worker queue size." schema: type: "Int" - arg: "size" default: 0 min: 0 max: 1000 + description: "backend threads worker queue size" - option: "-Yjar-compression-level" schema: type: "Int" - arg: "level" - default: "Deflater.DEFAULT_COMPRESSION" - min: "Deflater.DEFAULT_COMPRESSION" - max: "Deflater.BEST_COMPRESSION" - description: "Compression level to use when writing jar files." + default: -1 + min: -1 + max: 9 + description: "compression level to use when writing jar files" - option: "-opt" schema: type: "Choice" + arg: "optimization" multiple: true choices: - choice: "unreachable-code" @@ -689,7 +684,7 @@ - choice: "simplify-jumps" description: "Simplify branching instructions, eliminate unnecessary ones." - choice: "compact-locals" - description: "Eliminate empty slots in the sequence of local variables." + description: "Eliminate empty slots in the sequence of local variables." - choice: "copy-propagation" description: "Eliminate redundant local variables and unused values (including closures). Enables unreachable-code." - choice: "redundant-casts" @@ -701,29 +696,28 @@ - choice: "closure-invocations" description: "Rewrite closure invocations to the implementation method." - choice: "inline" - description: "Inline method invocations according to `-Yopt-inline-heuristics` and `-opt-inline-from`." + description: "Inline method invocations according to -Yopt-inline-heuristics and -opt-inline-from." - choice: "l:none" - description: "Disable optimizations. Takes precedence: `-opt:l:none,+box-unbox` / `-opt:l:none -opt:box-unbox` don't enable box-unbox." - note: "Unlike the other optimizer levels, `l:none` appears up in the `opt.value` set because it's not an expanding option." + description: "Disable optimizations. Takes precedence: `-opt:l:none,+box-unbox` / `-opt:l:none -opt:box-unbox` don`t enable box-unbox." - choice: "l:default" - description: "Enable default optimizations: `unreachable-code`." + description: "Enable default optimizations: unreachable-code." - choice: "l:method" - description: "Enable intra-method optimizations: `unreachable-code`, `simplify-jumps`, `compact-locals`, `copy-propagation`, `redundant-casts`, `box-unbox`, `nullness-tracking`, `closure-invocations`." + description: "Enable intra-method optimizations: unreachable-code,simplify-jumps,compact-locals,copy-propagation,redundant-casts,box-unbox,nullness-tracking,closure-invocations." - choice: "l:inline" - description: "Enable cross-method optimizations (note: inlining requires `-opt-inline-from`): `unreachable-code`, `simplify-jumps`, `compact-locals`, `copy-propagation`, `redundant-casts`, `box-unbox`, `nullness-tracking`, `closure-invocations`, `inline`." + description: "Enable cross-method optimizations (note: inlining requires -opt-inline-from): l:method,inline." - choice: "l:project" - description: "Enable cross-method optimizations within the current project." + description: "[deprecated, use -opt:l:inline, -opt-inline-from] Enable cross-method optimizations within the current project." deprecated: "Use `-opt:l:inline -opt-inline-from` instead." - choice: "l:classpath" - description: "Enable cross-method optimizations across the entire classpath." + description: "[deprecated, use -opt:l:inline, -opt-inline-from] Enable cross-method optimizations across the entire classpath." deprecated: "Use `-opt:l:inline -opt-inline-from` instead." - description: "Enable optimizations. Check `-opt:help` for using the Scala 2.12 optimizer." + description: "Enable optimizations: `_` for all, `-opt:help` to list choices." note: "if `inline` not contained and either `l:project` or `l:classpath` are contained, then `l:inline` is enabled." - option: "-opt-inline-from" schema: type: "String" + arg: "patterns" multiple: true - arg: "pattern" description: "Patterns for classfile names from which to allow inlining, `help` for details." - option: "-Yopt-inline-heuristics" schema: @@ -734,19 +728,19 @@ - choice: "at-inline-annotated" - choice: "everything" - choice: "default" - description: "Set the heuristics for inlining decisions." + description: "Set the heuristics for inlining decisions. Choices: (at-inline-annotated,everything,default), default: default." - option: "-opt-warnings" schema: type: "Choice" + arg: "warning" multiple: true - default: "at-inline-failed" choices: - choice: "none" description: "No optimizer warnings." - choice: "at-inline-failed-summary" - description: "One-line summary if there were `@inline` method calls that could not be inlined." + description: "One-line summary if there were @inline method calls that could not be inlined." - choice: "at-inline-failed" - description: "A detailed warning for each `@inline` method call that could not be inlined." + description: "A detailed warning for each @inline method call that could not be inlined." - choice: "any-inline-failed" description: "A detailed warning for every callsite that was chosen for inlining by the heuristics, but could not be inlined." - choice: "no-inline-mixed" @@ -755,7 +749,7 @@ description: "Warn if an inlining decision cannot be made because a the bytecode of a class or member cannot be found on the compilation classpath." - choice: "no-inline-missing-attribute" description: "Warn if an inlining decision cannot be made because a Scala classfile does not have a ScalaInlineInfo attribute." - description: "Enable optimizer warnings." + description: "Enable optimizer warnings: `_` for all, `-opt-warnings:help` to list choices." - option: "-Yopt-trace" schema: type: "String" @@ -769,9 +763,8 @@ - option: "-Ystatistics" schema: type: "Phases" - arg: "phases" default: "parser,typer,patmat,erasure,cleanup,jvm" - description: "Print compiler statistics for specific phases. (see [Compilation Phases](#compilation-phases))" + description: "Print compiler statistics for specific phases phases (default: parser,typer,patmat,erasure,cleanup,jvm) (see [Compilation Phases](#compilation-phases))" - option: "-Yhot-statistics-enabled" schema: type: "Boolean" @@ -781,26 +774,23 @@ type: "Boolean" description: "Enable profiling." - option: "-Yprofile-destination" - arg: "file" schema: type: "String" + arg: "file" description: "where to send profiling output - specify a file, default is to the console." note: "`-Yprofile-enabled` is enabled at the same time." - option: "-Yprofile-external-tool" schema: type: "Phases" - arg: "phases" default: "typer" - description: "Enable profiling for a phase using an external tool hook. Generally only useful for a single phase." + description: "Enable profiling for a phase using an external tool hook. Generally only useful for a single phase phases (default: typer)" note: "`-Yprofile-enabled` is enabled at the same time." - option: "-Yprofile-run-gc" schema: type: "Phases" - arg: "phases" default: "_" - description: "Run a GC between phases - this allows heap size to be accurate at the expense of more time. Specify a list of phases, or `all`." + description: "Run a GC between phases - this allows heap size to be accurate at the expense of more time. Specify a list of phases, or all phases (default: _)" note: "`-Yprofile-enabled` is enabled at the same time." -# Area-specific debug output. - option: "-Ydoc-debug" schema: type: "Boolean" @@ -840,10 +830,9 @@ - option: "-Ypatmat-exhaust-depth" schema: type: "Int" - arg: "off" default: 20 min: 10 - max: Int.MaxValue + max: 2147483647 description: "off" - option: "-Yquasiquote-debug" schema: @@ -860,7 +849,7 @@ - option: "-Ypresentation-any-thread" schema: type: "Boolean" - description: "Allow use of the presentation compiler from any thread." + description: "Allow use of the presentation compiler from any thread" - option: "-Ypresentation-strict" schema: type: "Boolean" @@ -869,23 +858,19 @@ schema: type: "String" arg: "file" - description: "Log presentation compiler events into file." + description: "Log presentation compiler events into file" - option: "-Ypresentation-replay" schema: type: "String" arg: "file" - description: "Replay presentation compiler events from file." + description: "Replay presentation compiler events from file" - option: "-Ypresentation-delay" schema: type: "Int" - arg: "miliseconds" default: 0 min: 0 max: 999 - description: "Wait number of ms after typing before starting typechecking." - - - + description: "Wait number of ms after typing before starting typechecking" - category: "Warning Settings" description: "This section assembles the `-X` and `-Y` options those influence the printing of warnings." options: @@ -897,6 +882,7 @@ schema: type: "Choice" arg: "mode" + default: "before" choices: - choice: "none" description: "Do not inspect expansions or their original trees when generating unused symbol warnings." @@ -906,7 +892,7 @@ description: "Only inspect expanded trees when generating unused symbol warnings." - choice: "both" description: "Inspect both user-written code and expanded trees when generating unused symbol warnings." - description: "Enable lint warnings on macro expansions." + description: "Enable lint warnings on macro expansions. Default: `before`, `help` to list choices." - option: "-Ywarn-dead-code" schema: type: "Boolean" @@ -923,9 +909,8 @@ - option: "-Ywarn-unused" schema: type: "Choice" + arg: "warning" multiple: true - arg: "warn" - default: "_" choices: - choice: "imports" description: "Warn if an import selector is not referenced." @@ -940,15 +925,10 @@ - choice: "implicits" description: "Warn if an implicit parameter is unused." - choice: "params" - description: "Enable `-Ywarn-unused:explicits,implicits`." + description: "Enable -Ywarn-unused:explicits,implicits." - choice: "linted" - description: "Enable `-Ywarn-unused:imports,privates,locals,implicits`." - note: "Alias is `-Xlint:unused`." - description: "Enable or disable specific `unused` warnings." - - option: "-Ywarn-unused-import" - schema: - type: "Boolean" - description: "Warn when imports are unused." + description: "-Xlint:unused." + description: "Enable or disable specific `unused` warnings: `_` for all, `-Ywarn-unused:help` to list choices." - option: "-Ywarn-extra-implicit" schema: type: "Boolean" @@ -960,9 +940,8 @@ - option: "-Xlint" schema: type: "Choice" + arg: "warning" multiple: true - arg: "warn" - default: "_" choices: - choice: "adapted-args" description: "Warn if an argument list is modified to match the receiver." @@ -1004,6 +983,6 @@ - choice: "constant" description: "Evaluation of a constant arithmetic expression results in an error." - choice: "unused" - description: "Enable `-Ywarn-unused:imports,privates,locals,implicits`." - description: "Enable or disable specific warnings." + description: "Enable -Ywarn-unused:imports,privates,locals,implicits." + description: "Enable or disable specific warnings: `_` for all, `-Xlint:help` to list choices." note: "If this options contains `unused`, it enables `-Ywarn-unused:linted`. Otherwise it disables `-Ywarn-unused:linted`." From f4062b832026ed1920354b24f2b8025a9fe9409e Mon Sep 17 00:00:00 2001 From: exoego Date: Thu, 3 May 2018 12:48:53 +0900 Subject: [PATCH 09/12] Fix typo --- _data/compiler-options.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/_data/compiler-options.yml b/_data/compiler-options.yml index 295a38f582..497f0b4c75 100644 --- a/_data/compiler-options.yml +++ b/_data/compiler-options.yml @@ -428,7 +428,7 @@ Those influencing to language semantics are likely to be deprecated in Scala 2.13 (see [scala/scala-dev#430](https://github.com/scala/scala-dev/issues/430)). - Some optimization-related options, e.g. `-opt:**` and `-opt-inline-form` are included in this section, since **REASON_HERE**. + Some optimization-related options, e.g. `-opt:**` and `-opt-inline-from` are included in this section, since **REASON_HERE**. options: - option: "-Y" schema: From c79b55a633017d7b5fe3e818b7a527a6bd4527f6 Mon Sep 17 00:00:00 2001 From: exoego Date: Thu, 3 May 2018 13:04:18 +0900 Subject: [PATCH 10/12] Add reason why `-opt` and `-opt-inline-from` are part of private settings. --- _data/compiler-options.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/_data/compiler-options.yml b/_data/compiler-options.yml index 497f0b4c75..2f91d99764 100644 --- a/_data/compiler-options.yml +++ b/_data/compiler-options.yml @@ -426,9 +426,9 @@ description: | Options with `-Y` prefix are more experimental and unstable than those with `-X` prefix. - Those influencing to language semantics are likely to be deprecated in Scala 2.13 (see [scala/scala-dev#430](https://github.com/scala/scala-dev/issues/430)). + Some without `-Y` prefix (e.g. `-opt:**` and `-opt-inline-from`) are also included, since such granular optimization-related options are changeable. - Some optimization-related options, e.g. `-opt:**` and `-opt-inline-from` are included in this section, since **REASON_HERE**. + Those influencing to language semantics are likely to be deprecated in Scala 2.13 (see [scala/scala-dev#430](https://github.com/scala/scala-dev/issues/430)). options: - option: "-Y" schema: From b79e0d436361606cd6a04fe7a03fbe72103c4605 Mon Sep 17 00:00:00 2001 From: exoego Date: Thu, 3 May 2018 18:43:59 +0900 Subject: [PATCH 11/12] Move additional information to `note` so it does not conflict the description extracted from source. --- _data/compiler-options.yml | 28 ++++++++++++++++++---------- 1 file changed, 18 insertions(+), 10 deletions(-) diff --git a/_data/compiler-options.yml b/_data/compiler-options.yml index 2f91d99764..6805c00599 100644 --- a/_data/compiler-options.yml +++ b/_data/compiler-options.yml @@ -311,7 +311,8 @@ - option: "-Xprint" schema: type: "Phases" - description: "Print out program after phases (see [Compilation Phases](#compilation-phases))" + description: "Print out program after phases" + note: "See [Compilation Phases](#compilation-phases)" - option: "-Xprint-pos" schema: type: "Boolean" @@ -414,8 +415,8 @@ - option: "-Xexperimental" schema: type: "Boolean" - description: "Enable experimental extensions in Scala 2.12 and earlier." - deprecated: "In 2.13 all options previously enabled by `-Xexperimental` are enabled by default or removed." + description: "Enable experimental extensions." + deprecated: "For in Scala 2.12 and earlier. In 2.13 all options previously enabled by `-Xexperimental` are enabled by default or removed." - option: "-Xmacro-settings" schema: type: "String" @@ -449,15 +450,18 @@ - option: "-Ybrowse" schema: type: "Phases" - description: "Browse the abstract syntax tree after phases (see [Compilation Phases](#compilation-phases))" + description: "Browse the abstract syntax tree after phases" + note: "See [Compilation Phases](#compilation-phases)" - option: "-Ycheck" schema: type: "Phases" - description: "Check the tree at the end of PHASES (see [Compilation Phases](#compilation-phases))" + description: "Check the tree at the end of phases" + note: "See [Compilation Phases](#compilation-phases)" - option: "-Yshow" schema: type: "Phases" - description: "(Requires -Xshow-class or -Xshow-object) Show after PHASES (see [Compilation Phases](#compilation-phases))" + description: "(Requires -Xshow-class or -Xshow-object) Show after phases" + note: "See [Compilation Phases](#compilation-phases)" - option: "-Ycompact-trees" schema: type: "Boolean" @@ -538,7 +542,8 @@ - option: "-Yskip" schema: type: "Phases" - description: "Skip phases (see [Compilation Phases](#compilation-phases))" + description: "Skip phases" + note: "See [Compilation Phases](#compilation-phases)" - option: "-Ygen-asmp" schema: type: "String" @@ -552,13 +557,15 @@ - option: "-Ystop-after" schema: type: "Phases" - description: "Stop after PHASES (see [Compilation Phases](#compilation-phases))" + description: "Stop after phases" + note: "See [Compilation Phases](#compilation-phases)" abbreviations: - "-stop" - option: "-Ystop-before" schema: type: "Phases" - description: "Stop before PHASES (see [Compilation Phases](#compilation-phases))" + description: "Stop before phases" + note: "See [Compilation Phases](#compilation-phases)" - option: "-Yrangepos" schema: type: "Boolean" @@ -764,7 +771,8 @@ schema: type: "Phases" default: "parser,typer,patmat,erasure,cleanup,jvm" - description: "Print compiler statistics for specific phases phases (default: parser,typer,patmat,erasure,cleanup,jvm) (see [Compilation Phases](#compilation-phases))" + description: "Print compiler statistics for specific phases phases (default: parser,typer,patmat,erasure,cleanup,jvm)" + note: "See [Compilation Phases](#compilation-phases)" - option: "-Yhot-statistics-enabled" schema: type: "Boolean" From 6346423e38df303284f665a2731ad94d6fa37c0b Mon Sep 17 00:00:00 2001 From: exoego Date: Thu, 3 May 2018 19:33:46 +0900 Subject: [PATCH 12/12] Separate IDE specific settings that most developer do not need to care. --- _data/compiler-options.yml | 69 ++++++++++++++++++++------------------ 1 file changed, 36 insertions(+), 33 deletions(-) diff --git a/_data/compiler-options.yml b/_data/compiler-options.yml index 6805c00599..c50ae356b8 100644 --- a/_data/compiler-options.yml +++ b/_data/compiler-options.yml @@ -846,39 +846,6 @@ schema: type: "Boolean" description: "Trace quasiquote-related activities." - - option: "-Ypresentation-verbose" - schema: - type: "Boolean" - description: "Print information about presentation compiler tasks." - - option: "-Ypresentation-debug" - schema: - type: "Boolean" - description: "Enable debugging output for the presentation compiler." - - option: "-Ypresentation-any-thread" - schema: - type: "Boolean" - description: "Allow use of the presentation compiler from any thread" - - option: "-Ypresentation-strict" - schema: - type: "Boolean" - description: "Do not report type errors in sources with syntax errors." - - option: "-Ypresentation-log" - schema: - type: "String" - arg: "file" - description: "Log presentation compiler events into file" - - option: "-Ypresentation-replay" - schema: - type: "String" - arg: "file" - description: "Replay presentation compiler events from file" - - option: "-Ypresentation-delay" - schema: - type: "Int" - default: 0 - min: 0 - max: 999 - description: "Wait number of ms after typing before starting typechecking" - category: "Warning Settings" description: "This section assembles the `-X` and `-Y` options those influence the printing of warnings." options: @@ -994,3 +961,39 @@ description: "Enable -Ywarn-unused:imports,privates,locals,implicits." description: "Enable or disable specific warnings: `_` for all, `-Xlint:help` to list choices." note: "If this options contains `unused`, it enables `-Ywarn-unused:linted`. Otherwise it disables `-Ywarn-unused:linted`." +- category: "IDE Specific Settings" + description: "" + options: + - option: "-Ypresentation-verbose" + schema: + type: "Boolean" + description: "Print information about presentation compiler tasks." + - option: "-Ypresentation-debug" + schema: + type: "Boolean" + description: "Enable debugging output for the presentation compiler." + - option: "-Ypresentation-any-thread" + schema: + type: "Boolean" + description: "Allow use of the presentation compiler from any thread" + - option: "-Ypresentation-strict" + schema: + type: "Boolean" + description: "Do not report type errors in sources with syntax errors." + - option: "-Ypresentation-log" + schema: + type: "String" + arg: "file" + description: "Log presentation compiler events into file" + - option: "-Ypresentation-replay" + schema: + type: "String" + arg: "file" + description: "Replay presentation compiler events from file" + - option: "-Ypresentation-delay" + schema: + type: "Int" + default: 0 + min: 0 + max: 999 + description: "Wait number of ms after typing before starting typechecking"