Search in sources :

Example 1 with SDocNode

use of org.springframework.ide.vscode.commons.yaml.structure.YamlStructureParser.SDocNode in project sts4 by spring-projects.

the class YamlStructureParserTest method assertFirstRealChild.

private void assertFirstRealChild(MockYamlEditor editor, String testNodeName, String expectedNodeSnippet) throws Exception {
    SDocNode doc = getOnlyDocument(editor.parseStructure());
    SKeyNode testNode = doc.getChildWithKey(testNodeName);
    assertNotNull(testNode);
    SNode expected = null;
    if (expectedNodeSnippet != null) {
        int offset = editor.getRawText().indexOf(expectedNodeSnippet);
        expected = doc.find(offset);
        assertTrue(editor.textUnder(expected).contains(expectedNodeSnippet));
    }
    assertEquals(expected, testNode.getFirstRealChild());
}
Also used : SKeyNode(org.springframework.ide.vscode.commons.yaml.structure.YamlStructureParser.SKeyNode) SNode(org.springframework.ide.vscode.commons.yaml.structure.YamlStructureParser.SNode) SDocNode(org.springframework.ide.vscode.commons.yaml.structure.YamlStructureParser.SDocNode)

Aggregations

SDocNode (org.springframework.ide.vscode.commons.yaml.structure.YamlStructureParser.SDocNode)1 SKeyNode (org.springframework.ide.vscode.commons.yaml.structure.YamlStructureParser.SKeyNode)1 SNode (org.springframework.ide.vscode.commons.yaml.structure.YamlStructureParser.SNode)1