Finalize boot-hint optics change
This commit is contained in:
Binary file not shown.
|
After Width: | Height: | Size: 11 KiB |
@@ -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);
|
||||
|
||||
|
||||
@@ -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) {
|
||||
|
||||
@@ -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);
|
||||
|
||||
Reference in New Issue
Block a user