Skip to content

Commit

Permalink
Clarify messages shown to the user
Browse files Browse the repository at this point in the history
  • Loading branch information
PyvesB committed Jul 16, 2024
1 parent 9f7c67d commit df6c316
Show file tree
Hide file tree
Showing 7 changed files with 22 additions and 21 deletions.
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*******************************************************************************
* Copyright (c) 2019 Red Hat Inc. and others.
* Copyright (c) 2019-2024 Red Hat Inc. and others.
*
* This program and the accompanying materials are made available under the
* terms of the Eclipse Public License v. 2.0 which is available at
Expand Down Expand Up @@ -41,7 +41,7 @@ public void launchResource(IResource resource, String mode) {
LogHelper.error("Exception whilst launching " + resource.getName(), e);
Display display = Display.getDefault();
display.asyncExec(() -> MessageDialog.openError(display.getActiveShell(), "Launch failed",
"Please open the Error Log view for details."));
"Please check the Error Log view for details."));
}
}

Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*******************************************************************************
* Copyright (c) 2019-2022 Pierre-Yves B. and others.
* Copyright (c) 2019-2024 Pierre-Yves B. 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 @@ -77,10 +77,11 @@ public void launch(ILaunchConfiguration configuration, String mode, ILaunch laun
private void displayNotFoundWarning() {
Display display = Display.getDefault();
display.asyncExec(() -> {
MessageDialog notFoundDialog = new MessageDialog(display.getActiveShell(), "Readapt was not found", null,
"Readapt is required for debugging. Let Eclipse install the gem locally or specify its path "
MessageDialog notFoundDialog = new MessageDialog(display.getActiveShell(), "Readapt gem not found", null,
"Readapt is required for debugging. Let Eclipse install the gem locally, or specify its path "
+ "after running \"gem install readapt\" in a terminal." + System.lineSeparator()
+ System.lineSeparator() + "Please restart the debug session once installation is complete.",
+ System.lineSeparator()
+ "Please restart the debug session once the installation is complete.",
MessageDialog.WARNING, 0, "Install gem", "Specify path");
int buttonIndex = notFoundDialog.open();
if (buttonIndex == 0) {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*******************************************************************************
* Copyright (c) 2019-2021 Pierre-Yves B. and others.
* Copyright (c) 2019-2024 Pierre-Yves B. and others.
*
* This program and the accompanying materials are made
* available under the terms of the Eclipse Public License 2.0
Expand All @@ -15,8 +15,8 @@
public enum BooleanPreferences implements Preference<Boolean> {

UPDATE_GEM("AutoUpdate", "Automatically update the Solargraph and Readapt gems", true),
SYSTEM_RUBY("SystemRuby", "Launch Ruby, Gem and Bundler commands using system path", true),
DEBUG_READAPT("DebugReadapt", "Troubleshoot Readapt debugger by enabling adapter logs", false);
SYSTEM_RUBY("SystemRuby", "Use the Ruby installation from the PATH environment variable for \"Run As\" launches", true),
DEBUG_READAPT("DebugReadapt", "Troubleshoot the Readapt debugger by adding an output to the Console view", false);

private final String key;
private final String desc;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*******************************************************************************
* Copyright (c) 2020-2022 Pierre-Yves B. and others.
* Copyright (c) 2020-2024 Pierre-Yves B. 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 @@ -80,16 +80,16 @@ public void createFieldEditors() {
gitHubImage = ImageDescriptor.createFromURL(url).createImage();
new Label(composite, SWT.NONE).setImage(gitHubImage);
Link supportLink = new Link(composite, SWT.NONE);
supportLink.setText("Head over to <a href=\"https://github.com/PyvesB/eclipse-solargraph\">GitHub</a> for support. "
+ "Also feel free to star or fork the repository.");
supportLink.setText("Need support? Head over to <a href=\"https://github.com/PyvesB/eclipse-solargraph\">GitHub</a>! "
+ "If you find the plugin helpful, consider starring the repo ⭐");
supportLink.addSelectionListener(SelectionListener.widgetSelectedAdapter(e -> Program.launch(e.text)));
}

@Override
public void init(IWorkbench workbench) {
Bundle bundle = FrameworkUtil.getBundle(this.getClass());
setPreferenceStore(new ScopedPreferenceStore(InstanceScope.INSTANCE, bundle.getSymbolicName()));
setDescription("Modify settings of the Ruby Solargraph plugin.");
setDescription("Settings for Ruby development tools:");
}

@Override
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*******************************************************************************
* Copyright (c) 2019-2022 Pierre-Yves B. and others.
* Copyright (c) 2019-2024 Pierre-Yves B. and others.
*
* This program and the accompanying materials are made
* available under the terms of the Eclipse Public License 2.0
Expand All @@ -19,7 +19,7 @@
public enum StringPreferences implements Preference<String> {

GEM_PATH("GemPath", "Solargraph executable:", CommandHelper.findPath(isWindows() ? "solargraph.bat" : "solargraph")),
RUBY_DIR("RubyDir", "Ruby bin directory:", CommandHelper.findDirectory("ruby")),
RUBY_DIR("RubyDir", "Ruby bin directory for \"Run As\" launches:", CommandHelper.findDirectory("ruby")),
READAPT_PATH("ReadaptPath", "Readapt executable:", CommandHelper.findPath(isWindows() ? "readapt.bat" : "readapt"));

private final String key;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*******************************************************************************
* Copyright (c) 2019-2022 Pierre-Yves B. and others.
* Copyright (c) 2019-2024 Pierre-Yves B. 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 @@ -72,8 +72,8 @@ private static List<String> getSolargraphCommand() {
private void displayNotFoundWarning() {
Display display = Display.getDefault();
display.asyncExec(() -> {
MessageDialog notFoundDialog = new MessageDialog(display.getActiveShell(), "Solargraph was not found", null,
"Key features will not be available. Let Eclipse install the gem locally or specify its path "
MessageDialog notFoundDialog = new MessageDialog(display.getActiveShell(), "Solargraph gem not found", null,
"Solargraph is required for key features. Let Eclipse install the gem locally, or specify its path "
+ "after running \"gem install solargraph\" in a terminal.",
MessageDialog.WARNING, 0, "Install gem", "Specify path");
int buttonIndex = notFoundDialog.open();
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*******************************************************************************
* Copyright (c) 2019-2022 Pierre-Yves B. and others.
* Copyright (c) 2019-2024 Pierre-Yves B. 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 @@ -69,9 +69,9 @@ private static String getPluginStateLocation() {

private static void displayInstallationError(String gem) {
MessageDialog errorDialog = new MessageDialog(Display.getDefault().getActiveShell(), gem + " installation failed",
null, "Please open the Error Log view for details. To manually install it, run \"gem install "
null, "Please check the Error Log view for details. To manually install it, run \"gem install "
+ gem.toLowerCase() + "\" in a terminal and specify the path in the plugin's preferences.",
MessageDialog.ERROR, 0, "Open error logs", "Specify path");
MessageDialog.ERROR, 0, "View error logs", "Specify path");
int buttonIndex = errorDialog.open();
if (buttonIndex == 0) {
try {
Expand Down

0 comments on commit df6c316

Please sign in to comment.