Search in sources :

Example 1 with JavaStringStatusContext

use of org.eclipse.jdt.ls.core.internal.corext.refactoring.base.JavaStringStatusContext in project eclipse.jdt.ls by eclipse.

the class RefactoringAnalyzeUtil method reportProblemNodes.

// public static IRegion[] getNewRanges(TextEdit[] edits, TextChange change) {
// IRegion[] result = new IRegion[edits.length];
// for (int i = 0; i < edits.length; i++) {
// result[i] = RefactoringAnalyzeUtil.getNewTextRange(edits[i], change);
// }
// return result;
// }
// 
public static RefactoringStatus reportProblemNodes(String modifiedWorkingCopySource, SimpleName[] problemNodes) {
    RefactoringStatus result = new RefactoringStatus();
    for (int i = 0; i < problemNodes.length; i++) {
        RefactoringStatusContext context = new JavaStringStatusContext(modifiedWorkingCopySource, SourceRangeFactory.create(problemNodes[i]));
        result.addError(Messages.format(RefactoringCoreMessages.RefactoringAnalyzeUtil_name_collision, BasicElementLabels.getJavaElementName(problemNodes[i].getIdentifier())), context);
    }
    return result;
}
Also used : RefactoringStatusContext(org.eclipse.ltk.core.refactoring.RefactoringStatusContext) RefactoringStatus(org.eclipse.ltk.core.refactoring.RefactoringStatus) JavaStringStatusContext(org.eclipse.jdt.ls.core.internal.corext.refactoring.base.JavaStringStatusContext)

Aggregations

JavaStringStatusContext (org.eclipse.jdt.ls.core.internal.corext.refactoring.base.JavaStringStatusContext)1 RefactoringStatus (org.eclipse.ltk.core.refactoring.RefactoringStatus)1 RefactoringStatusContext (org.eclipse.ltk.core.refactoring.RefactoringStatusContext)1