You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
To support validation correctly, we should have a "master" which shows a list of errors (one for Server Configuration, one for Client Configuration, etc) and have a link which select the proper tab and the proper UI widget.
We should disable also the Save action.
@SCWells72 have you some idea how to implement that?
@SCWells72 have you some idea how to implement that?
When that happens in the context of a Configurable, the apply() method can throw ConfigurationException if there are issues with the configuration to be applied. So, for example, LanguageServerConfigurable#apply() should ask its consistituent components to validate themselves. Since these same components are used in the tool window, the save action could take the same approach, catching a thrown ConfigurationException and highlighting the errant component, in this case, the JsonTextField that contains invalid JSON.
UPDATE: I forgot that ConfigurationException doesn't know about the specific JComponent for which a validation error was raised. That's DialogWrapper#doValidateAll(). But the same concept holds of having each major panel perform its own validation, and have the larger tabbed panel collect validation errors from the contained panels and show them if present instead of saving, or in the case of LanguageServerConfigurable, it would throw a ConfigurationException with the validation errors.
If you write some invalid json in the LS config editor, the error is shown, but the configuration can still be applied/saved:
The text was updated successfully, but these errors were encountered: