anitnilay20 / anitnilay20/thoth

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

Aperta
#153 0 commenti 0 reazioni 0 assegnatari Vedi su GitHub
feature future priority:low size:large
Lingua principale
Rust
Stelle
70
Fork
5
Merge medio
10h 33m
PR unite (30g)
2

Descrizione

## 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.

Guida per i contributori

Nessuna guida per i contributori indicizzata per questo repository

Valutazione

Questa issue non è ancora stata valutata.

Ricevi le nuove issue nella tua casella

Un breve riepilogo di issue GitHub adatte ai principianti.