From f4796c0c5beded2de1a3c149afc6d59c9e8844f7 Mon Sep 17 00:00:00 2001 From: Alex Povel Date: Sat, 27 Jul 2024 18:40:56 +0200 Subject: [PATCH] fix(go): String scoping no longer scopes parts of imports/field decl. An actually normal bug... See the diff in snapshots for what this means --- src/scoping/langs/go.rs | 4 ++-- .../snapshots/r#mod__langs__base.go_strings.snap | 12 ------------ 2 files changed, 2 insertions(+), 14 deletions(-) diff --git a/src/scoping/langs/go.rs b/src/scoping/langs/go.rs index 7fd755cc..bb0fcabb 100644 --- a/src/scoping/langs/go.rs +++ b/src/scoping/langs/go.rs @@ -38,8 +38,8 @@ impl From for TSQuery { [ (raw_string_literal) (interpreted_string_literal) - (import_spec (interpreted_string_literal) @{0}) - (field_declaration tag: (raw_string_literal) @{0}) + (import_spec (interpreted_string_literal)) @{0} + (field_declaration tag: (raw_string_literal)) @{0} ] @string", IGNORE diff --git a/tests/langs/snapshots/r#mod__langs__base.go_strings.snap b/tests/langs/snapshots/r#mod__langs__base.go_strings.snap index 18480852..816da263 100644 --- a/tests/langs/snapshots/r#mod__langs__base.go_strings.snap +++ b/tests/langs/snapshots/r#mod__langs__base.go_strings.snap @@ -2,18 +2,6 @@ source: tests/langs/mod.rs expression: inscope_parts --- -- n: 9 - l: "\tu \"net/url\"\n" - m: " ^^ " -- n: 47 - l: "\tName string `json:\"name,omitempty\" db:\"name\"`\n" - m: " ^^^^^^^^^^^^^^^^^^^^^ " -- n: 48 - l: "\tInput interface{} `json:\"input\" db:\"input\"`\n" - m: " ^^^^^^^^^^^^^^^^^^^^^ " -- n: 49 - l: "\tExpected interface{} `json:\"expected\" db:\"expected\"`\n" - m: " ^^^^^^^^^^^^^^^^^^^^^ " - n: 108 l: "\t\tfmt.Println(\"Cleanup after tests\")\n" m: " ^^^^^^^^^^^^^^^^^^^^^^^ "