tree-sitter / tree-sitter/tree-sitter-cpp
feature: parameter highlighting?
Nobody has claimed this yet.
- Dominant language
- JavaScript
- Stars
- 453
- Forks
- 185
- PR merge metrics
- No merged PRs in 30d
Description
Did you check the tree-sitter docs?
- I have read all the tree-sitter docs if it relates to using the parser
Is your feature request related to a problem? Please describe.
Hi, I'm not very knowledgeable about treesitter so please bear with me if this is in wrong place.
I am trying to understand why/how I could get highlighting to work with parameters inside functions.
Here's a simple example:
int a, b;
void foo(int c) {
auto g = a * c;
}
In this snippet, I would expect c within the function to have variable.parameter (or similar, I do not know the proper language) value.
So I could have all parameters same color in Helix for example.
Describe the solution you'd like
If it's at all possible, give any variable that is a parameter of a function a variable.parameter value, so that it can be colored in highlighters.
Describe alternatives you've considered
Living without it..? :'D
Additional context
Again sorry if I'm in wrong place and being bothersome, I suspect this has come across before too but I could not find any relevant issues, maybe my searching skills fail me.
Contributor guide
No contributing guide indexed for this repository
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start with the linked tree-sitter parser documentation and the C++ example in the issue; no source file or test is named. Investigate how parameter highlighting is represented for this grammar, then verify that function parameters receive a variable.parameter-like capture and can be colored by a highlighter such as Helix.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- cpp
- Domain
- compilers
- Issue type
- Feature
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Quiet
- Clarity
- Mostly clear
- Newbie friendliness
- 48/100