diff --git a/org.eclipse.lsp4xml/src/main/java/org/eclipse/lsp4xml/extensions/xsd/participants/XSDErrorCode.java b/org.eclipse.lsp4xml/src/main/java/org/eclipse/lsp4xml/extensions/xsd/participants/XSDErrorCode.java index d06108ebb..203531a9c 100644 --- a/org.eclipse.lsp4xml/src/main/java/org/eclipse/lsp4xml/extensions/xsd/participants/XSDErrorCode.java +++ b/org.eclipse.lsp4xml/src/main/java/org/eclipse/lsp4xml/extensions/xsd/participants/XSDErrorCode.java @@ -40,6 +40,7 @@ public enum XSDErrorCode implements IXMLErrorCode { s4s_att_not_allowed("s4s-att-not-allowed"), // s4s_att_invalid_value("s4s-att-invalid-value"), // s4s_elt_character("s4s-elt-character"), // + sch_props_correct_2("sch-props-correct.2"), src_ct_1("src-ct.1"), src_element_3("src-element.3"), src_resolve_4_2("src-resolve.4.2"), // @@ -128,7 +129,12 @@ public static Range toLSPRange(XMLLocator location, XSDErrorCode code, Object[] } case s4s_elt_character: return XMLPositionUtility.selectContent(offset, document); - case src_ct_1: + case sch_props_correct_2: { + String argument = (String) arguments[0]; + String attrName = argument.substring(argument.indexOf(",") + 1); + return XMLPositionUtility.selectAttributeValueFromGivenValue(attrName, offset, document); + } + case src_ct_1: return XMLPositionUtility.selectAttributeValueAt("base", offset, document); case src_resolve_4_2: { String attrValue = (String) arguments[2]; diff --git a/org.eclipse.lsp4xml/src/test/java/org/eclipse/lsp4xml/extensions/xsd/XSDValidationExtensionsTest.java b/org.eclipse.lsp4xml/src/test/java/org/eclipse/lsp4xml/extensions/xsd/XSDValidationExtensionsTest.java index 949e79e2c..57e7b238d 100644 --- a/org.eclipse.lsp4xml/src/test/java/org/eclipse/lsp4xml/extensions/xsd/XSDValidationExtensionsTest.java +++ b/org.eclipse.lsp4xml/src/test/java/org/eclipse/lsp4xml/extensions/xsd/XSDValidationExtensionsTest.java @@ -180,6 +180,16 @@ public void s4s_att_invalid_value() throws BadLocationException { d(3, 2, 3, 12, XSDErrorCode.s4s_att_must_appear)); } + @Test + public void sch_props_correct_2() throws BadLocationException { + String xml = "\r\n" + + "\r\n" + + " \r\n" + + " \r\n" + + ""; + testDiagnosticsFor(xml, d(3, 18, 3, 24, XSDErrorCode.sch_props_correct_2)); + } + @Test public void src_ct_1() throws BadLocationException { String xml = "\r\n" +