Deal better with anchors and references in outline

See: https://github.com/spring-projects/sts4/issues/483

Signed-off-by: Kris De Volder <kdevolder@pivotal.io>
This commit is contained in:
Kris De Volder
2020-11-13 16:28:26 -08:00
parent 4e8e3e59a6
commit 2a02e28d85
5 changed files with 91 additions and 10 deletions

View File

@@ -27,6 +27,7 @@ import java.util.stream.Collectors;
import org.eclipse.lsp4j.CompletionItem;
import org.eclipse.lsp4j.Diagnostic;
import org.eclipse.lsp4j.DiagnosticSeverity;
import org.eclipse.lsp4j.DocumentSymbol;
import org.eclipse.lsp4j.InsertTextFormat;
import org.junit.Before;
import org.junit.Ignore;
@@ -240,6 +241,31 @@ public class ConcourseEditorTest {
InputStream stream = ConcourseEditorTest.class.getClassLoader().getResourceAsStream(resourceName);
return IOUtil.toString(stream);
}
@Test
public void outlineWithAnchors() throws Exception {
harness.enableHierarchicalDocumentSymbols(true);
//See: https://github.com/spring-projects/sts4/issues/483
Editor editor = harness.newEditor(
"def: &stuff\n" +
" name: git\n" +
" type: git\n" +
" source:\n" +
" uri: \n" +
"resources:\n" +
"- <<: *stuff\n" +
"- name: git2\n" +
" type: git\n" +
" source:\n" +
" uri: git@github.com:kdvolder/7zip.git"
);
editor.assertHierarchicalDocumentSymbols(
"resources::Resources\n" +
" git::Resource\n" +
" git2::Resource\n"
);
}
@Test
public void reconcileStructuralProblems() throws Exception {