Skip to content

Commit

Permalink
Fix generate schema code action file name
Browse files Browse the repository at this point in the history
Signed-off-by: David Kwon <dakwon@redhat.com>
  • Loading branch information
dkwon17 authored and fbricon committed Jul 6, 2020
1 parent 538b96e commit e2886ba
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 6 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,7 @@ private String getPathFromDiagnostic(Diagnostic diagnostic) {
String message = diagnostic.getMessage();
int startIndex = message.indexOf(FILE_SCHEME);
if (startIndex != -1) {
int endIndex = message.indexOf("'", startIndex + 1);
int endIndex = message.lastIndexOf("'");
return message.substring(startIndex + FILE_SCHEME.length(), endIndex);
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -683,11 +683,11 @@ public void testTargetNamespace_2SingleQuotes() throws Exception {
public void localSchemaFileMissingCodeAction() throws Exception {
String xml = "<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n" + //
"<invoice xmlns:xsi=\"http://www.w3.org/2001/XMLSchema-instance\"\n" + //
" xsi:noNamespaceSchemaLocation=\"/salad.xsd\">\n" + //
" xsi:noNamespaceSchemaLocation=\"/sala'd.xsd\">\n" + //
"</invoice>";
Diagnostic missingSchemaDiagnostic = d(2, 32, 44, XMLSchemaErrorCode.schema_reference_4);
Diagnostic missingSchemaDiagnostic = d(2, 32, 45, XMLSchemaErrorCode.schema_reference_4);
missingSchemaDiagnostic.setMessage("schema_reference.4: Failed to read schema document "
+ "'file:///salad.xsd',"
+ "'file:///sala'd.xsd',"
+ " because 1) could not find the document; 2) the document could not be read;"
+ " 3) the root element of the document is not <xsd:schema>.");
Diagnostic eltDiagnostic = d(1, 1, 8, XMLSchemaErrorCode.cvc_elt_1_a);
Expand All @@ -705,8 +705,8 @@ public void localSchemaFileMissingCodeAction() throws Exception {
missingSchemaDiagnostic, //
settings, //
ca(missingSchemaDiagnostic, //
createFile("file:///salad.xsd", false), //
teOp("file:///salad.xsd", 0, 0, 0, 0, //
createFile("file:///sala'd.xsd", false), //
teOp("file:///sala'd.xsd", 0, 0, 0, 0, //
"<?xml version=\"1.0\" encoding=\"UTF-8\"?>" + lineSeparator() + //
"<xs:schema xmlns:xs=\"http://www.w3.org/2001/XMLSchema\">" + lineSeparator() + //
" <xs:element name=\"invoice\" type=\"xs:string\" />" + lineSeparator() + //
Expand Down

0 comments on commit e2886ba

Please sign in to comment.