diff --git a/modules/go-tree-sitter/metadata.json b/modules/go-tree-sitter/metadata.json new file mode 100644 index 00000000000..1b17bd25553 --- /dev/null +++ b/modules/go-tree-sitter/metadata.json @@ -0,0 +1,9 @@ +{ + "homepage": "https://github.com/smacker/go-tree-sitter", + "maintainers": [], + "repository": [], + "versions": [ + "v0.0.0-20240827094217-dd81d9e9be82" + ], + "yanked_versions": {} +} diff --git a/modules/go-tree-sitter/v0.0.0-20240827094217-dd81d9e9be82/MODULE.bazel b/modules/go-tree-sitter/v0.0.0-20240827094217-dd81d9e9be82/MODULE.bazel new file mode 100644 index 00000000000..85392dbbd7e --- /dev/null +++ b/modules/go-tree-sitter/v0.0.0-20240827094217-dd81d9e9be82/MODULE.bazel @@ -0,0 +1,15 @@ +module( + name = "go-tree-sitter", + version = "v0.0.0-20240827094217-dd81d9e9be82", + compatibility_level = 0, +) + +bazel_dep(name = "rules_go", version = "0.39.1", repo_name = "io_bazel_rules_go") +bazel_dep(name = "gazelle", version = "0.31.0") + +go_deps = use_extension("@gazelle//:extensions.bzl", "go_deps") +go_deps.from_file(go_mod = "//:go.mod") +use_repo( + go_deps, + "com_github_stretchr_testify", +) diff --git a/modules/go-tree-sitter/v0.0.0-20240827094217-dd81d9e9be82/patches/01_add_module_file.patch b/modules/go-tree-sitter/v0.0.0-20240827094217-dd81d9e9be82/patches/01_add_module_file.patch new file mode 100644 index 00000000000..79026f12e9c --- /dev/null +++ b/modules/go-tree-sitter/v0.0.0-20240827094217-dd81d9e9be82/patches/01_add_module_file.patch @@ -0,0 +1,21 @@ +diff --git a/MODULE.bazel b/MODULE.bazel +new file mode 100644 +index 0000000..85392db +--- /dev/null ++++ b/MODULE.bazel +@@ -0,0 +1,15 @@ ++module( ++ name = "go-tree-sitter", ++ version = "v0.0.0-20240827094217-dd81d9e9be82", ++ compatibility_level = 0, ++) ++ ++bazel_dep(name = "rules_go", version = "0.39.1", repo_name = "io_bazel_rules_go") ++bazel_dep(name = "gazelle", version = "0.31.0") ++ ++go_deps = use_extension("@gazelle//:extensions.bzl", "go_deps") ++go_deps.from_file(go_mod = "//:go.mod") ++use_repo( ++ go_deps, ++ "com_github_stretchr_testify", ++) diff --git a/modules/go-tree-sitter/v0.0.0-20240827094217-dd81d9e9be82/patches/02_add_root_build_file.patch b/modules/go-tree-sitter/v0.0.0-20240827094217-dd81d9e9be82/patches/02_add_root_build_file.patch new file mode 100644 index 00000000000..8b29d065719 --- /dev/null +++ b/modules/go-tree-sitter/v0.0.0-20240827094217-dd81d9e9be82/patches/02_add_root_build_file.patch @@ -0,0 +1,10 @@ +diff --git a/BUILD.bazel b/BUILD.bazel +new file mode 100644 +index 0000000..78c001e +--- /dev/null ++++ b/BUILD.bazel +@@ -0,0 +1,4 @@ ++load("@gazelle//:def.bzl", "gazelle") ++ ++# gazelle:prefix github.com/smacker/go-tree-sitter ++gazelle(name = "gazelle") diff --git a/modules/go-tree-sitter/v0.0.0-20240827094217-dd81d9e9be82/patches/03_add_autogenerated_build_files.patch b/modules/go-tree-sitter/v0.0.0-20240827094217-dd81d9e9be82/patches/03_add_autogenerated_build_files.patch new file mode 100644 index 00000000000..48a14afc8fa --- /dev/null +++ b/modules/go-tree-sitter/v0.0.0-20240827094217-dd81d9e9be82/patches/03_add_autogenerated_build_files.patch @@ -0,0 +1,1213 @@ +commit 00af5d6e1dbbd7bd79cc34ac98b9b199a9a2e346 +Author: Douglas Thor +Date: Thu Nov 21 04:19:47 2024 +0000 + + Run gazelle + +diff --git a/BUILD.bazel b/BUILD.bazel +index 78c001e..699c796 100644 +--- a/BUILD.bazel ++++ b/BUILD.bazel +@@ -1,4 +1,74 @@ ++load("@io_bazel_rules_go//go:def.bzl", "go_library", "go_test") + load("@gazelle//:def.bzl", "gazelle") + + # gazelle:prefix github.com/smacker/go-tree-sitter + gazelle(name = "gazelle") ++ ++go_library( ++ name = "go-tree-sitter", ++ srcs = [ ++ "alloc.c", ++ "alloc.h", ++ "api.h", ++ "array.h", ++ "atomic.h", ++ "bindings.c", ++ "bindings.go", ++ "bindings.h", ++ "bits.h", ++ "clock.h", ++ "error_costs.h", ++ "get_changed_ranges.c", ++ "get_changed_ranges.h", ++ "host.h", ++ "iter.go", ++ "language.c", ++ "language.h", ++ "length.h", ++ "lexer.c", ++ "lexer.h", ++ "node.c", ++ "parser.c", ++ "parser.h", ++ "point.h", ++ "ptypes.h", ++ "query.c", ++ "reduce_action.h", ++ "reusable_node.h", ++ "stack.c", ++ "stack.h", ++ "subtree.c", ++ "subtree.h", ++ "test_grammar.go", ++ "tree.c", ++ "tree.h", ++ "tree_cursor.c", ++ "tree_cursor.h", ++ "umachine.h", ++ "unicode.h", ++ "urename.h", ++ "utf.h", ++ "utf16.h", ++ "utf8.h", ++ "wasm_store.c", ++ "wasm_store.h", ++ ], ++ cgo = True, ++ importpath = "github.com/smacker/go-tree-sitter", ++ visibility = ["//visibility:public"], ++) ++ ++go_test( ++ name = "go-tree-sitter_test", ++ srcs = [ ++ "bindings_test.go", ++ "example_test.go", ++ "predicates_test.go", ++ ], ++ embed = [":go-tree-sitter"], ++ deps = [ ++ "//golang", ++ "@com_github_stretchr_testify//assert", ++ "@com_github_stretchr_testify//require", ++ ], ++) +diff --git a/_automation/treesitter_updater/BUILD.bazel b/_automation/treesitter_updater/BUILD.bazel +new file mode 100644 +index 0000000..8163cd9 +--- /dev/null ++++ b/_automation/treesitter_updater/BUILD.bazel +@@ -0,0 +1,14 @@ ++load("@io_bazel_rules_go//go:def.bzl", "go_binary", "go_library") ++ ++go_library( ++ name = "treesitter_updater_lib", ++ srcs = ["main.go"], ++ importpath = "github.com/smacker/go-tree-sitter/_automation/treesitter_updater", ++ visibility = ["//visibility:private"], ++) ++ ++go_binary( ++ name = "treesitter_updater", ++ embed = [":treesitter_updater_lib"], ++ visibility = ["//visibility:public"], ++) +diff --git a/_examples/BUILD.bazel b/_examples/BUILD.bazel +new file mode 100644 +index 0000000..5d8e9ca +--- /dev/null ++++ b/_examples/BUILD.bazel +@@ -0,0 +1,18 @@ ++load("@io_bazel_rules_go//go:def.bzl", "go_binary", "go_library") ++ ++go_library( ++ name = "_examples_lib", ++ srcs = ["main.go"], ++ importpath = "github.com/smacker/go-tree-sitter/_examples", ++ visibility = ["//visibility:private"], ++ deps = [ ++ "//:go-tree-sitter", ++ "//javascript", ++ ], ++) ++ ++go_binary( ++ name = "_examples", ++ embed = [":_examples_lib"], ++ visibility = ["//visibility:public"], ++) +diff --git a/_examples/predicates/BUILD.bazel b/_examples/predicates/BUILD.bazel +new file mode 100644 +index 0000000..868ba6f +--- /dev/null ++++ b/_examples/predicates/BUILD.bazel +@@ -0,0 +1,18 @@ ++load("@io_bazel_rules_go//go:def.bzl", "go_binary", "go_library") ++ ++go_library( ++ name = "predicates_lib", ++ srcs = ["main.go"], ++ importpath = "github.com/smacker/go-tree-sitter/_examples/predicates", ++ visibility = ["//visibility:private"], ++ deps = [ ++ "//:go-tree-sitter", ++ "//javascript", ++ ], ++) ++ ++go_binary( ++ name = "predicates", ++ embed = [":predicates_lib"], ++ visibility = ["//visibility:public"], ++) +diff --git a/bash/BUILD.bazel b/bash/BUILD.bazel +new file mode 100644 +index 0000000..3e627b6 +--- /dev/null ++++ b/bash/BUILD.bazel +@@ -0,0 +1,25 @@ ++load("@io_bazel_rules_go//go:def.bzl", "go_library", "go_test") ++ ++go_library( ++ name = "bash", ++ srcs = [ ++ "binding.go", ++ "parser.c", ++ "parser.h", ++ "scanner.c", ++ ], ++ cgo = True, ++ importpath = "github.com/smacker/go-tree-sitter/bash", ++ visibility = ["//visibility:public"], ++ deps = ["//:go-tree-sitter"], ++) ++ ++go_test( ++ name = "bash_test", ++ srcs = ["binding_test.go"], ++ deps = [ ++ ":bash", ++ "//:go-tree-sitter", ++ "@com_github_stretchr_testify//assert", ++ ], ++) +diff --git a/c/BUILD.bazel b/c/BUILD.bazel +new file mode 100644 +index 0000000..8ac325a +--- /dev/null ++++ b/c/BUILD.bazel +@@ -0,0 +1,24 @@ ++load("@io_bazel_rules_go//go:def.bzl", "go_library", "go_test") ++ ++go_library( ++ name = "c", ++ srcs = [ ++ "binding.go", ++ "parser.c", ++ "parser.h", ++ ], ++ cgo = True, ++ importpath = "github.com/smacker/go-tree-sitter/c", ++ visibility = ["//visibility:public"], ++ deps = ["//:go-tree-sitter"], ++) ++ ++go_test( ++ name = "c_test", ++ srcs = ["binding_test.go"], ++ deps = [ ++ ":c", ++ "//:go-tree-sitter", ++ "@com_github_stretchr_testify//assert", ++ ], ++) +diff --git a/cpp/BUILD.bazel b/cpp/BUILD.bazel +new file mode 100644 +index 0000000..4dd649a +--- /dev/null ++++ b/cpp/BUILD.bazel +@@ -0,0 +1,25 @@ ++load("@io_bazel_rules_go//go:def.bzl", "go_library", "go_test") ++ ++go_library( ++ name = "cpp", ++ srcs = [ ++ "binding.go", ++ "parser.c", ++ "parser.h", ++ "scanner.c", ++ ], ++ cgo = True, ++ importpath = "github.com/smacker/go-tree-sitter/cpp", ++ visibility = ["//visibility:public"], ++ deps = ["//:go-tree-sitter"], ++) ++ ++go_test( ++ name = "cpp_test", ++ srcs = ["binding_test.go"], ++ deps = [ ++ ":cpp", ++ "//:go-tree-sitter", ++ "@com_github_stretchr_testify//assert", ++ ], ++) +diff --git a/csharp/BUILD.bazel b/csharp/BUILD.bazel +new file mode 100644 +index 0000000..d8995a6 +--- /dev/null ++++ b/csharp/BUILD.bazel +@@ -0,0 +1,26 @@ ++load("@io_bazel_rules_go//go:def.bzl", "go_library", "go_test") ++ ++go_library( ++ name = "csharp", ++ srcs = [ ++ "binding.go", ++ "parser.c", ++ "parser.h", ++ "scanner.c", ++ ], ++ cgo = True, ++ copts = ["-Wno-trigraphs"], ++ importpath = "github.com/smacker/go-tree-sitter/csharp", ++ visibility = ["//visibility:public"], ++ deps = ["//:go-tree-sitter"], ++) ++ ++go_test( ++ name = "csharp_test", ++ srcs = ["binding_test.go"], ++ deps = [ ++ ":csharp", ++ "//:go-tree-sitter", ++ "@com_github_stretchr_testify//assert", ++ ], ++) +diff --git a/css/BUILD.bazel b/css/BUILD.bazel +new file mode 100644 +index 0000000..2d26337 +--- /dev/null ++++ b/css/BUILD.bazel +@@ -0,0 +1,25 @@ ++load("@io_bazel_rules_go//go:def.bzl", "go_library", "go_test") ++ ++go_library( ++ name = "css", ++ srcs = [ ++ "binding.go", ++ "parser.c", ++ "parser.h", ++ "scanner.c", ++ ], ++ cgo = True, ++ importpath = "github.com/smacker/go-tree-sitter/css", ++ visibility = ["//visibility:public"], ++ deps = ["//:go-tree-sitter"], ++) ++ ++go_test( ++ name = "css_test", ++ srcs = ["binding_test.go"], ++ deps = [ ++ ":css", ++ "//:go-tree-sitter", ++ "@com_github_stretchr_testify//assert", ++ ], ++) +diff --git a/cue/BUILD.bazel b/cue/BUILD.bazel +new file mode 100644 +index 0000000..cc673af +--- /dev/null ++++ b/cue/BUILD.bazel +@@ -0,0 +1,25 @@ ++load("@io_bazel_rules_go//go:def.bzl", "go_library", "go_test") ++ ++go_library( ++ name = "cue", ++ srcs = [ ++ "binding.go", ++ "parser.c", ++ "parser.h", ++ "scanner.c", ++ ], ++ cgo = True, ++ importpath = "github.com/smacker/go-tree-sitter/cue", ++ visibility = ["//visibility:public"], ++ deps = ["//:go-tree-sitter"], ++) ++ ++go_test( ++ name = "cue_test", ++ srcs = ["binding_test.go"], ++ deps = [ ++ ":cue", ++ "//:go-tree-sitter", ++ "@com_github_stretchr_testify//assert", ++ ], ++) +diff --git a/dockerfile/BUILD.bazel b/dockerfile/BUILD.bazel +new file mode 100644 +index 0000000..16fb48c +--- /dev/null ++++ b/dockerfile/BUILD.bazel +@@ -0,0 +1,25 @@ ++load("@io_bazel_rules_go//go:def.bzl", "go_library", "go_test") ++ ++go_library( ++ name = "dockerfile", ++ srcs = [ ++ "binding.go", ++ "parser.c", ++ "parser.h", ++ "scanner.c", ++ ], ++ cgo = True, ++ importpath = "github.com/smacker/go-tree-sitter/dockerfile", ++ visibility = ["//visibility:public"], ++ deps = ["//:go-tree-sitter"], ++) ++ ++go_test( ++ name = "dockerfile_test", ++ srcs = ["binding_test.go"], ++ deps = [ ++ ":dockerfile", ++ "//:go-tree-sitter", ++ "@com_github_stretchr_testify//assert", ++ ], ++) +diff --git a/elixir/BUILD.bazel b/elixir/BUILD.bazel +new file mode 100644 +index 0000000..5a9e7bb +--- /dev/null ++++ b/elixir/BUILD.bazel +@@ -0,0 +1,25 @@ ++load("@io_bazel_rules_go//go:def.bzl", "go_library", "go_test") ++ ++go_library( ++ name = "elixir", ++ srcs = [ ++ "binding.go", ++ "parser.c", ++ "parser.h", ++ "scanner.c", ++ ], ++ cgo = True, ++ importpath = "github.com/smacker/go-tree-sitter/elixir", ++ visibility = ["//visibility:public"], ++ deps = ["//:go-tree-sitter"], ++) ++ ++go_test( ++ name = "elixir_test", ++ srcs = ["binding_test.go"], ++ deps = [ ++ ":elixir", ++ "//:go-tree-sitter", ++ "@com_github_stretchr_testify//assert", ++ ], ++) +diff --git a/elm/BUILD.bazel b/elm/BUILD.bazel +new file mode 100644 +index 0000000..d4e7a85 +--- /dev/null ++++ b/elm/BUILD.bazel +@@ -0,0 +1,26 @@ ++load("@io_bazel_rules_go//go:def.bzl", "go_library", "go_test") ++ ++go_library( ++ name = "elm", ++ srcs = [ ++ "binding.go", ++ "parser.c", ++ "parser.h", ++ "scanner.c", ++ ], ++ cgo = True, ++ cxxopts = ["-std=gnu++11"], ++ importpath = "github.com/smacker/go-tree-sitter/elm", ++ visibility = ["//visibility:public"], ++ deps = ["//:go-tree-sitter"], ++) ++ ++go_test( ++ name = "elm_test", ++ srcs = ["binding_test.go"], ++ deps = [ ++ ":elm", ++ "//:go-tree-sitter", ++ "@com_github_stretchr_testify//assert", ++ ], ++) +diff --git a/golang/BUILD.bazel b/golang/BUILD.bazel +new file mode 100644 +index 0000000..a28d3e2 +--- /dev/null ++++ b/golang/BUILD.bazel +@@ -0,0 +1,24 @@ ++load("@io_bazel_rules_go//go:def.bzl", "go_library", "go_test") ++ ++go_library( ++ name = "golang", ++ srcs = [ ++ "binding.go", ++ "parser.c", ++ "parser.h", ++ ], ++ cgo = True, ++ importpath = "github.com/smacker/go-tree-sitter/golang", ++ visibility = ["//visibility:public"], ++ deps = ["//:go-tree-sitter"], ++) ++ ++go_test( ++ name = "golang_test", ++ srcs = ["binding_test.go"], ++ deps = [ ++ ":golang", ++ "//:go-tree-sitter", ++ "@com_github_stretchr_testify//assert", ++ ], ++) +diff --git a/groovy/BUILD.bazel b/groovy/BUILD.bazel +new file mode 100644 +index 0000000..6d319e8 +--- /dev/null ++++ b/groovy/BUILD.bazel +@@ -0,0 +1,25 @@ ++load("@io_bazel_rules_go//go:def.bzl", "go_library", "go_test") ++ ++go_library( ++ name = "groovy", ++ srcs = [ ++ "binding.go", ++ "parser.c", ++ "parser.h", ++ "scanner.c", ++ ], ++ cgo = True, ++ importpath = "github.com/smacker/go-tree-sitter/groovy", ++ visibility = ["//visibility:public"], ++ deps = ["//:go-tree-sitter"], ++) ++ ++go_test( ++ name = "groovy_test", ++ srcs = ["binding_test.go"], ++ deps = [ ++ ":groovy", ++ "//:go-tree-sitter", ++ "@com_github_stretchr_testify//assert", ++ ], ++) +diff --git a/hcl/BUILD.bazel b/hcl/BUILD.bazel +new file mode 100644 +index 0000000..da246d9 +--- /dev/null ++++ b/hcl/BUILD.bazel +@@ -0,0 +1,25 @@ ++load("@io_bazel_rules_go//go:def.bzl", "go_library", "go_test") ++ ++go_library( ++ name = "hcl", ++ srcs = [ ++ "binding.go", ++ "parser.c", ++ "parser.h", ++ "scanner.c", ++ ], ++ cgo = True, ++ importpath = "github.com/smacker/go-tree-sitter/hcl", ++ visibility = ["//visibility:public"], ++ deps = ["//:go-tree-sitter"], ++) ++ ++go_test( ++ name = "hcl_test", ++ srcs = ["binding_test.go"], ++ deps = [ ++ ":hcl", ++ "//:go-tree-sitter", ++ "@com_github_stretchr_testify//assert", ++ ], ++) +diff --git a/html/BUILD.bazel b/html/BUILD.bazel +new file mode 100644 +index 0000000..b0c80b9 +--- /dev/null ++++ b/html/BUILD.bazel +@@ -0,0 +1,26 @@ ++load("@io_bazel_rules_go//go:def.bzl", "go_library", "go_test") ++ ++go_library( ++ name = "html", ++ srcs = [ ++ "binding.go", ++ "parser.c", ++ "parser.h", ++ "scanner.c", ++ "tag.h", ++ ], ++ cgo = True, ++ importpath = "github.com/smacker/go-tree-sitter/html", ++ visibility = ["//visibility:public"], ++ deps = ["//:go-tree-sitter"], ++) ++ ++go_test( ++ name = "html_test", ++ srcs = ["binding_test.go"], ++ deps = [ ++ ":html", ++ "//:go-tree-sitter", ++ "@com_github_stretchr_testify//assert", ++ ], ++) +diff --git a/java/BUILD.bazel b/java/BUILD.bazel +new file mode 100644 +index 0000000..6586b2d +--- /dev/null ++++ b/java/BUILD.bazel +@@ -0,0 +1,24 @@ ++load("@io_bazel_rules_go//go:def.bzl", "go_library", "go_test") ++ ++go_library( ++ name = "java", ++ srcs = [ ++ "binding.go", ++ "parser.c", ++ "parser.h", ++ ], ++ cgo = True, ++ importpath = "github.com/smacker/go-tree-sitter/java", ++ visibility = ["//visibility:public"], ++ deps = ["//:go-tree-sitter"], ++) ++ ++go_test( ++ name = "java_test", ++ srcs = ["binding_test.go"], ++ deps = [ ++ ":java", ++ "//:go-tree-sitter", ++ "@com_github_stretchr_testify//assert", ++ ], ++) +diff --git a/javascript/BUILD.bazel b/javascript/BUILD.bazel +new file mode 100644 +index 0000000..2e96709 +--- /dev/null ++++ b/javascript/BUILD.bazel +@@ -0,0 +1,25 @@ ++load("@io_bazel_rules_go//go:def.bzl", "go_library", "go_test") ++ ++go_library( ++ name = "javascript", ++ srcs = [ ++ "binding.go", ++ "parser.c", ++ "parser.h", ++ "scanner.c", ++ ], ++ cgo = True, ++ importpath = "github.com/smacker/go-tree-sitter/javascript", ++ visibility = ["//visibility:public"], ++ deps = ["//:go-tree-sitter"], ++) ++ ++go_test( ++ name = "javascript_test", ++ srcs = ["binding_test.go"], ++ deps = [ ++ ":javascript", ++ "//:go-tree-sitter", ++ "@com_github_stretchr_testify//assert", ++ ], ++) +diff --git a/kotlin/BUILD.bazel b/kotlin/BUILD.bazel +new file mode 100644 +index 0000000..37b959d +--- /dev/null ++++ b/kotlin/BUILD.bazel +@@ -0,0 +1,25 @@ ++load("@io_bazel_rules_go//go:def.bzl", "go_library", "go_test") ++ ++go_library( ++ name = "kotlin", ++ srcs = [ ++ "binding.go", ++ "parser.c", ++ "parser.h", ++ "scanner.c", ++ ], ++ cgo = True, ++ importpath = "github.com/smacker/go-tree-sitter/kotlin", ++ visibility = ["//visibility:public"], ++ deps = ["//:go-tree-sitter"], ++) ++ ++go_test( ++ name = "kotlin_test", ++ srcs = ["binding_test.go"], ++ deps = [ ++ ":kotlin", ++ "//:go-tree-sitter", ++ "@com_github_stretchr_testify//assert", ++ ], ++) +diff --git a/lua/BUILD.bazel b/lua/BUILD.bazel +new file mode 100644 +index 0000000..2f44982 +--- /dev/null ++++ b/lua/BUILD.bazel +@@ -0,0 +1,25 @@ ++load("@io_bazel_rules_go//go:def.bzl", "go_library", "go_test") ++ ++go_library( ++ name = "lua", ++ srcs = [ ++ "binding.go", ++ "parser.c", ++ "parser.h", ++ "scanner.c", ++ ], ++ cgo = True, ++ importpath = "github.com/smacker/go-tree-sitter/lua", ++ visibility = ["//visibility:public"], ++ deps = ["//:go-tree-sitter"], ++) ++ ++go_test( ++ name = "lua_test", ++ srcs = ["binding_test.go"], ++ deps = [ ++ ":lua", ++ "//:go-tree-sitter", ++ "@com_github_stretchr_testify//assert", ++ ], ++) +diff --git a/markdown/BUILD.bazel b/markdown/BUILD.bazel +new file mode 100644 +index 0000000..65b2e30 +--- /dev/null ++++ b/markdown/BUILD.bazel +@@ -0,0 +1,22 @@ ++load("@io_bazel_rules_go//go:def.bzl", "go_library", "go_test") ++ ++go_library( ++ name = "markdown", ++ srcs = ["binding.go"], ++ importpath = "github.com/smacker/go-tree-sitter/markdown", ++ visibility = ["//visibility:public"], ++ deps = [ ++ "//:go-tree-sitter", ++ "//markdown/tree-sitter-markdown", ++ "//markdown/tree-sitter-markdown-inline", ++ ], ++) ++ ++go_test( ++ name = "markdown_test", ++ srcs = ["binding_test.go"], ++ deps = [ ++ ":markdown", ++ "@com_github_stretchr_testify//assert", ++ ], ++) +diff --git a/markdown/tree-sitter-markdown-inline/BUILD.bazel b/markdown/tree-sitter-markdown-inline/BUILD.bazel +new file mode 100644 +index 0000000..2fa6825 +--- /dev/null ++++ b/markdown/tree-sitter-markdown-inline/BUILD.bazel +@@ -0,0 +1,25 @@ ++load("@io_bazel_rules_go//go:def.bzl", "go_library", "go_test") ++ ++go_library( ++ name = "tree-sitter-markdown-inline", ++ srcs = [ ++ "binding.go", ++ "parser.c", ++ "parser.h", ++ "scanner.c", ++ ], ++ cgo = True, ++ importpath = "github.com/smacker/go-tree-sitter/markdown/tree-sitter-markdown-inline", ++ visibility = ["//visibility:public"], ++ deps = ["//:go-tree-sitter"], ++) ++ ++go_test( ++ name = "tree-sitter-markdown-inline_test", ++ srcs = ["bingding_test.go"], ++ deps = [ ++ ":tree-sitter-markdown-inline", ++ "//:go-tree-sitter", ++ "@com_github_stretchr_testify//assert", ++ ], ++) +diff --git a/markdown/tree-sitter-markdown/BUILD.bazel b/markdown/tree-sitter-markdown/BUILD.bazel +new file mode 100644 +index 0000000..b7ee9a7 +--- /dev/null ++++ b/markdown/tree-sitter-markdown/BUILD.bazel +@@ -0,0 +1,25 @@ ++load("@io_bazel_rules_go//go:def.bzl", "go_library", "go_test") ++ ++go_library( ++ name = "tree-sitter-markdown", ++ srcs = [ ++ "binding.go", ++ "parser.c", ++ "parser.h", ++ "scanner.c", ++ ], ++ cgo = True, ++ importpath = "github.com/smacker/go-tree-sitter/markdown/tree-sitter-markdown", ++ visibility = ["//visibility:public"], ++ deps = ["//:go-tree-sitter"], ++) ++ ++go_test( ++ name = "tree-sitter-markdown_test", ++ srcs = ["binding_test.go"], ++ deps = [ ++ ":tree-sitter-markdown", ++ "//:go-tree-sitter", ++ "@com_github_stretchr_testify//assert", ++ ], ++) +diff --git a/ocaml/BUILD.bazel b/ocaml/BUILD.bazel +new file mode 100644 +index 0000000..4fec113 +--- /dev/null ++++ b/ocaml/BUILD.bazel +@@ -0,0 +1,27 @@ ++load("@io_bazel_rules_go//go:def.bzl", "go_library", "go_test") ++ ++go_library( ++ name = "ocaml", ++ srcs = [ ++ "alloc.h", ++ "binding.go", ++ "parser.c", ++ "parser.h", ++ "scanner.c", ++ "scanner.h", ++ ], ++ cgo = True, ++ importpath = "github.com/smacker/go-tree-sitter/ocaml", ++ visibility = ["//visibility:public"], ++ deps = ["//:go-tree-sitter"], ++) ++ ++go_test( ++ name = "ocaml_test", ++ srcs = ["binding_test.go"], ++ deps = [ ++ ":ocaml", ++ "//:go-tree-sitter", ++ "@com_github_stretchr_testify//assert", ++ ], ++) +diff --git a/php/BUILD.bazel b/php/BUILD.bazel +new file mode 100644 +index 0000000..56775f0 +--- /dev/null ++++ b/php/BUILD.bazel +@@ -0,0 +1,26 @@ ++load("@io_bazel_rules_go//go:def.bzl", "go_library", "go_test") ++ ++go_library( ++ name = "php", ++ srcs = [ ++ "binding.go", ++ "parser.c", ++ "parser.h", ++ "scanner.c", ++ "scanner.h", ++ ], ++ cgo = True, ++ importpath = "github.com/smacker/go-tree-sitter/php", ++ visibility = ["//visibility:public"], ++ deps = ["//:go-tree-sitter"], ++) ++ ++go_test( ++ name = "php_test", ++ srcs = ["binding_test.go"], ++ deps = [ ++ ":php", ++ "//:go-tree-sitter", ++ "@com_github_stretchr_testify//assert", ++ ], ++) +diff --git a/protobuf/BUILD.bazel b/protobuf/BUILD.bazel +new file mode 100644 +index 0000000..8914bd5 +--- /dev/null ++++ b/protobuf/BUILD.bazel +@@ -0,0 +1,24 @@ ++load("@io_bazel_rules_go//go:def.bzl", "go_library", "go_test") ++ ++go_library( ++ name = "protobuf", ++ srcs = [ ++ "binding.go", ++ "parser.c", ++ "parser.h", ++ ], ++ cgo = True, ++ importpath = "github.com/smacker/go-tree-sitter/protobuf", ++ visibility = ["//visibility:public"], ++ deps = ["//:go-tree-sitter"], ++) ++ ++go_test( ++ name = "protobuf_test", ++ srcs = ["binding_test.go"], ++ deps = [ ++ ":protobuf", ++ "//:go-tree-sitter", ++ "@com_github_stretchr_testify//assert", ++ ], ++) +diff --git a/python/BUILD.bazel b/python/BUILD.bazel +new file mode 100644 +index 0000000..52c6fbc +--- /dev/null ++++ b/python/BUILD.bazel +@@ -0,0 +1,25 @@ ++load("@io_bazel_rules_go//go:def.bzl", "go_library", "go_test") ++ ++go_library( ++ name = "python", ++ srcs = [ ++ "binding.go", ++ "parser.c", ++ "parser.h", ++ "scanner.c", ++ ], ++ cgo = True, ++ importpath = "github.com/smacker/go-tree-sitter/python", ++ visibility = ["//visibility:public"], ++ deps = ["//:go-tree-sitter"], ++) ++ ++go_test( ++ name = "python_test", ++ srcs = ["binding_test.go"], ++ deps = [ ++ ":python", ++ "//:go-tree-sitter", ++ "@com_github_stretchr_testify//assert", ++ ], ++) +diff --git a/ruby/BUILD.bazel b/ruby/BUILD.bazel +new file mode 100644 +index 0000000..bd5ac03 +--- /dev/null ++++ b/ruby/BUILD.bazel +@@ -0,0 +1,25 @@ ++load("@io_bazel_rules_go//go:def.bzl", "go_library", "go_test") ++ ++go_library( ++ name = "ruby", ++ srcs = [ ++ "binding.go", ++ "parser.c", ++ "parser.h", ++ "scanner.c", ++ ], ++ cgo = True, ++ importpath = "github.com/smacker/go-tree-sitter/ruby", ++ visibility = ["//visibility:public"], ++ deps = ["//:go-tree-sitter"], ++) ++ ++go_test( ++ name = "ruby_test", ++ srcs = ["binding_test.go"], ++ deps = [ ++ ":ruby", ++ "//:go-tree-sitter", ++ "@com_github_stretchr_testify//assert", ++ ], ++) +diff --git a/rust/BUILD.bazel b/rust/BUILD.bazel +new file mode 100644 +index 0000000..58bfb5d +--- /dev/null ++++ b/rust/BUILD.bazel +@@ -0,0 +1,25 @@ ++load("@io_bazel_rules_go//go:def.bzl", "go_library", "go_test") ++ ++go_library( ++ name = "rust", ++ srcs = [ ++ "binding.go", ++ "parser.c", ++ "parser.h", ++ "scanner.c", ++ ], ++ cgo = True, ++ importpath = "github.com/smacker/go-tree-sitter/rust", ++ visibility = ["//visibility:public"], ++ deps = ["//:go-tree-sitter"], ++) ++ ++go_test( ++ name = "rust_test", ++ srcs = ["binding_test.go"], ++ deps = [ ++ ":rust", ++ "//:go-tree-sitter", ++ "@com_github_stretchr_testify//assert", ++ ], ++) +diff --git a/scala/BUILD.bazel b/scala/BUILD.bazel +new file mode 100644 +index 0000000..e06084c +--- /dev/null ++++ b/scala/BUILD.bazel +@@ -0,0 +1,26 @@ ++load("@io_bazel_rules_go//go:def.bzl", "go_library", "go_test") ++ ++go_library( ++ name = "scala", ++ srcs = [ ++ "binding.go", ++ "parser.c", ++ "parser.h", ++ "scanner.c", ++ "stack.h", ++ ], ++ cgo = True, ++ importpath = "github.com/smacker/go-tree-sitter/scala", ++ visibility = ["//visibility:public"], ++ deps = ["//:go-tree-sitter"], ++) ++ ++go_test( ++ name = "scala_test", ++ srcs = ["binding_test.go"], ++ deps = [ ++ ":scala", ++ "//:go-tree-sitter", ++ "@com_github_stretchr_testify//assert", ++ ], ++) +diff --git a/sql/BUILD.bazel b/sql/BUILD.bazel +new file mode 100644 +index 0000000..bd9b93b +--- /dev/null ++++ b/sql/BUILD.bazel +@@ -0,0 +1,24 @@ ++load("@io_bazel_rules_go//go:def.bzl", "go_library", "go_test") ++ ++go_library( ++ name = "sql", ++ srcs = [ ++ "binding.go", ++ "parser.c", ++ "scanner.c", ++ ], ++ cgo = True, ++ importpath = "github.com/smacker/go-tree-sitter/sql", ++ visibility = ["//visibility:public"], ++ deps = ["//:go-tree-sitter"], ++) ++ ++go_test( ++ name = "sql_test", ++ srcs = ["binding_test.go"], ++ deps = [ ++ ":sql", ++ "//:go-tree-sitter", ++ "@com_github_stretchr_testify//assert", ++ ], ++) +diff --git a/svelte/BUILD.bazel b/svelte/BUILD.bazel +new file mode 100644 +index 0000000..0343a1d +--- /dev/null ++++ b/svelte/BUILD.bazel +@@ -0,0 +1,30 @@ ++load("@io_bazel_rules_go//go:def.bzl", "go_library", "go_test") ++ ++go_library( ++ name = "svelte", ++ srcs = [ ++ "allocator.h", ++ "binding.go", ++ "ekstring.h", ++ "parser.c", ++ "parser.h", ++ "scanner.c", ++ "tag.h", ++ "uthash.h", ++ "vc_vector.h", ++ ], ++ cgo = True, ++ importpath = "github.com/smacker/go-tree-sitter/svelte", ++ visibility = ["//visibility:public"], ++ deps = ["//:go-tree-sitter"], ++) ++ ++go_test( ++ name = "svelte_test", ++ srcs = ["binding_test.go"], ++ deps = [ ++ ":svelte", ++ "//:go-tree-sitter", ++ "@com_github_stretchr_testify//assert", ++ ], ++) +diff --git a/swift/BUILD.bazel b/swift/BUILD.bazel +new file mode 100644 +index 0000000..980d91e +--- /dev/null ++++ b/swift/BUILD.bazel +@@ -0,0 +1,25 @@ ++load("@io_bazel_rules_go//go:def.bzl", "go_library", "go_test") ++ ++go_library( ++ name = "swift", ++ srcs = [ ++ "binding.go", ++ "parser.c", ++ "parser.h", ++ "scanner.c", ++ ], ++ cgo = True, ++ importpath = "github.com/smacker/go-tree-sitter/swift", ++ visibility = ["//visibility:public"], ++ deps = ["//:go-tree-sitter"], ++) ++ ++go_test( ++ name = "swift_test", ++ srcs = ["binding_test.go"], ++ deps = [ ++ ":swift", ++ "//:go-tree-sitter", ++ "@com_github_stretchr_testify//assert", ++ ], ++) +diff --git a/toml/BUILD.bazel b/toml/BUILD.bazel +new file mode 100644 +index 0000000..5ef9302 +--- /dev/null ++++ b/toml/BUILD.bazel +@@ -0,0 +1,25 @@ ++load("@io_bazel_rules_go//go:def.bzl", "go_library", "go_test") ++ ++go_library( ++ name = "toml", ++ srcs = [ ++ "binding.go", ++ "parser.c", ++ "parser.h", ++ "scanner.c", ++ ], ++ cgo = True, ++ importpath = "github.com/smacker/go-tree-sitter/toml", ++ visibility = ["//visibility:public"], ++ deps = ["//:go-tree-sitter"], ++) ++ ++go_test( ++ name = "toml_test", ++ srcs = ["binding_test.go"], ++ deps = [ ++ ":toml", ++ "//:go-tree-sitter", ++ "@com_github_stretchr_testify//assert", ++ ], ++) +diff --git a/typescript/tsx/BUILD.bazel b/typescript/tsx/BUILD.bazel +new file mode 100644 +index 0000000..5182f70 +--- /dev/null ++++ b/typescript/tsx/BUILD.bazel +@@ -0,0 +1,26 @@ ++load("@io_bazel_rules_go//go:def.bzl", "go_library", "go_test") ++ ++go_library( ++ name = "tsx", ++ srcs = [ ++ "binding.go", ++ "parser.c", ++ "parser.h", ++ "scanner.c", ++ "scanner.h", ++ ], ++ cgo = True, ++ importpath = "github.com/smacker/go-tree-sitter/typescript/tsx", ++ visibility = ["//visibility:public"], ++ deps = ["//:go-tree-sitter"], ++) ++ ++go_test( ++ name = "tsx_test", ++ srcs = ["binding_test.go"], ++ deps = [ ++ ":tsx", ++ "//:go-tree-sitter", ++ "@com_github_stretchr_testify//assert", ++ ], ++) +diff --git a/typescript/typescript/BUILD.bazel b/typescript/typescript/BUILD.bazel +new file mode 100644 +index 0000000..805c1c5 +--- /dev/null ++++ b/typescript/typescript/BUILD.bazel +@@ -0,0 +1,26 @@ ++load("@io_bazel_rules_go//go:def.bzl", "go_library", "go_test") ++ ++go_library( ++ name = "typescript", ++ srcs = [ ++ "binding.go", ++ "parser.c", ++ "parser.h", ++ "scanner.c", ++ "scanner.h", ++ ], ++ cgo = True, ++ importpath = "github.com/smacker/go-tree-sitter/typescript/typescript", ++ visibility = ["//visibility:public"], ++ deps = ["//:go-tree-sitter"], ++) ++ ++go_test( ++ name = "typescript_test", ++ srcs = ["binding_test.go"], ++ deps = [ ++ ":typescript", ++ "//:go-tree-sitter", ++ "@com_github_stretchr_testify//assert", ++ ], ++) +diff --git a/yaml/BUILD.bazel b/yaml/BUILD.bazel +new file mode 100644 +index 0000000..2bebea8 +--- /dev/null ++++ b/yaml/BUILD.bazel +@@ -0,0 +1,25 @@ ++load("@io_bazel_rules_go//go:def.bzl", "go_library", "go_test") ++ ++go_library( ++ name = "yaml", ++ srcs = [ ++ "binding.go", ++ "parser.c", ++ "parser.h", ++ "scanner.cc", ++ ], ++ cgo = True, ++ importpath = "github.com/smacker/go-tree-sitter/yaml", ++ visibility = ["//visibility:public"], ++ deps = ["//:go-tree-sitter"], ++) ++ ++go_test( ++ name = "yaml_test", ++ srcs = ["binding_test.go"], ++ deps = [ ++ ":yaml", ++ "//:go-tree-sitter", ++ "@com_github_stretchr_testify//assert", ++ ], ++) diff --git a/modules/go-tree-sitter/v0.0.0-20240827094217-dd81d9e9be82/patches/04_update_build_files.patch b/modules/go-tree-sitter/v0.0.0-20240827094217-dd81d9e9be82/patches/04_update_build_files.patch new file mode 100644 index 00000000000..7bbdfe6584d --- /dev/null +++ b/modules/go-tree-sitter/v0.0.0-20240827094217-dd81d9e9be82/patches/04_update_build_files.patch @@ -0,0 +1,293 @@ +commit 63f89cd3d471e7e81b51dc7e7205b201fed70fc1 +Author: Douglas Thor +Date: Thu Nov 21 04:55:12 2024 +0000 + + Update BUILD files to fully work + +diff --git a/BUILD.bazel b/BUILD.bazel +index 699c796..ff03bee 100644 +--- a/BUILD.bazel ++++ b/BUILD.bazel +@@ -4,6 +4,16 @@ load("@gazelle//:def.bzl", "gazelle") + # gazelle:prefix github.com/smacker/go-tree-sitter + gazelle(name = "gazelle") + ++filegroup( ++ name = "common_libs", ++ srcs = [ ++ "alloc.h", ++ "api.h", ++ "array.h", ++ ], ++ visibility = [":__subpackages__"], ++) ++ + go_library( + name = "go-tree-sitter", + srcs = [ +diff --git a/bash/BUILD.bazel b/bash/BUILD.bazel +index 3e627b6..f40cda0 100644 +--- a/bash/BUILD.bazel ++++ b/bash/BUILD.bazel +@@ -7,6 +7,7 @@ go_library( + "parser.c", + "parser.h", + "scanner.c", ++ "//:common_libs", + ], + cgo = True, + importpath = "github.com/smacker/go-tree-sitter/bash", +diff --git a/cpp/BUILD.bazel b/cpp/BUILD.bazel +index 4dd649a..321c9ce 100644 +--- a/cpp/BUILD.bazel ++++ b/cpp/BUILD.bazel +@@ -7,6 +7,7 @@ go_library( + "parser.c", + "parser.h", + "scanner.c", ++ "//:common_libs", + ], + cgo = True, + importpath = "github.com/smacker/go-tree-sitter/cpp", +diff --git a/csharp/BUILD.bazel b/csharp/BUILD.bazel +index d8995a6..5f42dc7 100644 +--- a/csharp/BUILD.bazel ++++ b/csharp/BUILD.bazel +@@ -7,6 +7,7 @@ go_library( + "parser.c", + "parser.h", + "scanner.c", ++ "//:common_libs", + ], + cgo = True, + copts = ["-Wno-trigraphs"], +diff --git a/css/BUILD.bazel b/css/BUILD.bazel +index 2d26337..a5cf63e 100644 +--- a/css/BUILD.bazel ++++ b/css/BUILD.bazel +@@ -7,6 +7,7 @@ go_library( + "parser.c", + "parser.h", + "scanner.c", ++ "//:common_libs", + ], + cgo = True, + importpath = "github.com/smacker/go-tree-sitter/css", +diff --git a/cue/BUILD.bazel b/cue/BUILD.bazel +index cc673af..69389ad 100644 +--- a/cue/BUILD.bazel ++++ b/cue/BUILD.bazel +@@ -7,6 +7,7 @@ go_library( + "parser.c", + "parser.h", + "scanner.c", ++ "//:common_libs", + ], + cgo = True, + importpath = "github.com/smacker/go-tree-sitter/cue", +diff --git a/dockerfile/BUILD.bazel b/dockerfile/BUILD.bazel +index 16fb48c..9fc9dad 100644 +--- a/dockerfile/BUILD.bazel ++++ b/dockerfile/BUILD.bazel +@@ -7,6 +7,7 @@ go_library( + "parser.c", + "parser.h", + "scanner.c", ++ "//:common_libs", + ], + cgo = True, + importpath = "github.com/smacker/go-tree-sitter/dockerfile", +diff --git a/elixir/BUILD.bazel b/elixir/BUILD.bazel +index 5a9e7bb..6770a81 100644 +--- a/elixir/BUILD.bazel ++++ b/elixir/BUILD.bazel +@@ -7,6 +7,7 @@ go_library( + "parser.c", + "parser.h", + "scanner.c", ++ "//:common_libs", + ], + cgo = True, + importpath = "github.com/smacker/go-tree-sitter/elixir", +diff --git a/elm/BUILD.bazel b/elm/BUILD.bazel +index d4e7a85..cfc3e0a 100644 +--- a/elm/BUILD.bazel ++++ b/elm/BUILD.bazel +@@ -7,6 +7,7 @@ go_library( + "parser.c", + "parser.h", + "scanner.c", ++ "//:common_libs", + ], + cgo = True, + cxxopts = ["-std=gnu++11"], +diff --git a/groovy/BUILD.bazel b/groovy/BUILD.bazel +index 6d319e8..198b4b2 100644 +--- a/groovy/BUILD.bazel ++++ b/groovy/BUILD.bazel +@@ -7,6 +7,7 @@ go_library( + "parser.c", + "parser.h", + "scanner.c", ++ "//:common_libs", + ], + cgo = True, + importpath = "github.com/smacker/go-tree-sitter/groovy", +diff --git a/hcl/BUILD.bazel b/hcl/BUILD.bazel +index da246d9..2a948a1 100644 +--- a/hcl/BUILD.bazel ++++ b/hcl/BUILD.bazel +@@ -7,6 +7,7 @@ go_library( + "parser.c", + "parser.h", + "scanner.c", ++ "//:common_libs", + ], + cgo = True, + importpath = "github.com/smacker/go-tree-sitter/hcl", +diff --git a/html/BUILD.bazel b/html/BUILD.bazel +index b0c80b9..1c79570 100644 +--- a/html/BUILD.bazel ++++ b/html/BUILD.bazel +@@ -8,6 +8,7 @@ go_library( + "parser.h", + "scanner.c", + "tag.h", ++ "//:common_libs", + ], + cgo = True, + importpath = "github.com/smacker/go-tree-sitter/html", +diff --git a/javascript/BUILD.bazel b/javascript/BUILD.bazel +index 2e96709..1251c4d 100644 +--- a/javascript/BUILD.bazel ++++ b/javascript/BUILD.bazel +@@ -7,6 +7,7 @@ go_library( + "parser.c", + "parser.h", + "scanner.c", ++ "//:common_libs", + ], + cgo = True, + importpath = "github.com/smacker/go-tree-sitter/javascript", +diff --git a/kotlin/BUILD.bazel b/kotlin/BUILD.bazel +index 37b959d..5ea86c8 100644 +--- a/kotlin/BUILD.bazel ++++ b/kotlin/BUILD.bazel +@@ -7,6 +7,7 @@ go_library( + "parser.c", + "parser.h", + "scanner.c", ++ "//:common_libs", + ], + cgo = True, + importpath = "github.com/smacker/go-tree-sitter/kotlin", +diff --git a/lua/BUILD.bazel b/lua/BUILD.bazel +index 2f44982..e259c36 100644 +--- a/lua/BUILD.bazel ++++ b/lua/BUILD.bazel +@@ -7,6 +7,7 @@ go_library( + "parser.c", + "parser.h", + "scanner.c", ++ "//:common_libs", + ], + cgo = True, + importpath = "github.com/smacker/go-tree-sitter/lua", +diff --git a/markdown/tree-sitter-markdown-inline/BUILD.bazel b/markdown/tree-sitter-markdown-inline/BUILD.bazel +index 2fa6825..edd9bd5 100644 +--- a/markdown/tree-sitter-markdown-inline/BUILD.bazel ++++ b/markdown/tree-sitter-markdown-inline/BUILD.bazel +@@ -7,6 +7,7 @@ go_library( + "parser.c", + "parser.h", + "scanner.c", ++ "//:common_libs", + ], + cgo = True, + importpath = "github.com/smacker/go-tree-sitter/markdown/tree-sitter-markdown-inline", +diff --git a/markdown/tree-sitter-markdown/BUILD.bazel b/markdown/tree-sitter-markdown/BUILD.bazel +index b7ee9a7..3877890 100644 +--- a/markdown/tree-sitter-markdown/BUILD.bazel ++++ b/markdown/tree-sitter-markdown/BUILD.bazel +@@ -7,6 +7,7 @@ go_library( + "parser.c", + "parser.h", + "scanner.c", ++ "//:common_libs", + ], + cgo = True, + importpath = "github.com/smacker/go-tree-sitter/markdown/tree-sitter-markdown", +diff --git a/php/BUILD.bazel b/php/BUILD.bazel +index 56775f0..e66c6d9 100644 +--- a/php/BUILD.bazel ++++ b/php/BUILD.bazel +@@ -8,6 +8,9 @@ go_library( + "parser.h", + "scanner.c", + "scanner.h", ++ "tree_sitter/alloc.h", ++ "tree_sitter/array.h", ++ "tree_sitter/parser.h", + ], + cgo = True, + importpath = "github.com/smacker/go-tree-sitter/php", +diff --git a/python/BUILD.bazel b/python/BUILD.bazel +index 52c6fbc..00245e3 100644 +--- a/python/BUILD.bazel ++++ b/python/BUILD.bazel +@@ -7,6 +7,7 @@ go_library( + "parser.c", + "parser.h", + "scanner.c", ++ "//:common_libs", + ], + cgo = True, + importpath = "github.com/smacker/go-tree-sitter/python", +diff --git a/ruby/BUILD.bazel b/ruby/BUILD.bazel +index bd5ac03..794ea52 100644 +--- a/ruby/BUILD.bazel ++++ b/ruby/BUILD.bazel +@@ -7,6 +7,7 @@ go_library( + "parser.c", + "parser.h", + "scanner.c", ++ "//:common_libs", + ], + cgo = True, + importpath = "github.com/smacker/go-tree-sitter/ruby", +diff --git a/rust/BUILD.bazel b/rust/BUILD.bazel +index 58bfb5d..20f8c8b 100644 +--- a/rust/BUILD.bazel ++++ b/rust/BUILD.bazel +@@ -7,6 +7,7 @@ go_library( + "parser.c", + "parser.h", + "scanner.c", ++ "//:common_libs", + ], + cgo = True, + importpath = "github.com/smacker/go-tree-sitter/rust", +diff --git a/scala/BUILD.bazel b/scala/BUILD.bazel +index e06084c..b0d400b 100644 +--- a/scala/BUILD.bazel ++++ b/scala/BUILD.bazel +@@ -8,6 +8,7 @@ go_library( + "parser.h", + "scanner.c", + "stack.h", ++ "//:common_libs", + ], + cgo = True, + importpath = "github.com/smacker/go-tree-sitter/scala", +diff --git a/sql/BUILD.bazel b/sql/BUILD.bazel +index bd9b93b..005eb99 100644 +--- a/sql/BUILD.bazel ++++ b/sql/BUILD.bazel +@@ -6,6 +6,7 @@ go_library( + "binding.go", + "parser.c", + "scanner.c", ++ "tree_sitter/parser.h", + ], + cgo = True, + importpath = "github.com/smacker/go-tree-sitter/sql", diff --git a/modules/go-tree-sitter/v0.0.0-20240827094217-dd81d9e9be82/patches/05_exports_files.patch b/modules/go-tree-sitter/v0.0.0-20240827094217-dd81d9e9be82/patches/05_exports_files.patch new file mode 100644 index 00000000000..80344e499fc --- /dev/null +++ b/modules/go-tree-sitter/v0.0.0-20240827094217-dd81d9e9be82/patches/05_exports_files.patch @@ -0,0 +1,22 @@ +commit 8470bc707f806291efd6f4e1f199c5c43df55000 +Author: Douglas Thor +Date: Thu Nov 21 20:55:56 2024 +0000 + + Add exports_files + +diff --git a/BUILD.bazel b/BUILD.bazel +index ff03bee..9af537d 100644 +--- a/BUILD.bazel ++++ b/BUILD.bazel +@@ -4,6 +4,11 @@ load("@gazelle//:def.bzl", "gazelle") + # gazelle:prefix github.com/smacker/go-tree-sitter + gazelle(name = "gazelle") + ++exports_files([ ++ "go.mod", ++ "go.sum", ++]) ++ + filegroup( + name = "common_libs", + srcs = [ diff --git a/modules/go-tree-sitter/v0.0.0-20240827094217-dd81d9e9be82/presubmit.yml b/modules/go-tree-sitter/v0.0.0-20240827094217-dd81d9e9be82/presubmit.yml new file mode 100644 index 00000000000..ff34d588054 --- /dev/null +++ b/modules/go-tree-sitter/v0.0.0-20240827094217-dd81d9e9be82/presubmit.yml @@ -0,0 +1,36 @@ +matrix: + platform: + - debian10 + - ubuntu2004 + - macos + - macos_arm64 + - windows + bazel: + - 7.x + - 6.x +tasks: + verify_targets: + name: Verify build targets + platform: ${{ platform }} + bazel: ${{ bazel }} + build_targets: + - '@go-tree-sittergolang:binding' +bcr_test_module: + module_path: golang/binding_test.go + matrix: + platform: + - debian10 + - ubuntu2004 + - macos + - macos_arm64 + - windows + bazel: + - 7.x + - 6.x + tasks: + run_test_module: + name: Run test module + platform: ${{ platform }} + bazel: ${{ bazel }} + test_targets: + - golang:binding_test diff --git a/modules/go-tree-sitter/v0.0.0-20240827094217-dd81d9e9be82/source.json b/modules/go-tree-sitter/v0.0.0-20240827094217-dd81d9e9be82/source.json new file mode 100644 index 00000000000..461621eaf4a --- /dev/null +++ b/modules/go-tree-sitter/v0.0.0-20240827094217-dd81d9e9be82/source.json @@ -0,0 +1,12 @@ +{ + "url": "https://github.com/smacker/go-tree-sitter/archive/dd81d9e9be82a8cac96ed1d50c7389c5f1997c02.zip", + "integrity": "sha256-4AkDY4Rh5Auu9Kwzhj5XYSirMLlhmd6ClMWo/r0kmu4=", + "patches": { + "01_add_module_file.patch": "sha256-MLWqZfFRWv8r+j2HSO9/6eH4hXmiRSPKk0SMKzsIK1Y=", + "02_add_root_build_file.patch": "sha256-KI30lwaPT+lq56XlkMU/F7TDpvgHRTSAPrjn9zWqj4w=", + "03_add_autogenerated_build_files.patch": "sha256-RwPOktelNUHpFMKwu698NA3pEh2C7U/N3ioz7AYn7EA=", + "04_update_build_files.patch": "sha256-2yDy5QL72xIrl6XhD/cffqte9oZnRCXeDTKIhHdBLKo=", + "05_exports_files.patch": "sha256-gw8RUvRnsZqZdP8H2O75eW+uTUDjTVSo6B8BlgBPDxw=" + }, + "patch_strip": 1 +}