Undo the changes that show missing toplevel property at end of file

This commit is contained in:
Kris De Volder
2017-04-03 16:59:14 -07:00
parent 5de3963e91
commit d56937591c
4 changed files with 1 additions and 27 deletions

View File

@@ -282,13 +282,4 @@ public class DocumentRegion implements CharSequence {
}
return false;
}
/**
* Create a document region of lenght 0 at the every end of the document.
*/
public static DocumentRegion endOf(IDocument doc) {
DocumentRegion trimmedDoc = new DocumentRegion(doc).trimEnd();
return new DocumentRegion(doc, trimmedDoc.getLength(), trimmedDoc.getLength());
}
}

View File

@@ -123,8 +123,6 @@ public class YamlSchemaProblems {
return problem(MISSING_PROPERTY, msg, underline);
}
}
} else if (parent==null) {
return problem(MISSING_PROPERTY, msg, DocumentRegion.endOf(doc));
}
return problem(MISSING_PROPERTY, msg, map);
}

View File

@@ -618,16 +618,4 @@ public class Editor {
public String getLanguageId() {
return languageId;
}
/**
* Verifies that a given Range corresponds with the end of the document in the editor.
*/
public void assertIsEndOfFile(Range range) {
int documentLen = document.getText().length();
int start = document.toOffset(range.getStart());
int end = document.toOffset(range.getEnd());
assertEquals(documentLen, start);
assertEquals(documentLen, end);
}
}

View File

@@ -2268,10 +2268,7 @@ public class ConcourseEditorTest {
editor = harness.newEditor(LanguageIds.CONCOURSE_TASK,
"image: some-image"
);
List<Diagnostic> problems = editor.assertProblems("|[platform, run] are required");
for (Diagnostic p : problems) {
editor.assertIsEndOfFile(p.getRange());
}
editor.assertProblems("image: some-image|[platform, run] are required");
editor = harness.newEditor(LanguageIds.CONCOURSE_TASK,
"platform: a-platform\n" +