private static boolean internalHasResolutions(IMarker marker) { ErrorCode id = new DartMarkerAnnotation(marker).getId(); CompilationUnit cu = getCompilationUnit(marker); return cu != null && DartCorrectionProcessor_OLD.hasCorrections( cu, id, MarkerUtilities.getMarkerType(marker)); }
private static IMarkerResolution[] internalGetResolutions(IMarker marker) { if (!internalHasResolutions(marker)) { return NO_RESOLUTIONS; } CompilationUnit cu = getCompilationUnit(marker); if (cu != null) { IEditorInput input = EditorUtility.getEditorInput(cu); if (input != null) { IProblemLocation location = findProblemLocation(input, marker); if (location != null) { IInvocationContext context = new AssistContext(cu, location.getOffset(), location.getLength()); // TODO(scheglov) do we need this? // if (!hasProblem(context.getASTRoot().getProblems(), location)) { // return NO_RESOLUTIONS; // } List<IDartCompletionProposal> proposals = Lists.newArrayList(); DartCorrectionProcessor_OLD.collectCorrections( context, new IProblemLocation[] {location}, proposals); Collections.sort(proposals, new CompletionProposalComparator()); int nProposals = proposals.size(); IMarkerResolution[] resolutions = new IMarkerResolution[nProposals]; for (int i = 0; i < nProposals; i++) { resolutions[i] = new CorrectionMarkerResolution( cu, location.getOffset(), location.getLength(), proposals.get(i)); } return resolutions; } } } return NO_RESOLUTIONS; }