From 4ffc391399ab5a9b7c56c44168695eedab276e42 Mon Sep 17 00:00:00 2001 From: Chris Kipp Date: Tue, 9 May 2023 18:23:41 +0200 Subject: [PATCH] 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 https://github.com/lampepfl/dotty/discussions/17238 --- compiler/src/dotty/tools/dotc/plugins/Plugin.scala | 2 +- compiler/src/dotty/tools/dotc/plugins/Plugins.scala | 2 -- 2 files changed, 1 insertion(+), 3 deletions(-) diff --git a/compiler/src/dotty/tools/dotc/plugins/Plugin.scala b/compiler/src/dotty/tools/dotc/plugins/Plugin.scala index be6fecebb55a..1baf3a06ad9e 100644 --- a/compiler/src/dotty/tools/dotc/plugins/Plugin.scala +++ b/compiler/src/dotty/tools/dotc/plugins/Plugin.scala @@ -44,7 +44,7 @@ sealed trait Plugin { trait StandardPlugin extends Plugin { /** Non-research plugins should override this method to return the phases * - * @param options commandline options to the plugin, `-P:plugname:opt1,opt2` becomes List(opt1, opt2) + * @param options commandline options to the plugin. * @return a list of phases to be added to the phase plan */ def init(options: List[String]): List[PluginPhase] diff --git a/compiler/src/dotty/tools/dotc/plugins/Plugins.scala b/compiler/src/dotty/tools/dotc/plugins/Plugins.scala index 976b783c40f0..c44fe4cf59b4 100644 --- a/compiler/src/dotty/tools/dotc/plugins/Plugins.scala +++ b/compiler/src/dotty/tools/dotc/plugins/Plugins.scala @@ -116,8 +116,6 @@ trait Plugins { /** Add plugin phases to phase plan */ def addPluginPhases(plan: List[List[Phase]])(using Context): List[List[Phase]] = { - // plugin-specific options. - // The user writes `-P:plugname:opt1,opt2`, but the plugin sees `List(opt1, opt2)`. def options(plugin: Plugin): List[String] = { def namec = plugin.name + ":" ctx.settings.pluginOptions.value filter (_ startsWith namec) map (_ stripPrefix namec)