add -P:sxr:output-class:<class> option#10
Open
ezh wants to merge 2 commits intoharrah:masterfrom
ezh:master
Open
add -P:sxr:output-class:<class> option#10ezh wants to merge 2 commits intoharrah:masterfrom ezh:master
ezh wants to merge 2 commits intoharrah:masterfrom
ezh:master
Conversation
Owner
|
I apologize for the long delay in looking at this. I like the idea. If you still happen to be interested, please rebase onto master and it will get merged. |
|
Hey @ezh If you have the opportunity, can you rebase this patch on master over here: https://github.com/sbt/sxr. Thanks! |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Dear Mark,
Thank you very much for 'browse'. I slightly modify your code by adding new option. I try to preserve all punctuation, tabs, \r\n. I hope that addition look like original code. This new option allow add external class writer for sxr.
For example
somewhere at build.sbt or like one:
scalacOptions += "-Xplugin:other.package.jar"
scalacOptions <+= (scalaSource in Compile) map { (source) => { "-P:sxr:output-class:other.package.CustomWriter" }
Our custom writer
package other.package
import java.io.File
import sxr.OutputWriter
import sxr.Token
import sxr.OutputWriterContext
class CustomWriter(context: OutputWriterContext) extends OutputWriter {
/** Generates initial content. */
def writeStart() {
}
/** Generates content for a given source file. */
def writeUnit(source: File, relativeSourcePath: String, tokenList: List[Token]) {
println("--- " + source.toString)
...
withReader(source, context.encoding) { input =>
withWriter(destination) { output =>
tokenList.foreach( ... custom code ...))
}
}
}
/** Generates final content. */
def writeEnd() {
}
}
It's work surprisingly well. I hope that you accept this addition. If i need it modify, please tell me about.
King regards,
Alexey