termux-language-server icon indicating copy to clipboard operation
termux-language-server copied to clipboard

not working on Manjaro

Open kemelzaidan opened this issue 1 year ago • 4 comments

When trying to run termux-language-server or termux-language-server --convert PKGBUILD the app does not work and in both cases present the following error:

Traceback (most recent call last):
  File "/usr/sbin/termux-language-server", line 8, in <module>
    sys.exit(main())
             ^^^^^^
  File "/usr/lib/python3.12/site-packages/termux_language_server/__main__.py", line 87, in main
    from .finders import DIAGNOSTICS_FINDER_CLASSES, FORMAT_FINDER_CLASSES
  File "/usr/lib/python3.12/site-packages/termux_language_server/finders.py", line 28, in <module>
    from .utils import get_query, get_schema
  File "/usr/lib/python3.12/site-packages/termux_language_server/utils.py", line 18, in <module>
    parser.set_language(language)
    ^^^^^^^^^^^^^^^^^^^
AttributeError: 'tree_sitter.Parser' object has no attribute 'set_language'

I'm on Manjaro using version 0.0.25

kemelzaidan avatar Oct 01 '24 20:10 kemelzaidan

What is your python-tree-sitter version? Looks like https://github.com/Freed-Wu/autotools-language-server/issues/11

Freed-Wu avatar Oct 02 '24 07:10 Freed-Wu

Humm... the arch package list 2 python-tree-sitter dependencies:

  1. python-tree-sitter-bash: 0.21.0
  2. python-lsp-tree-sitter: 0.0.16

python-tree-sitter which is a dependency of the first one is on version 0.23.0.

kemelzaidan avatar Oct 02 '24 20:10 kemelzaidan

That's bound to happen with AUR packages on Manjaro.

AUR package builds are written to work with up to date dependencies from the Arch repos.

Manjaro arbitrarily holding back packages by 2 weeks for "stability" tends to break AUR builds expecting up to date versions of dependencies.

Manjaro does not officially support the AUR for this exact reason. Though they do still recklessly recommend it regardless.

The bug here is Manjaro.

TomJo2000 avatar Oct 02 '24 20:10 TomJo2000

Thanks for that. I'll try to move to main Arch as soon as possible.

kemelzaidan avatar Oct 02 '24 21:10 kemelzaidan

Hi, I think the reason this happens is that python-tree-sitter removed the set_language method in its newest release: https://github.com/tree-sitter/py-tree-sitter/releases/tag/v0.23.0 Downgrading to 0.22.3 fixes the issue, it's just that termux-language-server is not yet compatible with 0.23.0.

Side note: this has nothing to do with Manjaro as python-tree-sitter is an AUR package and not an Arch repo dependency. I'm using Arch and the same problem appears.

syyyr avatar Oct 04 '24 14:10 syyyr

Hi, I think the reason this happens is that python-tree-sitter removed the set_language method in its newest release: https://github.com/tree-sitter/py-tree-sitter/releases/tag/v0.23.0 Downgrading to 0.22.3 fixes the issue, it's just that termux-language-server is not yet compatible with 0.23.0.

Side note: this has nothing to do with Manjaro as python-tree-sitter is an AUR package and not an Arch repo dependency. I'm using Arch and the same problem appears.

They seemed to have released a fix for that just about 2 hours ago, and it's available on AUR already: https://github.com/termux/termux-language-server/releases/tag/0.0.26. I'll report here if that doesn't work.

Thanks @syyyr

kemelzaidan avatar Oct 04 '24 18:10 kemelzaidan