Skip to content

Commit a50708e

Browse files
committed
Fix
Task #92 - Incorrect examples in the default LSP Server configuration.
1 parent 6741db2 commit a50708e

1 file changed

Lines changed: 3 additions & 3 deletions

File tree

src/main/java/org/netbeans/modules/python/options/PythonLspServerConfigsPanel.java

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -255,20 +255,20 @@ void load() {
255255

256256
}
257257

258+
static final File settingsSchema = PythonUtility.SETTINGS_SCHEMA;
259+
static final JsonSchemaFactory factory = JsonSchemaFactory.getInstance(SpecVersion.VersionFlag.V7);
260+
258261
void store() {
259262
if (controller.isChanged()) {
260263
errroLabel.setText("");
261264
try {
262265
String jsonSettings = lspEditorPane.getText();
263266

264-
File settingsSchema = PythonUtility.SETTINGS_SCHEMA;
265267
if (settingsSchema.exists()) {
266-
JsonSchemaFactory factory = JsonSchemaFactory.getInstance(SpecVersion.VersionFlag.V7);
267268
JsonSchema jsonSchema = factory.getSchema(Files.readString(settingsSchema.toPath()));
268269
JsonNode jsonNode = new ObjectMapper().readTree(jsonSettings);
269270
Set<ValidationMessage> errors = jsonSchema.validate(jsonNode);
270271
if (!errors.isEmpty()) {
271-
errors.iterator().next().getMessage();
272272
errroLabel.setText(errors.iterator().next().getMessage());
273273
return;
274274
}

0 commit comments

Comments
 (0)