Skip to content

feat(loader): implement language_for_configuration#3816

Merged
amaanq merged 1 commit intotree-sitter:masterfrom
bm-w:bm-w/loader-language-for-configuration
Nov 9, 2024
Merged

feat(loader): implement language_for_configuration#3816
amaanq merged 1 commit intotree-sitter:masterfrom
bm-w:bm-w/loader-language-for-configuration

Conversation

@bm-w
Copy link
Contributor

@bm-w bm-w commented Oct 22, 2024

While diagnosing a breaking change introduced by v0.24 (specifically #3700; I left a comment there), I found that there is actually no way to directly load a Language from a given LanguageConfiguration (such as one returned from Loader::get_all_language_configurations). This PR trivially remedies that.

@ObserverOfTime ObserverOfTime changed the title Loader::language_for_configuration. feat(loader): implement language_for_configuration Oct 22, 2024
@bm-w bm-w force-pushed the bm-w/loader-language-for-configuration branch from c3e962e to 7add73a Compare October 22, 2024 12:21
@ObserverOfTime ObserverOfTime changed the base branch from release-0.24 to master October 23, 2024 05:37
@amaanq
Copy link
Member

amaanq commented Oct 26, 2024

What's the use case for this? It sounds like whatever grammar(s) you're using should be migrating to the new config

@bm-w
Copy link
Contributor Author

bm-w commented Oct 26, 2024

Yes, they should, and maybe they could, and I wish that they would, but if wishes were horses then beggars would ride, and all that. In the meantime something as trivial as this would help cross a few gaps. In my particular case I’m stuck on some older grammars that I don’t control, and while forking is an option it’d be nice if there was a single simple solution such as the one I’m proposing.

@tree-sitter-ci-bot
Copy link

Successfully created backport PR for release-0.24:

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.

Consider adding backwards compatibility to tree-sitter-loader for loading older grammars where the metadata is in package.json

3 participants