lsp: Add document outline

This commit is contained in:
James Westman 2023-07-23 21:11:00 -05:00
parent 950b141d26
commit e087aeb44f
24 changed files with 469 additions and 28 deletions

View file

@ -30,7 +30,8 @@ def parse(
"""Parses a list of tokens into an abstract syntax tree."""
try:
ctx = ParseContext(tokens)
original_text = tokens[0].string if len(tokens) else ""
ctx = ParseContext(tokens, original_text)
AnyOf(UI).parse(ctx)
ast_node = ctx.last_group.to_ast() if ctx.last_group else None