Skip to content

Commit

Permalink
Enhance formatting in optionsHelp
Browse files Browse the repository at this point in the history
  • Loading branch information
danicheg committed Nov 28, 2023
1 parent 513a20f commit ffdb652
Showing 1 changed file with 7 additions and 16 deletions.
23 changes: 7 additions & 16 deletions plugin/src/main/scala/ch/epfl/scala/ProfilingPlugin.scala
Original file line number Diff line number Diff line change
Expand Up @@ -74,28 +74,19 @@ class ProfilingPlugin(val global: Global) extends Plugin { self =>

override def init(ops: List[String], e: (String) => Unit): Boolean = true

// format: off
override val optionsHelp: Option[String] = Some(
s"""
|-P:$name:${pad20(
GenerateGlobalFlamegraph
)}: Creates a global flamegraph of implicit searches for all compilation units. Use the `-P:$name:$SourceRoot` option to manage the root directory, otherwise, a working directory (defined by the `user.dir` property) will be picked.
|-P:$name:${pad20(
GenerateMacroFlamegraph
)} Generates a flamegraph for macro expansions. The flamegraph for implicit searches is enabled by default.
|-P:$name:${pad20(GenerateGlobalFlamegraph)}: Creates a global flamegraph of implicit searches for all compilation units. Use the `-P:$name:$SourceRoot` option to manage the root directory, otherwise, a working directory (defined by the `user.dir` property) will be picked.
|-P:$name:${pad20(GenerateMacroFlamegraph)} Generates a flamegraph for macro expansions. The flamegraph for implicit searches is enabled by default.
|-P:$name:${pad20(GenerateProfileDb)}:_ Sets the source root for this project.
|-P:$name:${pad20(
PrintFailedMacroImplicits
)} Prints trees of all failed implicit searches that triggered a macro expansion.
|-P:$name:${pad20(
PrintSearchResult
)}:_ Print implicit search result trees for a list of search ids separated by a comma.
|-P:$name:${pad20(
ShowConcreteImplicitTparams
)} Shows types in flamegraphs of implicits with concrete type params.
|-P:$name:${pad20(PrintFailedMacroImplicits)} Prints trees of all failed implicit searches that triggered a macro expansion.
|-P:$name:${pad20(PrintSearchResult)}:_ Print implicit search result trees for a list of search ids separated by a comma.
|-P:$name:${pad20(ShowConcreteImplicitTparams)} Shows types in flamegraphs of implicits with concrete type params.
|-P:$name:${pad20(ShowProfiles)} Logs profile information for every call-site.
|-P:$name:${pad20(SourceRoot)}:_ Sets the source root for this project.
""".stripMargin
)
) // format: on

lazy val implementation = new ProfilingImpl(ProfilingPlugin.this.global, config, logger)
implementation.registerProfilers()
Expand Down

0 comments on commit ffdb652

Please sign in to comment.