-
-
Notifications
You must be signed in to change notification settings - Fork 2.5k
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
Initial Ada language support #7791
Conversation
Tree-Sitter grammar and queries from: https://github.com/briot/tree-sitter-ada Language server from: https://github.com/AdaCore/ada_language_server Ada build tool: https://alire.ada.dev
☝️ @briot ty for the grammar! Any ideas how to add the indent queries as well? |
What's the compile time on this? We had to drop the old tree-sitter-ada grammar that was under the official tree-sitter org because it took too long to compile and had various issues. |
@archseer I’ve no idea TBH. How can I check this? |
I just did a quick check:
cargo clean
❯ time cargo build
Compiling memchr v2.5.0
Compiling cc v1.0.73
Compiling regex-syntax v0.6.27
Compiling tree-sitter v0.20.9
Compiling tree-sitter-ada v0.0.1 (/home/briot/tree-sitter-ada)
Compiling aho-corasick v0.7.19
Compiling regex v1.6.0
Finished dev [unoptimized + debuginfo] target(s) in 3.14s
cargo build 10.27s user 1.09s system 357% cpu 3.179 total
So 3s total, when all packages have been downloaded already (and these
are dependencies
from tree-sitter itself, so would apply to all languages that you want
to support).
I have not investigated the indentation queries (not sure that neovim,
which is my editor
of choice) supports them properly yet.
Emmanuel
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The links to nvim documentation should also be removed, that could be confusing for anyone reading the files
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The captures here should be adjusted to the ones that Helix uses: https://docs.helix-editor.com/master/themes.html#syntax-highlighting
For example @conditional
should become @keyword.control.conditional
, @number
should become @constant.numeric
, etc.
runtime/queries/ada/locals.scm
Outdated
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The captures here should follow tree-sitter's locals capture names: @local.scope
, @local.reference
and @local.definition
https://tree-sitter.github.io/tree-sitter/syntax-highlighting#local-variables
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Oh, I don't think I know that much, or anything really, about Tree Sitter to do that properly. I need to do some reading and find some time to do it. Unless there is someone else willing to chip in.
runtime/queries/ada/textobjects.scm
Outdated
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
See the textobjects docs, Helix has a different set of textobject captures than nvim: https://docs.helix-editor.com/master/guides/textobject.html
Looking at the state counts in the parser.c, this grammar seems larger than average but not as huge as something like tree-sitter-elixir. On-disk I see the so as 327kb and the compilation time of |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Running cargo xtask docgen
and committing the changes will fix the docs CI
Co-authored-by: Michael Davis <mcarsondavis@gmail.com>
Would this PR also take into consideration .gpr file support with ada language-server running with |
closed by #9908 |
Tree-Sitter grammar and queries from: https://github.com/briot/tree-sitter-ada
Language server from: https://github.com/AdaCore/ada_language_server
Ada build tool: https://alire.ada.dev