enso/project/RecompileParser.scala
Kaz Wesley e171fba301
New documentation parser (#5917)
Implement new Enso documentation parser; remove old Scala Enso parser.

Performance: Total time parsing documentation is now ~2ms.

# Important Notes
- Doc parsing is now done only in the frontend.
- Some engine tests had never been switched to the new parser. We should investigate tests that don't pass after the switch: #5894.
- The option to run the old searcher has been removed, as it is obsolete and was already broken before this (see #5909).
- Some interfaces used only by the old searcher have been removed.
2023-03-15 15:43:51 +00:00

22 lines
582 B
Scala

import sbt._
import sbt.Keys._
object RecompileParser {
/** Ensures that the project is recompiled whenever the project from
* `syntaxDefinition` is changed. Should be attached to the `compile` task as
* a dependency.
*/
def run(syntaxDefinition: Project) =
Def.taskDyn {
val parserCompile =
(syntaxDefinition / Compile / compileIncremental).value
if (parserCompile.hasModified) {
Def.task {
streams.value.log.info("Parser changed, forcing recompilation.")
clean.value
}
} else Def.task {}
}
}