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

fix: handle missing tree-sitter-language binaries #4046

Merged
merged 1 commit into from
Jan 22, 2024

Conversation

tconbeer
Copy link
Contributor

@tconbeer tconbeer commented Jan 18, 2024

Please review the following checklist.

  • Docstrings on all new or modified functions / classes
  • Updated documentation
  • Updated CHANGELOG.md (where appropriate)

Closes #4045

I don't think new documentation is necessary. Happy to provide if you disagree.

@davep
Copy link
Contributor

davep commented Jan 20, 2024

I've not looked to see if it is affected or not, but note that #3933 is close to being merged and has a lot of changes to all things TextArea; so keep in mind that this might get held back for a wee while until that's merged, or perhaps run this by @darrenburns as a small addition there (there is also a followup PR to come that will make some other QoL changes to TextArea, so it might make sense that it rolls into that).

@tconbeer
Copy link
Contributor Author

Thanks, Dave. I'm fine if this waits on the other PR, although a quick scan through the changes didn't reveal any obvious conflicts

@darrenburns
Copy link
Member

Strange - this doesn't happen for me if I uninstall tree-sitter-languages. The functionality is supposed to degrade with a logged warning in the console:

image

The intention is that the constructor of SyntaxAwareDocument shouldn't even be called if tree-sitter-languages is unavailable (I would expect TREE_SITTER to be False on the line shown below, which results in a plain Document being created).

if TREE_SITTER and language:

TREE_SITTER = False

So it seems the binaries can be installed and then fail in some environments?

I don't understand the root cause, but I think handling this error is still a good call regardless.

@darrenburns
Copy link
Member

Ah, I think I understand now. So the tree-sitter-languages package on Conda is broken such that the package is available, but doesn't actually contain the required binaries... I think? So, installation of tree-sitter-languages succeeds, but it's essentially an empty package 😄

@willmcgugan willmcgugan merged commit 9f43d30 into Textualize:main Jan 22, 2024
20 checks passed
@willmcgugan
Copy link
Collaborator

Thanks @tconbeer !

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.

TextArea should handle missing tree-sitter-languages binaries
4 participants