Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Make sure LSP notification message is wrapped #221

Merged
merged 1 commit into from
Aug 23, 2022
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*******************************************************************************
* Copyright (c) 2016, 2021 Rogue Wave Software Inc. and others.
* Copyright (c) 2016, 2022 Rogue Wave Software Inc. and others.
* This program and the accompanying materials are made
* available under the terms of the Eclipse Public License 2.0
* which is available at https://www.eclipse.org/legal/epl-2.0/
Expand All @@ -22,6 +22,7 @@
import org.eclipse.lsp4j.ShowMessageRequestParams;
import org.eclipse.swt.SWT;
import org.eclipse.swt.graphics.Image;
import org.eclipse.swt.layout.GridData;
import org.eclipse.swt.widgets.Composite;
import org.eclipse.swt.widgets.Display;
import org.eclipse.swt.widgets.Label;
Expand Down Expand Up @@ -53,8 +54,9 @@ public String getPopupShellTitle() {

@Override
protected void createContentArea(Composite parent) {
Label label = new Label(parent, SWT.WRAP);
label.setText(messageParams.getMessage());
Label messageLabel = new Label(parent, SWT.WRAP);
messageLabel.setLayoutData(new GridData(SWT.FILL, SWT.CENTER, true, false));
messageLabel.setText(messageParams.getMessage());
}

@Override
Expand Down Expand Up @@ -102,7 +104,7 @@ public static void showMessage(String title, MessageParams params) {
}

public static CompletableFuture<MessageActionItem> showMessageRequest(LanguageServerWrapper wrapper, ShowMessageRequestParams params) {
String options[] = params.getActions().stream().map(MessageActionItem::getTitle).toArray(String[]::new);
String[] options = params.getActions().stream().map(MessageActionItem::getTitle).toArray(String[]::new);
CompletableFuture<MessageActionItem> future = new CompletableFuture<>();

Display.getDefault().asyncExec(() -> {
Expand Down