-
Notifications
You must be signed in to change notification settings - Fork 121
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #1130 from eed3si9n/wip/1.7.2
Util 1.7.2
- Loading branch information
Showing
10 changed files
with
179 additions
and
25 deletions.
There are no files selected for viewing
This file contains 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
This file contains 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
This file contains 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
This file contains 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
This file contains 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
41 changes: 41 additions & 0 deletions
41
internal/zinc-persist/src/main/scala/sbt/internal/inc/DiagnosticsUtil.scala
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,41 @@ | ||
/* | ||
* Zinc - The incremental compiler for Scala. | ||
* Copyright Lightbend, Inc. and Mark Harrah | ||
* | ||
* Licensed under Apache License 2.0 | ||
* (http://www.apache.org/licenses/LICENSE-2.0). | ||
* | ||
* See the NOTICE file distributed with this work for | ||
* additional information regarding copyright ownership. | ||
*/ | ||
|
||
package sbt | ||
package internal | ||
package inc | ||
|
||
import java.util.Optional | ||
import sbt.util.InterfaceUtil | ||
import xsbti.{ DiagnosticCode, DiagnosticRelatedInformation, Position } | ||
|
||
object DiagnosticsUtil { | ||
def diagnosticCode(code: String, explanation: Option[String]): DiagnosticCode = | ||
new ConcreteDiagnosticCode(code, explanation) | ||
|
||
def diagnosticRelatedInformation( | ||
position: Position, | ||
message: String | ||
): DiagnosticRelatedInformation = | ||
new ConcreteDiagnosticRelatedInformation(position, message) | ||
|
||
private class ConcreteDiagnosticCode(code0: String, explanation0: Option[String]) | ||
extends DiagnosticCode { | ||
override val code: String = code0 | ||
override val explanation: Optional[String] = InterfaceUtil.o2jo(explanation0) | ||
} | ||
|
||
private class ConcreteDiagnosticRelatedInformation(position0: Position, message0: String) | ||
extends DiagnosticRelatedInformation { | ||
override val position: Position = position0 | ||
override val message: String = message0 | ||
} | ||
} |
This file contains 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
This file contains 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
This file contains 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
This file contains 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