Replies: 1 comment 1 reply
-
First, you will find that TreeSitter on github appears to be specifically borked, probably on purpose. No one screws up that bad normally. For Textual, you should use There are three components to tree-sitter:
If you can run a command like You should ignore the current github repository for You will find the "query" system truly stupid and un-pythonic. You might like this terrible hack for ideas.
|
Beta Was this translation helpful? Give feedback.
-
I have tried to install tree-sitter-org, but not getting anywhere
This is what I've been trying:
from tree_sitter_languages import get_language
org_language = get_language("org")
org_highlight_query = (Path(__file__).parent "highlights.scm").read_text()
TextArea.register_language(org_language, org_highlight_query)
and
`code_view.language = "org"'
code_view is a TextArea.code_editor, treesitter and syntax are installed, pretty sure the files are where they are meant to be (the error output pointed me right to where I cloned tree-sitter-org too and the file is there (highlights.scm)
I'd tried setting language before using treesitter languages, to "org" but that complained and I cannot find a list of built-in languages anywhere, I don't imagine org is among them but was worth a try
I'm missing something obvious I'm sure, but still too new to python
this is what i get so far, everything else works fine without the code above
Traceback (most recent call last): File "/acs/0.4.1/acs.py", line 17, in <module> org_language = get_language("org") ^^^^^^^^^^^^^^^^^^^ File "tree_sitter_languages/core.pyx", line 14, in tree_sitter_\ languages.core.get_language File "/acs/py//lib/python3.12/site-packages/tree_sitter/__init_\ _.py", line 132, in __init__ language_function: Callable[[], c_void_p] = getattr(self.lib,\ "tree_sitter_%s" % name) ^^^^^^^^^^^^^^^^^\ ^^^^^^^^^^^^^^^^^^^^^^^^^ File "/usr/lib/python3.12/ctypes/__init__.py", line 392, in __g\ etattr__ func = self.__getitem__(name) ^^^^^^^^^^^^^^^^^^^^^^ File "/usr/lib/python3.12/ctypes/__init__.py", line 397, in __g\ etitem__ func = self._FuncPtr((name_or_ordinal, self)) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ AttributeError: /acs/py/lib/python3.12/site-packages/tree_sitter_\ languages/languages.so: undefined symbol: tree_sitter_org
Beta Was this translation helpful? Give feedback.
All reactions