@@ -11,7 +11,7 @@ import dotty.tools.scaladoc.tasty.comments.markdown.ExtendedFencedCodeBlock
11
11
import dotty .tools .scaladoc .tasty .comments .PreparsedComment
12
12
13
13
object FlexmarkSnippetProcessor :
14
- def processSnippets [T <: mdu.Node ](root : T , preparsed : Option [PreparsedComment ], checkingFunc : => SnippetChecker .SnippetCheckingFunc , withContext : Boolean )(using CompilerContext ): T = {
14
+ def processSnippets [T <: mdu.Node ](root : T , preparsed : Option [PreparsedComment ], checkingFunc : => SnippetChecker .SnippetCheckingFunc )(using CompilerContext ): T = {
15
15
lazy val cf : SnippetChecker .SnippetCheckingFunc = checkingFunc
16
16
17
17
val nodes = root.getDescendants().asScala.collect {
@@ -68,23 +68,15 @@ object FlexmarkSnippetProcessor:
68
68
69
69
val fullSnippet = Seq (snippetImports, snippet).mkString(" \n " ).trim
70
70
val snippetCompilationResult = cf(fullSnippet, lineOffset, argOverride) match {
71
- case Some (result @ SnippetCompilationResult (wrapped, _, _, messages)) if ! withContext =>
71
+ case Some (result @ SnippetCompilationResult (wrapped, _, _, messages)) =>
72
72
node.setContentString(fullSnippet)
73
- val innerLineOffset = wrapped.innerLineOffset
74
- Some (result.copy(messages = result.messages.map {
75
- case m @ SnippetCompilerMessage (Some (pos), _, _) =>
76
- m.copy(position = Some (pos.copy(relativeLine = pos.relativeLine - innerLineOffset)))
77
- case m => m
78
- }))
79
- case result@ Some (SnippetCompilationResult (wrapped, _, _, _)) =>
80
- node.setContentString(wrapped.snippet)
81
- result
73
+ Some (result)
82
74
case result =>
83
75
node.setContentString(fullSnippet)
84
76
result
85
77
}
86
78
87
- node.insertBefore(ExtendedFencedCodeBlock (id, node, snippetCompilationResult, withContext ))
79
+ node.insertBefore(ExtendedFencedCodeBlock (id, node, snippetCompilationResult))
88
80
node.unlink()
89
81
id.fold(snippetMap)(id =>
90
82
val snippetAsImport = s """ |//{i: $id
0 commit comments