Jandex based Java Knowledge integration

This commit is contained in:
BoykoAlex
2016-11-08 10:19:58 -05:00
parent 6df038a93a
commit 010104ec8b
83 changed files with 3782 additions and 576 deletions

View File

@@ -1,5 +1,7 @@
package org.springframework.ide.vscode.commons.languageserver.reconcile;
import org.springframework.ide.vscode.commons.languageserver.util.DocumentRegion;
/**
* An implementation of {@link ReconcileProblem} that is just a simple data object.
*
@@ -45,4 +47,24 @@ public class ReconcileProblemImpl implements ReconcileProblem {
return getType().getCode();
}
/**
* Attempt to enlarge a empty document region to include a
* character that can be visibly underlined.
*/
protected static DocumentRegion makeVisible(DocumentRegion region) {
DocumentRegion altRegion = region.textAfter(1);
if (!altRegion.isEmpty() && canUnderline(altRegion.charAt(0))) {
return altRegion;
}
altRegion = region.textBefore(1);
if (!altRegion.isEmpty() && canUnderline(altRegion.charAt(0))) {
return altRegion;
}
return region;
}
private static boolean canUnderline(char c) {
return c!='\n'&&c!='\r';
}
}