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

feat: Validate preferences in lsp console #222

Open
wants to merge 13 commits into
base: main
Choose a base branch
from
Original file line number Diff line number Diff line change
Expand Up @@ -7,12 +7,12 @@
*
* Contributors:
* Red Hat, Inc. - initial API and implementation
* Mitja Leino <[email protected]> - Extend ValidatableDialog for validations
******************************************************************************/
package com.redhat.devtools.lsp4ij.launching.ui;

import com.intellij.openapi.project.Project;
import com.intellij.openapi.ui.ComboBox;
import com.intellij.openapi.ui.DialogWrapper;
import com.intellij.openapi.ui.ValidationInfo;
import com.intellij.ui.DocumentAdapter;
import com.intellij.ui.SimpleListCellRenderer;
Expand All @@ -25,6 +25,7 @@
import com.redhat.devtools.lsp4ij.launching.templates.LanguageServerTemplateManager;
import com.redhat.devtools.lsp4ij.server.definition.launching.UserDefinedLanguageServerDefinition;
import com.redhat.devtools.lsp4ij.settings.ui.LanguageServerPanel;
import com.redhat.devtools.lsp4ij.settings.ui.ValidatableDialog;
import org.jetbrains.annotations.NotNull;
import org.jetbrains.annotations.Nullable;

