feat(tree-sitter, views): initialize AST on focus and emit source view creation event

- Add set_ast helper to centralize Tree-sitter parsing logic
- Parse and attach AST on FocusedViewEvent and TextChangedEvent
- Request file from buffer on view focus before parsing
- Fix parser guard condition in get_parser (handle missing language properly)

- Emit CreatedSourceViewEvent when a new source view is added
- Register CreatedSourceViewEvent in DTO exports

- Update TODO:
  - Remove completed collapsible code blocks task
  - Add fix note for code block icon desync issue

chore:
- Add scaffolding for code_fold UI plugin
- Add created_source_view_event DTO
This commit is contained in:
2026-03-29 03:09:43 -05:00
parent dc2997ec16
commit 62a866d9bb
14 changed files with 349 additions and 13 deletions

View File

@@ -48,7 +48,7 @@ def get_parser(lang_name: str) -> Parser | None:
language = LANGUAGES[lang_name]
if not language in LANGUAGES: return
if not language: return
parser = Parser()
parser.language = language