Commit 012be57
committed
fix(extract): keep decorators separated by a comment
Comments are NAMED tree-sitter nodes, so the prev-sibling walk in
extract_decorators() stopped at one — silently dropping every decorator ABOVE
an interleaved comment:
@post('login') <-- dropped
@httpcode(HttpStatus.OK) <-- dropped
// throttled per IP and account
@Throttle({ ... }) <-- kept
async login(...)
The route then vanished from decorator/route queries, so documenting a
decorator made the endpoint disappear from the graph. Real-world impact: on a
NestJS backend, 1 of 95 HTTP endpoints was missing — the one whose throttle
policy carried an explanatory comment.
Comments are now transparent to the walk, the same way anonymous tokens
(e.g. TS `export`) already were. Reuses the existing is_comment_node() helper.
Signed-off-by: KolisCode <jhohantma@gmail.com>1 parent 90d7315 commit 012be57
2 files changed
Lines changed: 41 additions & 3 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1886 | 1886 | | |
1887 | 1887 | | |
1888 | 1888 | | |
| 1889 | + | |
| 1890 | + | |
| 1891 | + | |
| 1892 | + | |
| 1893 | + | |
| 1894 | + | |
| 1895 | + | |
| 1896 | + | |
| 1897 | + | |
| 1898 | + | |
| 1899 | + | |
| 1900 | + | |
1889 | 1901 | | |
1890 | 1902 | | |
1891 | 1903 | | |
| |||
1897 | 1909 | | |
1898 | 1910 | | |
1899 | 1911 | | |
1900 | | - | |
| 1912 | + | |
1901 | 1913 | | |
1902 | 1914 | | |
1903 | | - | |
| 1915 | + | |
| 1916 | + | |
1904 | 1917 | | |
1905 | 1918 | | |
1906 | 1919 | | |
| |||
1937 | 1950 | | |
1938 | 1951 | | |
1939 | 1952 | | |
1940 | | - | |
| 1953 | + | |
1941 | 1954 | | |
1942 | 1955 | | |
1943 | 1956 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
2790 | 2790 | | |
2791 | 2791 | | |
2792 | 2792 | | |
| 2793 | + | |
| 2794 | + | |
| 2795 | + | |
| 2796 | + | |
| 2797 | + | |
| 2798 | + | |
| 2799 | + | |
| 2800 | + | |
| 2801 | + | |
| 2802 | + | |
| 2803 | + | |
| 2804 | + | |
| 2805 | + | |
| 2806 | + | |
| 2807 | + | |
| 2808 | + | |
| 2809 | + | |
| 2810 | + | |
| 2811 | + | |
| 2812 | + | |
| 2813 | + | |
| 2814 | + | |
| 2815 | + | |
| 2816 | + | |
2793 | 2817 | | |
2794 | 2818 | | |
2795 | 2819 | | |
| |||
4912 | 4936 | | |
4913 | 4937 | | |
4914 | 4938 | | |
| 4939 | + | |
4915 | 4940 | | |
4916 | 4941 | | |
4917 | 4942 | | |
0 commit comments