JS frontend: suppress warnings from stdlib.
This commit is contained in:
+12
@@ -22,6 +22,10 @@ import org.jetbrains.jet.lang.diagnostics.Errors
|
||||
import org.jetbrains.jet.lang.resolve.name.FqNameUnsafe
|
||||
import org.jetbrains.jet.lang.resolve.DiagnosticsWithSuppression
|
||||
import org.jetbrains.k2js.PredefinedAnnotation
|
||||
import org.jetbrains.jet.lang.diagnostics.Diagnostic
|
||||
import org.jetbrains.jet.lang.diagnostics.Severity
|
||||
import org.jetbrains.jet.lang.psi.JetFile
|
||||
import org.jetbrains.k2js.config.LibrarySourcesConfig
|
||||
|
||||
class SuppressUnusedParameterForJsNative : DiagnosticsWithSuppression.SuppressStringProvider {
|
||||
override fun get(annotationDescriptor: AnnotationDescriptor): List<String> {
|
||||
@@ -32,4 +36,12 @@ class SuppressUnusedParameterForJsNative : DiagnosticsWithSuppression.SuppressSt
|
||||
|
||||
return listOf()
|
||||
}
|
||||
}
|
||||
|
||||
class SuppressWarningsFromExternalModules : DiagnosticsWithSuppression.DiagnosticSuppressor {
|
||||
override fun isSuppressed(diagnostic: Diagnostic): Boolean {
|
||||
val file = diagnostic.getPsiFile()
|
||||
return diagnostic.getSeverity() == Severity.WARNING &&
|
||||
file is JetFile && file.getUserData(LibrarySourcesConfig.EXTERNAL_MODULE_NAME) != null
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user