Skip to content

feat(languages): add solidity support #141

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

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

sambacha
Copy link

No description provided.

@sambacha sambacha requested a review from andrewtbiehl as a code owner March 27, 2024 07:27
@andrewtbiehl
Copy link
Owner

Hi, thanks for your contribution!

I just want to clarify a couple things related to this suggested addition to the codebase so that we are on the same page about what it would achieve.

First, as you can probably guess, this single new line wouldn't add "support" per se for highlighting the Solidity language. Rather, the hash table being modified merely provides a way of associating Tree-sitter language scopes with Rouge-based language identifiers so that either method of identifying the language may be used.

Fortunately, this plugin technically already supports highlighting any language for which a Tree-sitter language parser has been developed. As you may know, in contrast to many highlighters (including Rouge), Tree-sitter's approach to language parsing/highlighting support is decentralized, in that anyone can develop a Tree-sitter-compatible parser for any language and use it in tandem with the core tool on their own. And, as this library is essentially just a wrapper for Tree-sitter, such functionality extends to this library as well.

So, if you would like to highlight Solidity code using this library, no actual code change here is necessary. However, you will need to find an existing Tree-sitter language parser library for the language (or else develop your own).

It looks like this is currently the most popular publicly available Tree-sitter parser library for Solidity (on GitHub, at least). This particular library does not currently use 'source.solidity' as its Tree-sitter language scope, so the suggested change will not prove helpful as is if you intend to use this particular library.

Hopefully this clears a few things up, but please let me know if you have any questions. Otherwise, with the above context in mind, if you could elaborate on what you want this change to accomplish, that would help me determine whether it makes sense to merge.

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.

2 participants