From f2119df35cdcdb0c6c9bf791a04000d4d131cef7 Mon Sep 17 00:00:00 2001 From: Ilya Ilyinykh Date: Thu, 1 Feb 2024 17:40:21 +0300 Subject: [PATCH] feat(go): printf injections https://pkg.go.dev/fmt#pkg-index https://pkg.go.dev/fmt#Fscanf https://pkg.go.dev/fmt#Appendf https://pkg.go.dev/fmt#Sscanf https://pkg.go.dev/testing#T.Skipf https://pkg.go.dev/testing#F.Logf The problem covered here: https://github.com/nvim-treesitter/nvim-treesitter/issues/2917 --- queries/go/injections.scm | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/queries/go/injections.scm b/queries/go/injections.scm index 7d9166e33..3e194e272 100644 --- a/queries/go/injections.scm +++ b/queries/go/injections.scm @@ -25,7 +25,7 @@ (argument_list . (interpreted_string_literal) @injection.content)) - (#any-of? @_method "Printf" "Sprintf" "Fatalf" "Scanf") + (#any-of? @_method "Printf" "Sprintf" "Fatalf" "Scanf" "Errorf" "Skipf" "Logf") (#set! injection.language "printf")) ((call_expression @@ -37,5 +37,5 @@ (_) . (interpreted_string_literal) @injection.content)) - (#eq? @_method "Fprintf") + (#eq? @_method "Fprintf" "Fscanf" "Appendf" "Sscanf") (#set! injection.language "printf"))