Finalize boot-hint optics change

This commit is contained in:
BoykoAlex
2018-08-01 15:28:13 -04:00
parent cc756ba2d4
commit 819ae52acf
12 changed files with 11 additions and 61 deletions

Binary file not shown.

After

Width:  |  Height:  |  Size: 11 KiB

View File

@@ -39,7 +39,7 @@ public class BootInlineAnnotation extends LineContentAnnotation {
FontMetrics fontMetrics = gc.getFontMetrics();
int height = fontMetrics.getHeight();
Image bootImage = LanguageServerCommonsActivator.getInstance().getImageRegistry().get(LanguageServerCommonsActivator.BOOT_ICON_2X_KEY);
Image bootImage = LanguageServerCommonsActivator.getInstance().getImageRegistry().get(LanguageServerCommonsActivator.BOOT_KEY);
Rectangle bootImgBounds = bootImage.getBounds();
int width = (int) Math.round(bootImgBounds.width / (double) bootImgBounds.height * height);

View File

@@ -26,7 +26,7 @@ public class LanguageServerCommonsActivator extends AbstractUIPlugin {
public static final String PLUGIN_ID = "org.springframework.tooling.ls.eclipse.commons";
public static final String BOOT_ICON_2X_KEY = "boot-icon-key";
public static final String BOOT_KEY = "boot-key";
private static LanguageServerCommonsActivator instance;
@@ -37,7 +37,7 @@ public class LanguageServerCommonsActivator extends AbstractUIPlugin {
public void start(BundleContext context) throws Exception {
instance = this;
super.start(context);
getImageRegistry().put(BOOT_ICON_2X_KEY, getImageDescriptor("icons/boot-icon@2x.png"));
getImageRegistry().put(BOOT_KEY, getImageDescriptor("icons/boot.png"));
}
public final static ImageDescriptor getImageDescriptor(String path) {

View File

@@ -188,7 +188,8 @@ public class STS4LanguageClientImpl extends LanguageClientImpl implements STS4La
for (Range rng : highlights) {
try {
int start = LSPEclipseUtils.toOffset(rng.getStart(), doc);
Position colorPos = new Position(start, 0);
int end = LSPEclipseUtils.toOffset(rng.getEnd(), doc);
Position colorPos = new Position(start, end - start);
BootInlineAnnotation colorAnnotation = support.findExistingAnnotation(colorPos);
if (colorAnnotation == null) {
colorAnnotation = new BootInlineAnnotation(colorPos, sourceViewer);