@@ -11,7 +11,7 @@ import dotty.tools.scaladoc.tasty.comments.markdown.ExtendedFencedCodeBlock
1111import dotty .tools .scaladoc .tasty .comments .PreparsedComment
1212
1313object 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 = {
1515 lazy val cf : SnippetChecker .SnippetCheckingFunc = checkingFunc
1616
1717 val nodes = root.getDescendants().asScala.collect {
@@ -68,23 +68,15 @@ object FlexmarkSnippetProcessor:
6868
6969 val fullSnippet = Seq (snippetImports, snippet).mkString(" \n " ).trim
7070 val snippetCompilationResult = cf(fullSnippet, lineOffset, argOverride) match {
71- case Some (result @ SnippetCompilationResult (wrapped, _, _, messages)) if ! withContext =>
71+ case Some (result @ SnippetCompilationResult (wrapped, _, _, messages)) =>
7272 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)
8274 case result =>
8375 node.setContentString(fullSnippet)
8476 result
8577 }
8678
87- node.insertBefore(ExtendedFencedCodeBlock (id, node, snippetCompilationResult, withContext ))
79+ node.insertBefore(ExtendedFencedCodeBlock (id, node, snippetCompilationResult))
8880 node.unlink()
8981 id.fold(snippetMap)(id =>
9082 val snippetAsImport = s """ |//{i: $id
0 commit comments