Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add Tree-sitter support for advanced highlighting #455

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

tomlin7
Copy link
Owner

@tomlin7 tomlin7 commented Nov 4, 2024

Fixes #398

Add Tree-sitter support for advanced syntax highlighting for Python files.

  • Tree-sitter for Python built-in
  • Tree-sitter and Pygments as a fallback.

Fixes #398

Add Tree-sitter support for advanced syntax highlighting for Python files.

* **New File**: `src/biscuit/editor/text/treesitter.py`
  - Implement Tree-sitter highlighter for Python files.
  - Load language library and extract highlight information from the syntax tree.

* **Update**: `src/biscuit/editor/text/highlighter.py`
  - Import and initialize Tree-sitter highlighter for Python files.
  - Add methods to highlight text content using Tree-sitter and Pygments as a fallback.

* **Update**: `src/biscuit/editor/editor.py`
  - Import the Highlighter class.

* **Update**: `README.md`
  - Add documentation for Tree-sitter highlighter and Pygments fallback.

---

For more details, open the [Copilot Workspace session](https://copilot-workspace.githubnext.com/tomlin7/biscuit/issues/398?shareId=XXXX-XXXX-XXXX-XXXX).
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Adding tree-sitter support for advanced highlighting
1 participant