Skip to content

Commit c9d669f

Browse files
committed
fix: make sure scaladocs are correct for plugin options
This just makes a small update to the scaladocs to align what actually happens with what the comments say. Currently the comments are incorrect as passing in `-P:plugname:opt1,opt2` becomes List(opt1, opt2)` does not become `List(opt1, opt2)`. refs #17238
1 parent 9c2902d commit c9d669f

File tree

2 files changed

+2
-4
lines changed

2 files changed

+2
-4
lines changed

compiler/src/dotty/tools/dotc/plugins/Plugin.scala

+1-1
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,7 @@ sealed trait Plugin {
4444
trait StandardPlugin extends Plugin {
4545
/** Non-research plugins should override this method to return the phases
4646
*
47-
* @param options commandline options to the plugin, `-P:plugname:opt1,opt2` becomes List(opt1, opt2)
47+
* @param options commandline options to the plugin.
4848
* @return a list of phases to be added to the phase plan
4949
*/
5050
def init(options: List[String]): List[PluginPhase]

compiler/src/dotty/tools/dotc/plugins/Plugins.scala

+1-3
Original file line numberDiff line numberDiff line change
@@ -116,10 +116,8 @@ trait Plugins {
116116

117117
/** Add plugin phases to phase plan */
118118
def addPluginPhases(plan: List[List[Phase]])(using Context): List[List[Phase]] = {
119-
// plugin-specific options.
120-
// The user writes `-P:plugname:opt1,opt2`, but the plugin sees `List(opt1, opt2)`.
121119
def options(plugin: Plugin): List[String] = {
122-
def namec = plugin.name + ":"
120+
val namec = plugin.name + ":"
123121
ctx.settings.pluginOptions.value filter (_ startsWith namec) map (_ stripPrefix namec)
124122
}
125123

0 commit comments

Comments
 (0)