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

TextArea with language="sql" raises an exception #5541

Open
ihabunek opened this issue Feb 16, 2025 · 6 comments
Open

TextArea with language="sql" raises an exception #5541

ihabunek opened this issue Feb 16, 2025 · 6 comments

Comments

@ihabunek
Copy link

ihabunek commented Feb 16, 2025

Setting TextArea language to sql causes an exception:

ValueError: Incompatible Language version 15. Must be between 13 and 14

To reproduce:

from textual.app import App, ComposeResult
from textual.widgets import TextArea


class BugApp(App):
    def compose(self) -> ComposeResult:
        yield TextArea(language="sql")


if __name__ == "__main__":
    app = BugApp()
    app.run()

Textual Diagnostics

Versions

Name Value
Textual 2.0.1
Rich 13.9.4

Python

Name Value
Version 3.12.8
Implementation CPython
Compiler GCC 14.2.1 20240912 (Red Hat 14.2.1-3)
Executable /home/ihabunek/projects/ihabunek/pgtui/.venv/bin/python

Operating System

Name Value
System Linux
Release 6.12.7-100.fc40.x86_64
Version #1 SMP PREEMPT_DYNAMIC Fri Dec 27 17:00:45 UTC 2024

Terminal

Name Value
Terminal Application Kitty
TERM xterm-kitty
COLORTERM truecolor
FORCE_COLOR Not set
NO_COLOR Not set

Rich Console options

Name Value
size width=182, height=48
legacy_windows False
min_width 1
max_width 182
is_terminal False
encoding utf-8
max_height 48
justify None
overflow None
no_wrap False
highlight None
markup None
height None
Copy link

We found the following entry in the FAQ which you may find helpful:

Feel free to close this issue if you found an answer in the FAQ. Otherwise, please give us a little time to review.

This is an automated reply, generated by FAQtory

@dominikgehl
Copy link

@ihabunek I was unable to reproduce the issue on MacOS (tested with both python 3.12 and 3.13)

@ihabunek
Copy link
Author

I tried it on two computers but I only have linux. Here's how I run the program:

python -m venv .venv
source .venv/bin/activate.fish
pip install "textual[syntax]"
vim bug.py  # enter program
python bug.py

Here are installed lib versions:

linkify-it-py==2.0.3
markdown-it-py==3.0.0
mdit-py-plugins==0.4.2
mdurl==0.1.2
platformdirs==4.3.6
Pygments==2.19.1
rich==13.9.4
textual==2.0.1
tree-sitter==0.24.0
tree-sitter-bash==0.23.3
tree-sitter-css==0.23.2
tree-sitter-go==0.23.4
tree-sitter-html==0.23.2
tree-sitter-java==0.23.5
tree-sitter-javascript==0.23.1
tree-sitter-json==0.24.8
tree-sitter-markdown==0.3.2
tree-sitter-python==0.23.6
tree-sitter-regex==0.24.3
tree-sitter-rust==0.23.2
tree-sitter-sql==0.3.8
tree-sitter-toml==0.7.0
tree-sitter-xml==0.7.0
tree-sitter-yaml==0.7.0
typing_extensions==4.12.2
uc-micro-py==1.0.3

@dominikgehl
Copy link

Seems to be linked to installing textual[syntax] instead of installing textual

@dominikgehl
Copy link

@ihabunek Could you test downgrading tree-sitter-sql to 0.3.7 ? For me that solves the issue ...

@ihabunek
Copy link
Author

That fixes it, thanks.

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

No branches or pull requests

2 participants