Skip to content

Commit

Permalink
Fix compilation against 2024-09
Browse files Browse the repository at this point in the history
  • Loading branch information
akurtakov committed Sep 11, 2024
1 parent 3f044e3 commit bad0c91
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 14 deletions.
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*********************************************************************
* Copyright (c) 2017, 2021 Red Hat Inc. and others.
* Copyright (c) 2017, 2024 Red Hat Inc. and others.
*
* This program and the accompanying materials are made
* available under the terms of the Eclipse Public License 2.0
Expand All @@ -12,7 +12,6 @@
*******************************************************************************/
package org.eclipse.corrosion.test.actions;

import java.io.IOException;
import java.util.ArrayList;
import java.util.List;
import java.util.concurrent.CompletableFuture;
Expand Down Expand Up @@ -70,12 +69,8 @@ public void run() {
if (project == null) {
return;
}
LanguageServerWrapper languageServer = null;
try {
languageServer = LanguageServiceAccessor.getLSWrapper(project, CorrosionPlugin.languageServerDefinition());
} catch (IOException ex) {
CorrosionPlugin.logError(ex);
}
LanguageServerWrapper languageServer = LanguageServiceAccessor.getLSWrapper(project,
CorrosionPlugin.languageServerDefinition());
if (languageServer == null) {
return;
}
Expand Down Expand Up @@ -155,12 +150,14 @@ private static List<SymbolInformation> getQualifiedSymbols(LanguageServerWrapper
return parents;
}

private static List<SymbolInformation> getSymbols(LanguageServerWrapper languageServer, final String name, String parent,
private static List<SymbolInformation> getSymbols(LanguageServerWrapper languageServer, final String name,
String parent,
SymbolKind kind) {
List<SymbolInformation> result = new ArrayList<>();

WorkspaceSymbolParams params = new WorkspaceSymbolParams(name);
CompletableFuture<Either<List<? extends SymbolInformation>, List<? extends WorkspaceSymbol>>> symbols = languageServer.execute(ls -> ls.getWorkspaceService().symbol(params));
CompletableFuture<Either<List<? extends SymbolInformation>, List<? extends WorkspaceSymbol>>> symbols = languageServer
.execute(ls -> ls.getWorkspaceService().symbol(params));

try {
List<?> items = (List<?>) symbols.get(10, TimeUnit.SECONDS).get();
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*********************************************************************
* Copyright (c) 2017, 2021 Red Hat Inc. and others.
* Copyright (c) 2017, 2024 Red Hat Inc. and others.
*
* This program and the accompanying materials are made
* available under the terms of the Eclipse Public License 2.0
Expand Down Expand Up @@ -39,7 +39,6 @@
import org.eclipse.swt.layout.GridLayout;
import org.eclipse.swt.widgets.Button;
import org.eclipse.swt.widgets.Composite;
import org.eclipse.swt.widgets.Control;
import org.eclipse.swt.widgets.DirectoryDialog;
import org.eclipse.swt.widgets.Label;
import org.eclipse.swt.widgets.Text;
Expand Down Expand Up @@ -233,7 +232,7 @@ private void createLocationPart(Composite container) {
linesAboveLinkLayoutData.heightHint = linesAboveLinkLayoutData.widthHint = 30;
linesAboveLink.setLayoutData(linesAboveLinkLayoutData);
linesAboveLink.addPaintListener(e -> {
e.gc.setForeground(((Control) e.widget).getDisplay().getSystemColor(SWT.COLOR_DARK_GRAY));
e.gc.setForeground(e.widget.getDisplay().getSystemColor(SWT.COLOR_DARK_GRAY));
e.gc.drawLine(0, e.height / 2, e.width / 2, e.height / 2);
e.gc.drawLine(e.width / 2, e.height / 2, e.width / 2, e.height);
});
Expand Down Expand Up @@ -277,7 +276,7 @@ private void createLocationPart(Composite container) {
linesBelowLinkLayoutData.heightHint = linesBelowLinkLayoutData.widthHint = 30;
linesBelowLink.setLayoutData(linesAboveLinkLayoutData);
linesBelowLink.addPaintListener(e -> {
e.gc.setForeground(((Control) e.widget).getDisplay().getSystemColor(SWT.COLOR_DARK_GRAY));
e.gc.setForeground(e.widget.getDisplay().getSystemColor(SWT.COLOR_DARK_GRAY));
e.gc.drawLine(0, e.height / 2, e.width / 2, e.height / 2);
e.gc.drawLine(e.width / 2, e.height / 2, e.width / 2, 0);
});
Expand Down

0 comments on commit bad0c91

Please sign in to comment.