Objective-C headers are parsed as C++, producing wrong nodes
Maintainer thường phản hồi trong vòng 1 ngày
Chưa có ai nhận issue này.
Đánh giá
- Độ khó
- 3/5
- Thời gian dự kiến
- 1-2 ngày
- Mức phù hợp với người mới
- 67/100
- Loại issue
- Lỗi
- Độ rõ ràng
- Khá rõ ràng
- Mức độ hoạt động
- Sôi nổi
- Công nghệ
- c, objective-c
- Lĩnh vực
- devtools
Hướng nghiên cứu
Start by tracing how file extensions select grammars for indexing, then compare the existing Objective-C grammar behavior for the reported Thing.h and Thing.m examples. Check how the C++ header extension overlaps with Objective-C headers and look for related parser tests. Done when the header produces a Class node for Thing and does not record NSObject or @end as a Variable.
Do mô hình lập chỉ mục viết ra từ nội dung của issue.
Mô tả
Thanks for codebase-memory-mcp. It has become the first thing I reach for on a mixed Objective-C and Swift project, which is how I came across this.
Version: main 4d9592b
What happens
Objective-C headers are indexed with the C++ grammar. The effect is not mainly parse errors, it is wrong content in the graph: the class does not appear at all, and the superclass name is recorded as a Variable. That is easy to miss, because nothing reports a failure.
Minimal reproduction
One file, three lines, indexed twice under two different names. The bytes are identical both times:
#import <Foundation/Foundation.h>
@interface Thing : NSObject
- (void)doWork;
@end
$ codebase-memory-mcp cli --json index_repository --repo-path <repo> --name t --mode full
$ codebase-memory-mcp cli --json search_graph --project t --name_pattern ".*"
Named Thing.h:
t.Thing.NSObject Variable Thing.h 3-3
The same bytes named Thing.m:
t.Thing.Thing Class Thing.m 3-5
So the file itself parses, and the Objective-C grammar is already vendored and working. Only the file name decides which grammar is used.
An empty interface gives a matching artifact: @end is recorded as a Variable named end.
Since .h is also a C++ header extension, I realise this is not a one-line call to make. I have looked into it a fair bit and would be glad to open a pull request if you are open to one. Either way, thank you for the tool.
Note: The error reproduction steps above were drafted with the assistance of AI.
- Ngôn ngữ chính
- C
- Star
- 45.8k
- Fork
- 3.8k
- Merge trung bình
- 3 ngày 8 giờ
- Pull request đã merge (30 ngày)
- 195
Chuẩn bị môi trường
Dự án này không cung cấp dev container, Dockerfile hay hướng dẫn đóng góp, nên bạn cần tự thiết lập môi trường: hãy bắt đầu từ README và xem hướng dẫn đóng góp lần đầu của chúng tôi để biết các bước chung.
Bắt đầu từ đâu
- Đọc hết issue, rồi đọc hướng dẫn đóng góp của dự án.
- Bình luận trên issue rằng bạn sẽ nhận — tránh hai người làm cùng một việc.
- Fork repository và làm thay đổi trên một nhánh.
- Mở pull request có tham chiếu số hiệu của issue.
Issue khác của DeusData/codebase-memory-mcp
-
editor/integration parsing/quality
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 68/100
DeusData/codebase-memory-mcp#2286 ·
Maintainer thường phản hồi trong vòng 1 ngày
-
install writes an unsupported `args` key into the Claude Code SubagentStart hook, so it never runsĐang mởbug editor/integration priority/high stability/performance ux/behavior
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 72/100
DeusData/codebase-memory-mcp#2239 · 1 bình luận ·
Maintainer thường phản hồi trong vòng 1 ngày
-
bug priority/high ux/behavior
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 72/100
DeusData/codebase-memory-mcp#2232 · 2 bình luận ·
Maintainer thường phản hồi trong vòng 1 ngày
-
documentation editor/integration parsing/quality priority/normal
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 85/100
DeusData/codebase-memory-mcp#2169 ·
Maintainer thường phản hồi trong vòng 1 ngày
-
documentation priority/normal ux/behavior
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 72/100
DeusData/codebase-memory-mcp#2050 ·
Maintainer thường phản hồi trong vòng 1 ngày
Tất cả issue của DeusData/codebase-memory-mcp
Issue tương tự
-
bug
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 72/100
Maintainer thường phản hồi trong vòng 1 ngày
-
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 72/100
-
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 72/100
openwrt/openwrt#26385 · 2 bình luận ·
Maintainer thường phản hồi trong vòng 1 ngày
-
Độ khó 2/5 Nửa ngày Mức phù hợp với người mới 62/100
php/php-src#25137 · 1 bình luận ·
Maintainer thường phản hồi trong vòng 1 ngày
-
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 72/100
c3lang/c3c#3613 · 2 bình luận ·
Maintainer thường phản hồi trong vòng 1 ngày