@@ -111,10 +111,11 @@ func TestBinder_MultipleDeclarations(t *testing.T) {
111111// 바인딩이 성공함을 검증합니다.
112112//
113113// fixture 기준:
114- // Line 1-4: docstring ("""...""")
115- // Line 5: @app.route('/api/user')
116- // Line 6: @login_required
117- // Line 7: def get_user(): ← tree-sitter StartLine 예상
114+ //
115+ // Line 1-4: docstring ("""...""")
116+ // Line 5: @app.route('/api/user')
117+ // Line 6: @login_required
118+ // Line 7: def get_user(): ← tree-sitter StartLine 예상
118119//
119120// gap = 7 - 4 = 3 ≤ maxGap(3) → 바인딩 성공
120121func TestBinder_PythonDecoratorGap_BindsWithinMaxGap (t * testing.T ) {
@@ -188,11 +189,12 @@ func TestBinder_JavaAnnotationGap_PassthroughBinds(t *testing.T) {
188189// 바인딩이 성공함을 검증합니다.
189190//
190191// fixture (attribute_gap.rs) 기준:
191- // Line 1: /// @intent 비동기 main 진입점
192- // Line 2: /// @sideEffect 런타임 초기화
193- // Line 3: #[tokio::main]
194- // Line 4: #[allow(dead_code)]
195- // Line 5: async fn main() { ← tree-sitter StartLine
192+ //
193+ // Line 1: /// @intent 비동기 main 진입점
194+ // Line 2: /// @sideEffect 런타임 초기화
195+ // Line 3: #[tokio::main]
196+ // Line 4: #[allow(dead_code)]
197+ // Line 5: async fn main() { ← tree-sitter StartLine
196198//
197199// gap = 5 - 2 = 3 ≤ maxGap(3) → 바인딩 성공
198200func TestBinder_RustAttributeGap_BindsWithinMaxGap (t * testing.T ) {
@@ -226,10 +228,11 @@ func TestBinder_RustAttributeGap_BindsWithinMaxGap(t *testing.T) {
226228// 바인딩이 성공함을 검증합니다.
227229//
228230// fixture (attribute_gap.c) 기준:
229- // Line 1-3: /** ... */ Doxygen
230- // Line 4: __attribute__((always_inline))
231- // Line 5: __attribute__((nonnull))
232- // Line 6: static inline int add(int a, int b) { ← tree-sitter StartLine 예상
231+ //
232+ // Line 1-3: /** ... */ Doxygen
233+ // Line 4: __attribute__((always_inline))
234+ // Line 5: __attribute__((nonnull))
235+ // Line 6: static inline int add(int a, int b) { ← tree-sitter StartLine 예상
233236//
234237// gap = 6 - 3 = 3 ≤ maxGap(3) → 바인딩 성공
235238func TestBinder_CAttributeGap_BindsWithinMaxGap (t * testing.T ) {
@@ -292,7 +295,6 @@ func TestBinder_GapWithCodeBetween_NoBinding(t *testing.T) {
292295 }
293296}
294297
295-
296298// =============================================================================
297299// Look-Between 동적 바인딩 테스트
298300// =============================================================================
@@ -320,10 +322,10 @@ func TestBinder_LookBetween_BlankLinesOnly_Binds(t *testing.T) {
320322 }
321323 sourceLines := []string {
322324 "// @intent 빈 줄 사이 바인딩" , // line 1
323- "" , // line 2
324- "" , // line 3
325- "" , // line 4
326- "func MyFunc() {" , // line 5
325+ "" , // line 2
326+ "" , // line 3
327+ "" , // line 4
328+ "func MyFunc() {" , // line 5
327329 }
328330
329331 bindings := b .Bind (comments , nodes , "go" , sourceLines )
@@ -357,8 +359,8 @@ func TestBinder_LookBetween_CodeBetween_NoBinding(t *testing.T) {
357359 }
358360 sourceLines := []string {
359361 "// @intent 이 주석은 바인딩 안 됨" , // line 1
360- "var x = 42" , // line 2 - 코드!
361- "func MyFunc() {" , // line 3
362+ "var x = 42" , // line 2 - 코드!
363+ "func MyFunc() {" , // line 3
362364 }
363365
364366 bindings := b .Bind (comments , nodes , "go" , sourceLines )
@@ -395,8 +397,8 @@ func TestBinder_LookBetween_Adjacent_Gap1_Binds(t *testing.T) {
395397 }
396398 sourceLines := []string {
397399 "// @intent 인접 바인딩" , // line 1
398- "// (continued)" , // line 2
399- "func MyFunc() {" , // line 3
400+ "// (continued)" , // line 2
401+ "func MyFunc() {" , // line 3
400402 }
401403
402404 bindings := b .Bind (comments , nodes , "go" , sourceLines )
@@ -439,9 +441,9 @@ func TestBinder_LookBetween_WhitespaceOnlyLines_Binds(t *testing.T) {
439441 }
440442 sourceLines := []string {
441443 "// @intent 공백문자만 있는 줄" , // line 1
442- " " , // line 2 - spaces only
443- "\t \t " , // line 3 - tabs only
444- "func MyFunc() {" , // line 4
444+ " " , // line 2 - spaces only
445+ "\t \t " , // line 3 - tabs only
446+ "func MyFunc() {" , // line 4
445447 }
446448
447449 bindings := b .Bind (comments , nodes , "go" , sourceLines )
@@ -477,9 +479,9 @@ func TestBinder_Passthrough_PythonDecorators_Binds(t *testing.T) {
477479 }
478480 sourceLines := []string {
479481 "# @intent 사용자 조회 엔드포인트" , // line 1
480- "@app.route('/api/user')" , // line 2 - decorator
481- "@login_required" , // line 3 - decorator
482- "def get_user():" , // line 4
482+ "@app.route('/api/user')" , // line 2 - decorator
483+ "@login_required" , // line 3 - decorator
484+ "def get_user():" , // line 4
483485 }
484486
485487 bindings := b .Bind (comments , nodes , "python" , sourceLines )
@@ -511,13 +513,13 @@ func TestBinder_Passthrough_JavaAnnotations_Binds(t *testing.T) {
511513 {Name : "UserService" , Kind : model .NodeKindClass , StartLine : 7 , EndLine : 20 },
512514 }
513515 sourceLines := []string {
514- "/**" , // line 1
515- " * @intent 사용자 서비스" , // line 2
516- " */" , // line 3
517- "@Service" , // line 4 - annotation
518- "@Transactional" , // line 5 - annotation
519- "@RequiredArgsConstructor" , // line 6 - annotation
520- "public class UserService {" , // line 7
516+ "/**" , // line 1
517+ " * @intent 사용자 서비스" , // line 2
518+ " */" , // line 3
519+ "@Service" , // line 4 - annotation
520+ "@Transactional" , // line 5 - annotation
521+ "@RequiredArgsConstructor" , // line 6 - annotation
522+ "public class UserService {" , // line 7
521523 }
522524
523525 bindings := b .Bind (comments , nodes , "java" , sourceLines )
@@ -549,11 +551,11 @@ func TestBinder_Passthrough_RustAttributes_Binds(t *testing.T) {
549551 {Name : "main" , Kind : model .NodeKindFunction , StartLine : 5 , EndLine : 10 },
550552 }
551553 sourceLines := []string {
552- "/// @intent 비동기 main 진입점" , // line 1
553- "/// @sideEffect 런타임 초기화" , // line 2
554- "#[tokio::main]" , // line 3 - Rust attribute
555- "#[allow(dead_code)]" , // line 4 - Rust attribute
556- "async fn main() {" , // line 5
554+ "/// @intent 비동기 main 진입점" , // line 1
555+ "/// @sideEffect 런타임 초기화" , // line 2
556+ "#[tokio::main]" , // line 3 - Rust attribute
557+ "#[allow(dead_code)]" , // line 4 - Rust attribute
558+ "async fn main() {" , // line 5
557559 }
558560
559561 bindings := b .Bind (comments , nodes , "rust" , sourceLines )
@@ -584,12 +586,12 @@ func TestBinder_Passthrough_CAttributes_Binds(t *testing.T) {
584586 {Name : "add" , Kind : model .NodeKindFunction , StartLine : 6 , EndLine : 10 },
585587 }
586588 sourceLines := []string {
587- "/**" , // line 1
588- " * @intent 항상 인라인되는 덧셈" , // line 2
589- " */" , // line 3
590- "__attribute__((always_inline))" , // line 4 - C attribute
591- "[[nodiscard]]" , // line 5 - C++17 attribute
592- "static inline int add(int a, int b) {" , // line 6
589+ "/**" , // line 1
590+ " * @intent 항상 인라인되는 덧셈" , // line 2
591+ " */" , // line 3
592+ "__attribute__((always_inline))" , // line 4 - C attribute
593+ "[[nodiscard]]" , // line 5 - C++17 attribute
594+ "static inline int add(int a, int b) {" , // line 6
593595 }
594596
595597 bindings := b .Bind (comments , nodes , "c" , sourceLines )
@@ -620,10 +622,10 @@ func TestBinder_Passthrough_OtherComments_Binds(t *testing.T) {
620622 {Name : "MyFunc" , Kind : model .NodeKindFunction , StartLine : 4 , EndLine : 10 },
621623 }
622624 sourceLines := []string {
623- "// @intent 주석 사이 바인딩" , // line 1
624- "// TODO: 나중에 리팩토링" , // line 2 - comment
625+ "// @intent 주석 사이 바인딩" , // line 1
626+ "// TODO: 나중에 리팩토링" , // line 2 - comment
625627 "// NOTE: 이 함수는 deprecated 예정" , // line 3 - comment
626- "func MyFunc() {" , // line 4
628+ "func MyFunc() {" , // line 4
627629 }
628630
629631 bindings := b .Bind (comments , nodes , "go" , sourceLines )
@@ -657,11 +659,11 @@ func TestBinder_Passthrough_Mixed_Binds(t *testing.T) {
657659 }
658660 sourceLines := []string {
659661 "# @intent 혼합 passthrough 테스트" , // line 1
660- "# type: ignore" , // line 2 - comment
661- "" , // line 3 - blank
662- "@app.route('/test')" , // line 4 - decorator
663- "@requires_auth" , // line 5 - decorator
664- "def handler():" , // line 6
662+ "# type: ignore" , // line 2 - comment
663+ "" , // line 3 - blank
664+ "@app.route('/test')" , // line 4 - decorator
665+ "@requires_auth" , // line 5 - decorator
666+ "def handler():" , // line 6
665667 }
666668
667669 bindings := b .Bind (comments , nodes , "python" , sourceLines )
@@ -693,9 +695,9 @@ func TestBinder_Passthrough_DecoratorPlusCode_NoBinding(t *testing.T) {
693695 }
694696 sourceLines := []string {
695697 "# @intent 이건 바인딩 안 됨" , // line 1
696- "@decorator" , // line 2 - decorator (passthrough)
697- "x = 42" , // line 3 - actual code!
698- "def handler():" , // line 4
698+ "@decorator" , // line 2 - decorator (passthrough)
699+ "x = 42" , // line 3 - actual code!
700+ "def handler():" , // line 4
699701 }
700702
701703 bindings := b .Bind (comments , nodes , "python" , sourceLines )
0 commit comments