Skip to content

Commit b590567

Browse files
travkin79rubenporras
authored andcommitted
Ensure file image is returned from shared images
1 parent 91eba02 commit b590567

1 file changed

Lines changed: 8 additions & 2 deletions

File tree

org.eclipse.lsp4e/src/org/eclipse/lsp4e/ui/LSPImages.java

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -243,13 +243,19 @@ private record ImageWithOverlaysKey(String baseImageKey,
243243
* Returns the <code>Image</code> identified by the given key, or <code>null</code> if it does not exist.
244244
*/
245245
public static @Nullable Image getImage(String key) {
246+
if (ISharedImages.IMG_OBJ_FILE.equals(key)) {
247+
return getSharedImage(key);
248+
}
246249
return getImageRegistry().get(key);
247250
}
248251

249252
/**
250253
* Returns the <code>ImageDescriptor</code> identified by the given key, or <code>null</code> if it does not exist.
251254
*/
252255
public static @Nullable ImageDescriptor getImageDescriptor(String key) {
256+
if (ISharedImages.IMG_OBJ_FILE.equals(key)) {
257+
return getSharedImageDescriptor(key);
258+
}
253259
return getImageRegistry().getDescriptor(key);
254260
}
255261

@@ -266,7 +272,7 @@ public static ImageRegistry getImageRegistry() {
266272
* @return the workbench's shared image for the , or null if not found
267273
*/
268274
public static @Nullable Image getSharedImage(@Nullable String imageId) {
269-
if(imageId == null) {
275+
if (imageId == null) {
270276
return null;
271277
}
272278
return PlatformUI.getWorkbench().getSharedImages().getImage(imageId);
@@ -277,7 +283,7 @@ public static ImageRegistry getImageRegistry() {
277283
* @return the workbench's shared image descriptor for the workbench, or null if not found
278284
*/
279285
public static @Nullable ImageDescriptor getSharedImageDescriptor(@Nullable String imageId) {
280-
if(imageId == null) {
286+
if (imageId == null) {
281287
return null;
282288
}
283289
return PlatformUI.getWorkbench().getSharedImages().getImageDescriptor(imageId);

0 commit comments

Comments
 (0)