anitnilay20 / anitnilay20/thoth

[Future] Tree-sitter: general-purpose code file viewer with syntax highlighting

Abierto
#153 0 comentarios 0 reacciones 0 asignados Ver en GitHub
feature future priority:low size:large
Lenguaje dominante
Rust
Estrellas
70
Forks
5
Merge medio
10 h 33 min
PR fusionados (30 d)
2

Descripción

## Idea

Use [tree-sitter](https://tree-sitter.github.io/) as the foundation for making Thoth a capable viewer for source code files — not just data files. Tree-sitter provides incremental parsing and syntax highlighting for virtually every language via its grammar ecosystem.

## What this unlocks

Opening non-data files in Thoth today shows raw text. With tree-sitter:

- `schema.sql` → SQL syntax highlighting, keyword colouring, folding
- `config.yaml` / `config.toml` → structure-aware highlighting and folding
- `main.rs`, `app.py`, `index.ts` → full language highlighting
- Any language with a tree-sitter grammar works without additional code

## What this is NOT

Context-aware SQL completion in the query editor (issue #149) does **not** need tree-sitter. That uses `sqlparser-rs` (pure Rust, no C) to parse partial SQL and consult `FileQueryEngine::schema()` for completions — a much lighter approach.

Tree-sitter is the right call only if Thoth expands scope to become a general code file viewer across arbitrary languages. That is a separate product decision.

## Considerations before committing

- Tree-sitter is a C library — adds FFI complexity and cross-compilation burden
- Each language grammar is a separate compiled artifact to bundle
- Binary size impact from bundled grammars
- Decide whether Thoth's scope includes code files or remains data-focused

## Parking here

Not prioritised. Revisit if there is clear user demand for code file viewing beyond what the current plain-text fallback provides.

Guía de contribución

No hay ninguna guía de contribución indexada para este repositorio

Evaluación

Este issue todavía no se ha evaluado.

Recibe los nuevos issues en tu correo

Un resumen breve de issues de GitHub para principiantes.