zed icon indicating copy to clipboard operation
zed copied to clipboard

Add Solidity syntax support

Open meetmangukiya opened this issue 1 year ago • 8 comments

Release Notes:

  • Added solidity syntax support #4872.

meetmangukiya avatar Jan 27 '24 08:01 meetmangukiya

We require contributors to sign our Contributor License Agreement, and we don't have @meetmangukiya on file. You can sign our CLA at https://zed.dev/cla. Once you've signed, post a comment here that says '@cla-bot check'.

cla-bot[bot] avatar Jan 27 '24 08:01 cla-bot[bot]

@cla-bot check

meetmangukiya avatar Jan 27 '24 08:01 meetmangukiya

The cla-bot has been summoned, and re-checked this pull request!

cla-bot[bot] avatar Jan 27 '24 08:01 cla-bot[bot]

Is there any specification on indents.scm queries and how they are used? I couldn't get struct declaration to indent properly. Others seem alright.

meetmangukiya avatar Jan 27 '24 08:01 meetmangukiya

the recently merged Zig support PR could be useful:

https://github.com/zed-industries/zed/pull/6690

ThatXliner avatar Jan 27 '24 16:01 ThatXliner

Here's another Solidity tree-sitter repo that might help you build the queries. Look in the queries/ dir.

alvgaona avatar Jan 28 '24 19:01 alvgaona

Here's another Solidity tree-sitter repo that might help you build the queries. Look in the queries/ dir.

I see the repo you added in the TOML file is a fork from the one I suggested here. Why are you using a fork and not the original?

alvgaona avatar Jan 28 '24 19:01 alvgaona

Yeah it doesn't have indents query.

I had to fork it because tree-sitter version was incompatible and I didn't think that PRing that upstream just for zed made sense. I believe many of them in Cargo.toml are already forks for similar reasons.

meetmangukiya avatar Jan 28 '24 23:01 meetmangukiya

Hello, and sorry for coming up with a slightly delayed response: there's a lot of going on and we needed to push on a PR to make this more justified.

We seem to be close to provide a generic way to add a tree-sitter grammar support: https://github.com/zed-industries/zed/pull/7105

We want to avoid collecting support for all possible languages in the Zed source tree, since neither we're able to properly check if the support is good or not, nor the compile times and other things will be convenient. So, now we try to close syntax-related language support PRs, and even some "rare" LSP support PRs too: https://github.com/zed-industries/zed/pull/7094#issuecomment-1917805704 https://github.com/zed-industries/zed/pull/7010#issuecomment-1917570899

This one falls into the category of the language highlight, so we'll close that, but hopefully will be able to provide a better, more generic way to add Solidity highlights in Zed.

SomeoneToIgnore avatar Jan 30 '24 20:01 SomeoneToIgnore