Repository navigation
fix(lang): track Solidity modifier invocations as decorators - #2090
Conversation
Signed-off-by: Sanskar gupta <sg3427195@gmail.com>
|
Thanks for opening this — it has been seen, and it is queued. This note is automated, but it is not a brush-off: it exists so you know where your PR stands instead of having to guess from silence. Current review status: working through a backlog. What that means for this PR, concretely:
Things that will genuinely speed it up whenever review does happen:
If this fixes a bug, a reproduction we can run is worth more than a description of the symptom. Thanks for contributing, and sorry in advance for the wait. |
|
The issue specifically requested Verified using |
|
Thank you for working within the existing C/tree-sitter Solidity path and clarifying the modifier-invocation scope. We need more time to review the extraction semantics and their regression coverage before giving a decision. The review queue is currently full, so detailed feedback may take a little time. We are working through it carefully and appreciate the work you have put into supporting the project. Thank you for your patience. |
|
Here is the review this was waiting on since 2026-09-09. Eleven days for a two-line change is too long, and I am sorry. First, the judgement call you made was the right one and I want to endorse it explicitly. The issue asked for The change itself reads correctly: What I need before merging is a regression test, and it is the one thing the maintainer note from 2026-09-09 was circling. Right now nothing pins this behaviour. I checked: The shape to follow already exists next door — pragma solidity ^0.8.0;
contract Vault {
modifier onlyOwner() { _; }
function withdraw() public onlyOwner { }
}asserting that No rush and no pressure on timing. Push the test and I will review promptly — the table change itself is already settled as far as I am concerned. |
|
Pushed the regression test (7036c4d) — Verified: reverting the table entry (solidity_decorator_types → empty_types) makes it fail with |
Signed-off-by: Sanskar gupta <sg3427195@gmail.com>
|
Thank you — the regression test is exactly what was asked for, and saying how you proved it (table entry reverted, The twelve red legs on this head are ours, not yours. Every one of them fails on the same test, which has nothing to do with Solidity: That test asserted a JSON field without asking the tool for JSON; it was fixed on Next steps are mine: a local build of the merge result with the extraction suites, then I update the branch with |
|
Side note: VS Code flags |
|
Thanks for the regression and for flagging the CLOCK_MONOTONIC editor diagnostic. The earlier review says no further contributor work is needed; the promised merge-result verification and branch refresh are still maintainer-side steps. I have not established the cause of that editor diagnostic in this sweep. |
Brings the branch up to date with main a222715. One conflict, in tests/test_extraction.c: main added two Python route tests (extract_python_mock_patch_is_not_route, extract_python_bare_decorator_route_rules) at the same place where this branch adds solidity_modifier_decorator. Resolved by keeping all three tests and all three RUN_TEST lines; the lang_specs.c change merged cleanly and is unchanged. Signed-off-by: Martin Vogel <martin.vogel.tech@gmail.com>
|
Thank you, @sanskar717, and sorry the branch refresh we promised on 21 September took this long. Your part was done then: the one-line table entry puts Solidity on the same decorator path as Java and Rust, and your regression test pins it (we re-checked that it fails with the entry removed, as you said). What we changed on your branch, so you know what landed:
That is the only change. Before pushing it we ran the merged tree on a real Solidity codebase, OpenZeppelin Contracts: with your entry the index gains 141 DECORATES edges from functions to the modifiers they use ( The red CI on your old head was the stale-base test we mentioned before; the new run is against current |
|
Thank you again for the Solidity modifier regression. The October updates record the branch refresh and decorator verification as completed on our side, so no repeat contributor work is requested. Sorry for the delay in the remaining maintainer follow-up—I’ll follow up soon. |
Signed-off-by: Martin Vogel <martin.vogel.tech@gmail.com>
|
Thank you again, @sanskar717. One more housekeeping step on our side, and nothing is needed from you: we merged current main into your branch again (one signed-off merge commit, no conflicts). Your lang_specs.c entry and the solidity_modifier_decorator test are unchanged. The last CI run failed only on a repository-wide documentation count check that was fixed on main after your branch was last refreshed, so the run on the new head is the one that counts. If you push to this branch again, please pull first so the merge commit is kept. We will merge as soon as it is green. |
|
Thanks a lot, @DeusData, and no need to apologize at all. I really appreciate the time and care you put into reviewing this, including the OpenZeppelin check and the branch refreshes. I won't push anything to the branch, so your merge commit stays intact. Happy to adjust anything if needed once CI finishes. |
Signed-off-by: Martin Vogel <martin.vogel.tech@gmail.com>
|
Thanks again, @sanskar717. Several other pull requests landed on main this evening, including changes in files this one also touches, so we merged current main into your branch once more (one signed-off merge commit, 2382876; your changes are untouched). That keeps the required checks honest against today's tree; we will merge once they are green. Please pull before pushing again. |
Signed-off-by: Martin Vogel <martin.vogel.tech@gmail.com>
|
Thank you for your patience, @sanskar717. CI went green on this branch, but tonight's merges on main touched tests/test_extraction.c, which this pull request also changes, so that green no longer covered today's main. We merged current main into the branch once more (one merge commit, 6217b49; your changes are untouched) and will merge once the fresh checks are green. Please pull before pushing again. |
Signed-off-by: Martin Vogel <martin.vogel.tech@gmail.com>
|
Thank you for your patience, @sanskar717. CI went green on this branch, but this evening's merges on main touched files this pull request also changes, so that green no longer covered today's main. We merged current main into the branch once more (one merge commit, e2c9de1; your changes are untouched) and will merge once the fresh checks are green. Please pull before pushing again. |
|
Merged - thank you, @sanskar717! This puts Solidity modifiers such as onlyOwner and nonReentrant on the same decorator path as Java annotations and Rust attributes, so functions now link to the modifiers that guard them in the code graph. Two things you did made this easy to land: you chose the existing tree-sitter path over adding a JavaScript parser and explained why up front, and you proved your regression test fails with the table entry removed. Thank you for your patience with how long the review queue took. |
Summary
Adds Solidity
modifier_invocationsupport to the existing Solidity language specification so modifier usages such asonlyOwnerare tracked as decorators in the code graph.Changes
solidity_decorator_typeswithmodifier_invocationCBM_LANG_SOLIDITYonlyOwnerto be tracked correctlyVerification
Verified locally with
search_codeusingonlyOwner:onlyOwnerinvocation onwithdrawRelation to #1754
The issue proposes adding Solidity parser support. Since Solidity grammar is already vendored through Tree-sitter, this change extends the existing parsing path without introducing a Node.js runtime or JavaScript dependency.
This PR specifically fixes the missing modifier/decorator tracking in the current Solidity support.