Expand All @@ -40,7 +41,7 @@
/**
* New language server dialog.
*/
public class NewLanguageServerDialog extends DialogWrapper {
public class NewLanguageServerDialog extends ValidatableDialog {

private final ComboBox<LanguageServerTemplate> templateCombo = new ComboBox<>(new DefaultComboBoxModel<>(getLanguageServerTemplates()));
private final Project project;
Expand Down Expand Up @@ -70,7 +71,7 @@
// Template combo
createTemplateCombo(builder);
// Create server name, command line, mappings, configuration UI
this.languageServerPanel = new LanguageServerPanel(builder, null, LanguageServerPanel.EditionMode.NEW_USER_DEFINED);
this.languageServerPanel = new LanguageServerPanel(builder, null, LanguageServerPanel.EditionMode.NEW_USER_DEFINED, this);

Check warning on line 74 in src/main/java/com/redhat/devtools/lsp4ij/launching/ui/NewLanguageServerDialog.java

View check run for this annotation

Codecov / codecov/patch

src/main/java/com/redhat/devtools/lsp4ij/launching/ui/NewLanguageServerDialog.java#L74

Added line #L74 was not covered by tests

// Add validation
addValidator(this.languageServerPanel.getServerName());
Expand Down Expand Up @@ -165,38 +166,9 @@

@Override
protected @NotNull List<ValidationInfo> doValidateAll() {
List<ValidationInfo> validations = new ArrayList<>();
addValidationInfo(validateServerName(), validations);
addValidationInfo(validateCommand(), validations);
return validations;
return languageServerPanel.doValidateAll();

Check warning on line 169 in src/main/java/com/redhat/devtools/lsp4ij/launching/ui/NewLanguageServerDialog.java

View check run for this annotation

Codecov / codecov/patch

src/main/java/com/redhat/devtools/lsp4ij/launching/ui/NewLanguageServerDialog.java#L169

Added line #L169 was not covered by tests
}

private void addValidationInfo(ValidationInfo validationInfo, List<ValidationInfo> validations) {
if (validationInfo == null) {
return;
}
validations.add((validationInfo));
}

private ValidationInfo validateServerName() {
var serverName = this.languageServerPanel.getServerName();
if (serverName.getText().isBlank()) {
String errorMessage = LanguageServerBundle.message("new.language.server.dialog.validation.serverName.must.be.set");
return new ValidationInfo(errorMessage, serverName);
}
return null;
}

private ValidationInfo validateCommand() {
var commandLine = this.languageServerPanel.getCommandLine();
if (commandLine.getText().isBlank()) {
String errorMessage = LanguageServerBundle.message("new.language.server.dialog.validation.commandLine.must.be.set");
return new ValidationInfo(errorMessage, commandLine);
}
return null;
}


@Override
protected void doOKAction() {
super.doOKAction();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@
*
* Contributors:
* Red Hat Inc. - initial API and implementation
* Mitja Leino <[email protected]> - Extend ValidatableDialog for validations
*******************************************************************************/
package com.redhat.devtools.lsp4ij.settings;

Expand All @@ -19,6 +20,7 @@
import com.intellij.openapi.fileTypes.FileNameMatcher;
import com.intellij.openapi.fileTypes.FileType;
import com.intellij.openapi.project.Project;
import com.intellij.openapi.ui.ValidationInfo;
import com.intellij.ui.IdeBorderFactory;
import com.intellij.util.ui.FormBuilder;
import com.intellij.util.ui.JBUI;
Expand All @@ -31,13 +33,13 @@
import com.redhat.devtools.lsp4ij.server.definition.launching.UserDefinedLanguageServerDefinition;
import com.redhat.devtools.lsp4ij.settings.ui.LanguageServerPanel;
import com.redhat.devtools.lsp4ij.settings.ui.ServerMappingsPanel;
import com.redhat.devtools.lsp4ij.settings.ui.ValidatableDialog;
import org.jetbrains.annotations.NotNull;
import org.jetbrains.annotations.Nullable;

import javax.swing.*;
import javax.swing.border.TitledBorder;
import java.util.List;
import java.util.Objects;
import java.util.*;
import java.util.stream.Collectors;

/**
Expand All @@ -50,7 +52,7 @@
* <li>Suspend and wait for a debugger?</li>
* </ul>
*/
public class LanguageServerView implements Disposable {
public class LanguageServerView extends ValidatableDialog implements Disposable {

private final LanguageServerNameProvider languageServerNameProvider;

Expand All @@ -70,6 +72,7 @@
@Nullable LanguageServerNameProvider languageServerNameProvider,
@NotNull Project project
) {
super(project);

Check warning on line 75 in src/main/java/com/redhat/devtools/lsp4ij/settings/LanguageServerView.java

View check run for this annotation

Codecov / codecov/patch

src/main/java/com/redhat/devtools/lsp4ij/settings/LanguageServerView.java#L75

Added line #L75 was not covered by tests
this.languageServerDefinition = languageServerDefinition;
this.languageServerNameProvider = languageServerNameProvider;
this.project = project;
Expand Down Expand Up @@ -285,7 +288,7 @@
this.languageServerPanel = new LanguageServerPanel(builder,
description,
launchingServerDefinition ? LanguageServerPanel.EditionMode.EDIT_USER_DEFINED :
LanguageServerPanel.EditionMode.EDIT_EXTENSION);
LanguageServerPanel.EditionMode.EDIT_EXTENSION, this);

Check warning on line 291 in src/main/java/com/redhat/devtools/lsp4ij/settings/LanguageServerView.java

View check run for this annotation

Codecov / codecov/patch

src/main/java/com/redhat/devtools/lsp4ij/settings/LanguageServerView.java#L291

Added line #L291 was not covered by tests
this.mappingPanel = languageServerPanel.getMappingsPanel();
return builder
.addComponentFillVertically(new JPanel(), 50)
Expand Down Expand Up @@ -410,6 +413,16 @@
initializationOptions.setCaretPosition(0);
}

@Override
protected @Nullable JComponent createCenterPanel() {
return myMainPanel;

Check warning on line 418 in src/main/java/com/redhat/devtools/lsp4ij/settings/LanguageServerView.java

View check run for this annotation

Codecov / codecov/patch

src/main/java/com/redhat/devtools/lsp4ij/settings/LanguageServerView.java#L418

Added line #L418 was not covered by tests
}

@Override
public @NotNull List<ValidationInfo> doValidateAll() {
return languageServerPanel.doValidateAll();

Check warning on line 423 in src/main/java/com/redhat/devtools/lsp4ij/settings/LanguageServerView.java

View check run for this annotation

Codecov / codecov/patch

src/main/java/com/redhat/devtools/lsp4ij/settings/LanguageServerView.java#L423

Added line #L423 was not covered by tests
}

@Override
public void dispose() {
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,23 +10,49 @@
*
* Contributors:
* Red Hat Inc. - initial API and implementation
* Mitja Leino <[email protected]> - Implement ValidatableConsoleWidget
*******************************************************************************/
package com.redhat.devtools.lsp4ij.settings.ui;

import com.intellij.openapi.ui.ValidationInfo;
import com.intellij.ui.components.JBTextArea;
import com.intellij.util.ui.JBFont;
import com.redhat.devtools.lsp4ij.LanguageServerBundle;

import javax.swing.border.Border;
import java.util.ArrayList;
import java.util.List;

/**
* Command line widget used to fill the command to start a language server.
* Command line widget used to fill the command to start a language
* server when creating a new or modifying an existing LS configuration

Check warning on line 28 in src/main/java/com/redhat/devtools/lsp4ij/settings/ui/CommandLineWidget.java

View check run for this annotation

Codecov / codecov/patch

src/main/java/com/redhat/devtools/lsp4ij/settings/ui/CommandLineWidget.java#L27-L28

Added lines #L27 - L28 were not covered by tests
*/
public class CommandLineWidget extends JBTextArea {
public class CommandLineWidget extends JBTextArea implements ValidatableConsoleWidget {
private final String errorMessage = LanguageServerBundle.message("new.language.server.dialog.validation.commandLine.must.be.set");

Check warning on line 31 in src/main/java/com/redhat/devtools/lsp4ij/settings/ui/CommandLineWidget.java

View check run for this annotation

Codecov / codecov/patch

src/main/java/com/redhat/devtools/lsp4ij/settings/ui/CommandLineWidget.java#L30-L31

Added lines #L30 - L31 were not covered by tests
private final transient Border normalBorder;

public CommandLineWidget() {
super(5, 0);
super.setLineWrap(true);
super.setWrapStyleWord(true);
super.setFont(JBFont.regular());
super.getEmptyText().setText(LanguageServerBundle.message("language.server.command.emptyText"));
this.normalBorder = this.getBorder();
}

Check warning on line 41 in src/main/java/com/redhat/devtools/lsp4ij/settings/ui/CommandLineWidget.java

View check run for this annotation

Codecov / codecov/patch

src/main/java/com/redhat/devtools/lsp4ij/settings/ui/CommandLineWidget.java#L40-L41

Added lines #L40 - L41 were not covered by tests

@Override
public void validate(List<ValidationInfo> validations) {
List<ValidationInfo> widgetValidations = new ArrayList<>();

Check warning on line 45 in src/main/java/com/redhat/devtools/lsp4ij/settings/ui/CommandLineWidget.java

View check run for this annotation

Codecov / codecov/patch

src/main/java/com/redhat/devtools/lsp4ij/settings/ui/CommandLineWidget.java#L45

Added line #L45 was not covered by tests

if (getDocument() != null && getText().isBlank()) {
widgetValidations.add(new ValidationInfo(errorMessage, this));

Check warning on line 48 in src/main/java/com/redhat/devtools/lsp4ij/settings/ui/CommandLineWidget.java

View check run for this annotation

Codecov / codecov/patch

src/main/java/com/redhat/devtools/lsp4ij/settings/ui/CommandLineWidget.java#L48

Added line #L48 was not covered by tests
}

if (widgetValidations.isEmpty()) {
this.setBorder(normalBorder);

Check warning on line 52 in src/main/java/com/redhat/devtools/lsp4ij/settings/ui/CommandLineWidget.java

View check run for this annotation

Codecov / codecov/patch

src/main/java/com/redhat/devtools/lsp4ij/settings/ui/CommandLineWidget.java#L52

Added line #L52 was not covered by tests
} else {
validations.addAll(widgetValidations);
setErrorBorder(this);

Check warning on line 55 in src/main/java/com/redhat/devtools/lsp4ij/settings/ui/CommandLineWidget.java

View check run for this annotation

Codecov / codecov/patch

src/main/java/com/redhat/devtools/lsp4ij/settings/ui/CommandLineWidget.java#L54-L55

Added lines #L54 - L55 were not covered by tests
}
}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -7,19 +7,18 @@
*
* Contributors:
* Red Hat, Inc. - initial API and implementation
* Mitja Leino <[email protected]> - Add DialogWrapper for validations
******************************************************************************/
package com.redhat.devtools.lsp4ij.settings.ui;

import com.intellij.execution.configuration.EnvironmentVariablesComponent;
import com.intellij.ide.BrowserUtil;
import com.intellij.openapi.ui.ComboBox;
import com.intellij.ui.ContextHelpLabel;
import com.intellij.ui.PortField;
import com.intellij.ui.SimpleListCellRenderer;
import com.intellij.openapi.ui.ValidationInfo;
import com.intellij.ui.*;
import com.intellij.ui.components.JBCheckBox;
import com.intellij.ui.components.JBScrollPane;
import com.intellij.ui.components.JBTabbedPane;
import com.intellij.ui.components.JBTextField;
import com.intellij.ui.scale.JBUIScale;
import com.intellij.util.ui.FormBuilder;
import com.intellij.util.ui.components.BorderLayoutPanel;
Expand All @@ -29,7 +28,11 @@
import org.jetbrains.annotations.NotNull;

import javax.swing.*;
import javax.swing.event.DocumentEvent;
import javax.swing.text.JTextComponent;
import java.awt.*;
import java.util.ArrayList;
import java.util.List;

/**
* Language server panel which show information about language server in several tabs:
Expand All @@ -49,7 +52,7 @@
EDIT_EXTENSION;
}

private JBTextField serverName;
private ServerNameWidget serverName;
private EnvironmentVariablesComponent environmentVariables;
private CommandLineWidget commandLine;
private ServerMappingsPanel mappingsPanel;
Expand All @@ -61,8 +64,10 @@
private LanguageServerConfigurationWidget configurationWidget;

private LanguageServerInitializationOptionsWidget initializationOptionsWidget;
private final ValidatableDialog dialogWrapper;

public LanguageServerPanel(FormBuilder builder, JComponent description, EditionMode mode) {
public LanguageServerPanel(FormBuilder builder, JComponent description, EditionMode mode, ValidatableDialog dialogWrapper) {
this.dialogWrapper = dialogWrapper;

Check warning on line 70 in src/main/java/com/redhat/devtools/lsp4ij/settings/ui/LanguageServerPanel.java

View check run for this annotation

Codecov / codecov/patch

src/main/java/com/redhat/devtools/lsp4ij/settings/ui/LanguageServerPanel.java#L69-L70

Added lines #L69 - L70 were not covered by tests
createUI(builder, description, mode);
}

Expand All @@ -80,6 +85,16 @@
}
// Debug tab
addDebugTab(tabbedPane, mode);

Check warning on line 88 in src/main/java/com/redhat/devtools/lsp4ij/settings/ui/LanguageServerPanel.java

View check run for this annotation

Codecov / codecov/patch

src/main/java/com/redhat/devtools/lsp4ij/settings/ui/LanguageServerPanel.java#L88

Added line #L88 was not covered by tests
// Add validation
var serverNameWidget = getServerName();
if (serverNameWidget != null) {
addValidator(serverNameWidget);

Check warning on line 92 in src/main/java/com/redhat/devtools/lsp4ij/settings/ui/LanguageServerPanel.java

View check run for this annotation

Codecov / codecov/patch

src/main/java/com/redhat/devtools/lsp4ij/settings/ui/LanguageServerPanel.java#L92

Added line #L92 was not covered by tests
}
var commandLineWidget = getCommandLine();
if (commandLineWidget != null) {
addValidator(getCommandLine());

Check warning on line 96 in src/main/java/com/redhat/devtools/lsp4ij/settings/ui/LanguageServerPanel.java

View check run for this annotation

Codecov / codecov/patch

src/main/java/com/redhat/devtools/lsp4ij/settings/ui/LanguageServerPanel.java#L96

Added line #L96 was not covered by tests
}
}

private void addServerTab(JBTabbedPane tabbedPane, JComponent description, EditionMode mode) {
Expand Down Expand Up @@ -176,7 +191,7 @@
}

private void createServerNameField(FormBuilder builder) {
serverName = new JBTextField();
serverName = new ServerNameWidget();

Check warning on line 194 in src/main/java/com/redhat/devtools/lsp4ij/settings/ui/LanguageServerPanel.java

View check run for this annotation

Codecov / codecov/patch

src/main/java/com/redhat/devtools/lsp4ij/settings/ui/LanguageServerPanel.java#L194

Added line #L194 was not covered by tests
builder.addLabeledComponent(LanguageServerBundle.message("language.server.serverName"), serverName);
}

Expand All @@ -201,7 +216,7 @@
builder.addLabeledComponent(LanguageServerBundle.message("language.server.initializationOptions"), scrollPane, true);
}

public JBTextField getServerName() {
public ServerNameWidget getServerName() {
return serverName;
}

Expand Down Expand Up @@ -241,4 +256,25 @@
return errorReportingKindCombo;
}

public @NotNull List<ValidationInfo> doValidateAll() {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This method should look like this:

List<ValidationInfo> validations = new ArrayList<>();
for(var widget : validatableWidgets) {
    int previousSize = validations.size();
    widget.validate(validations);
    boolean hasErrors = previousSize ! validations.size();
   widget.updateUi(hasErrors);
}
return validations;

List<ValidationInfo> validations = new ArrayList<>();
var serverNameWidget = getServerName();

Check warning on line 261 in src/main/java/com/redhat/devtools/lsp4ij/settings/ui/LanguageServerPanel.java

View check run for this annotation

Codecov / codecov/patch

src/main/java/com/redhat/devtools/lsp4ij/settings/ui/LanguageServerPanel.java#L260-L261

Added lines #L260 - L261 were not covered by tests
MituuZ marked this conversation as resolved.
Show resolved Hide resolved
if (serverNameWidget != null) {
serverNameWidget.validate(validations);

Check warning on line 263 in src/main/java/com/redhat/devtools/lsp4ij/settings/ui/LanguageServerPanel.java

View check run for this annotation

Codecov / codecov/patch

src/main/java/com/redhat/devtools/lsp4ij/settings/ui/LanguageServerPanel.java#L263

Added line #L263 was not covered by tests
}
var commandLineWidget = getCommandLine();

Check warning on line 265 in src/main/java/com/redhat/devtools/lsp4ij/settings/ui/LanguageServerPanel.java

View check run for this annotation

Codecov / codecov/patch

src/main/java/com/redhat/devtools/lsp4ij/settings/ui/LanguageServerPanel.java#L265

Added line #L265 was not covered by tests
if (commandLineWidget != null) {
commandLineWidget.validate(validations);

Check warning on line 267 in src/main/java/com/redhat/devtools/lsp4ij/settings/ui/LanguageServerPanel.java

View check run for this annotation

Codecov / codecov/patch

src/main/java/com/redhat/devtools/lsp4ij/settings/ui/LanguageServerPanel.java#L267

Added line #L267 was not covered by tests
}
return validations;

Check warning on line 269 in src/main/java/com/redhat/devtools/lsp4ij/settings/ui/LanguageServerPanel.java

View check run for this annotation

Codecov / codecov/patch

src/main/java/com/redhat/devtools/lsp4ij/settings/ui/LanguageServerPanel.java#L269

Added line #L269 was not covered by tests
}

private void addValidator(JTextComponent textComponent) {
textComponent.getDocument().addDocumentListener(new DocumentAdapter() {

Check warning on line 273 in src/main/java/com/redhat/devtools/lsp4ij/settings/ui/LanguageServerPanel.java

View check run for this annotation

Codecov / codecov/patch

src/main/java/com/redhat/devtools/lsp4ij/settings/ui/LanguageServerPanel.java#L273

Added line #L273 was not covered by tests
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Don't do that here but in the ValidableConsoleWidget impl in the initializeValidator(ValidatableDialog dialog) method

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think addValidator should just add in a list CommandLineWidget, ServerNameWidget (list of ValidatableConsoleWidget) and in doValidateAll should just iterate from this list.

private void addValidatableWidget(@Nullable ValidatableConsoleWidget validatableWidget) {
   if (validatableWidget == null) {
      return;
   }
   validatableWidget.initializeValidator(this);
   this.validatableWidgets.add(validatableWidget)
}

@Override
protected void textChanged(@NotNull DocumentEvent e) {
dialogWrapper.refreshValidation();
}

Check warning on line 277 in src/main/java/com/redhat/devtools/lsp4ij/settings/ui/LanguageServerPanel.java

View check run for this annotation

Codecov / codecov/patch

src/main/java/com/redhat/devtools/lsp4ij/settings/ui/LanguageServerPanel.java#L276-L277

Added lines #L276 - L277 were not covered by tests
});
}

Check warning on line 279 in src/main/java/com/redhat/devtools/lsp4ij/settings/ui/LanguageServerPanel.java

View check run for this annotation

Codecov / codecov/patch

src/main/java/com/redhat/devtools/lsp4ij/settings/ui/LanguageServerPanel.java#L279

Added line #L279 was not covered by tests
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,53 @@
/*******************************************************************************
* Copyright (c) 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
* which is available at https://www.eclipse.org/legal/epl-2.0/
*
* SPDX-License-Identifier: EPL-2.0
*
* Contributors:
* Mitja Leino <[email protected]> - Initial API and implementation
*******************************************************************************/
package com.redhat.devtools.lsp4ij.settings.ui;
MituuZ marked this conversation as resolved.
Show resolved Hide resolved

import com.intellij.openapi.ui.ValidationInfo;
import com.intellij.ui.components.JBTextField;
import com.redhat.devtools.lsp4ij.LanguageServerBundle;

import javax.swing.border.Border;
import java.util.ArrayList;
import java.util.List;

/**
* Server name widget that contains the server name when creating a new LS configuration
*/
public class ServerNameWidget extends JBTextField implements ValidatableConsoleWidget {
MituuZ marked this conversation as resolved.
Show resolved Hide resolved
private final String errorMessage = LanguageServerBundle.message("new.language.server.dialog.validation.serverName.must.be.set");

Check warning on line 26 in src/main/java/com/redhat/devtools/lsp4ij/settings/ui/ServerNameWidget.java

View check run for this annotation

Codecov / codecov/patch

src/main/java/com/redhat/devtools/lsp4ij/settings/ui/ServerNameWidget.java#L26

Added line #L26 was not covered by tests
private final transient Border originalBorder;

public ServerNameWidget() {
this.originalBorder = this.getBorder();
}

Check warning on line 31 in src/main/java/com/redhat/devtools/lsp4ij/settings/ui/ServerNameWidget.java

View check run for this annotation

Codecov / codecov/patch

src/main/java/com/redhat/devtools/lsp4ij/settings/ui/ServerNameWidget.java#L29-L31

Added lines #L29 - L31 were not covered by tests

@Override
public void validate(List<ValidationInfo> validations) {
List<ValidationInfo> widgetValidations = new ArrayList<>();

Check warning on line 35 in src/main/java/com/redhat/devtools/lsp4ij/settings/ui/ServerNameWidget.java

View check run for this annotation

Codecov / codecov/patch

src/main/java/com/redhat/devtools/lsp4ij/settings/ui/ServerNameWidget.java#L35

Added line #L35 was not covered by tests

if (getDocument() != null && getText().isBlank()) {
widgetValidations.add(new ValidationInfo(errorMessage, this));

Check warning on line 38 in src/main/java/com/redhat/devtools/lsp4ij/settings/ui/ServerNameWidget.java

View check run for this annotation

Codecov / codecov/patch

src/main/java/com/redhat/devtools/lsp4ij/settings/ui/ServerNameWidget.java#L38

Added line #L38 was not covered by tests
}

if (widgetValidations.isEmpty()) {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Don't do that here, move this code in the new updateUi(boolean hasErrors) method

this.setBorder(originalBorder);

Check warning on line 42 in src/main/java/com/redhat/devtools/lsp4ij/settings/ui/ServerNameWidget.java

View check run for this annotation

Codecov / codecov/patch

src/main/java/com/redhat/devtools/lsp4ij/settings/ui/ServerNameWidget.java#L42

Added line #L42 was not covered by tests
} else {
validations.addAll(widgetValidations);
setErrorBorder(this);

Check warning on line 45 in src/main/java/com/redhat/devtools/lsp4ij/settings/ui/ServerNameWidget.java

View check run for this annotation

Codecov / codecov/patch

src/main/java/com/redhat/devtools/lsp4ij/settings/ui/ServerNameWidget.java#L44-L45

Added lines #L44 - L45 were not covered by tests
}
}

Check warning on line 47 in src/main/java/com/redhat/devtools/lsp4ij/settings/ui/ServerNameWidget.java

View check run for this annotation

Codecov / codecov/patch

src/main/java/com/redhat/devtools/lsp4ij/settings/ui/ServerNameWidget.java#L47

Added line #L47 was not covered by tests

@Override
public boolean isValid() {
return getDocument() != null && !getText().isBlank();
}
}
Loading
Loading