getDiagnostics() in BindingContext returns Diagnostics rather than List<Diagnostic>
This commit is contained in:
@@ -103,7 +103,7 @@ public class IdeRenderers {
|
||||
private Set<ValueParameterDescriptor> getParametersToHighlight(ResolvedCall<? extends CallableDescriptor> call) {
|
||||
Set<ValueParameterDescriptor> parameters = new HashSet<ValueParameterDescriptor>();
|
||||
if (call instanceof ResolvedCallImpl) {
|
||||
Collection<Diagnostic> diagnostics = ((ResolvedCallImpl)call).getTrace().getBindingContext().getDiagnostics();
|
||||
Iterable<Diagnostic> diagnostics = ((ResolvedCallImpl)call).getTrace().getBindingContext().getDiagnostics();
|
||||
for (Diagnostic diagnostic : diagnostics) {
|
||||
if (diagnostic.getFactory() == Errors.TOO_MANY_ARGUMENTS) {
|
||||
parameters.add(null);
|
||||
|
||||
@@ -78,7 +78,7 @@ public class MapPlatformClassToKotlinFix extends JetIntentionAction<JetReference
|
||||
@Override
|
||||
public void invoke(@NotNull Project project, Editor editor, JetFile file) throws IncorrectOperationException {
|
||||
BindingContext context = KotlinCacheManagerUtil.getDeclarationsBindingContext(file);
|
||||
Collection<Diagnostic> diagnostics = context.getDiagnostics();
|
||||
Iterable<Diagnostic> diagnostics = context.getDiagnostics();
|
||||
List<JetImportDirective> imports = new ArrayList<JetImportDirective>();
|
||||
List<JetUserType> usages = new ArrayList<JetUserType>();
|
||||
|
||||
|
||||
@@ -56,7 +56,7 @@ public class DiagnosticMessageTest extends JetLiteFixture {
|
||||
BindingContext bindingContext = analyzeExhaust.getBindingContext();
|
||||
|
||||
final Set<AbstractDiagnosticFactory> factoriesSet = Sets.newHashSet(diagnosticFactories);
|
||||
List<Diagnostic> diagnostics = ContainerUtil.filter(bindingContext.getDiagnostics(), new Condition<Diagnostic>() {
|
||||
List<Diagnostic> diagnostics = ContainerUtil.filter(bindingContext.getDiagnostics().all(), new Condition<Diagnostic>() {
|
||||
@Override
|
||||
public boolean value(Diagnostic diagnostic) {
|
||||
return factoriesSet.contains(diagnostic.getFactory());
|
||||
|
||||
@@ -47,7 +47,7 @@ public class NoErrorsInStdlibTest: LightCodeInsightFixtureTestCase() {
|
||||
val psiFile = psiManager.findFile(file)
|
||||
if (psiFile is JetFile) {
|
||||
var bindingContext = AnalyzerFacadeWithCache.analyzeFileWithCache(psiFile).getBindingContext()
|
||||
val errors = bindingContext.getDiagnostics().filter { it.getSeverity() == Severity.ERROR }
|
||||
val errors = bindingContext.getDiagnostics().all().filter { it.getSeverity() == Severity.ERROR }
|
||||
|
||||
if (!errors.isEmpty()) {
|
||||
System.err.println("${psiFile.getName()}: ${errors.size()} errors")
|
||||
|
||||
@@ -47,7 +47,7 @@ public class QuickFixActionsUtils {
|
||||
|
||||
AnalyzeExhaust exhaust = AnalyzerFacadeWithCache.analyzeFileWithCache(file);
|
||||
|
||||
Collection<Diagnostic> diagnostics = exhaust.getBindingContext().getDiagnostics();
|
||||
Collection<Diagnostic> diagnostics = exhaust.getBindingContext().getDiagnostics().all();
|
||||
Collection<Diagnostic> errorDiagnostics = Collections2.filter(diagnostics, new Predicate<Diagnostic>() {
|
||||
@Override
|
||||
public boolean apply(@Nullable Diagnostic diagnostic) {
|
||||
|
||||
Reference in New Issue
Block a user