1
1
mirror of https://github.com/github/semantic.git synced 2024-11-22 23:29:37 +03:00

Pin to our tree-sitter-go.

This commit is contained in:
Patrick Thomson 2020-07-08 15:35:30 -04:00
parent ccdcd0a234
commit 35eb1dff46
3 changed files with 63 additions and 7 deletions

View File

@ -36,6 +36,12 @@ load(
"rules_haskell_toolchains",
)
git_repository(
name = "haskell-tree-sitter",
branch = "master",
remote = "https://github.com/tree-sitter/haskell-tree-sitter.git",
)
# Download a GHC binary distribution from haskell.org and register it as a toolchain.
rules_haskell_toolchains(version = "8.8.3")
@ -60,11 +66,16 @@ stack_snapshot(
"ansi-terminal",
"async",
"attoparsec",
"base",
"bazel-runfiles",
"bifunctors",
"bytestring",
"containers",
"deepseq",
"directory",
"directory-tree",
"doctest",
"filepath",
"foldl",
"fused-effects",
"fused-effects-exceptions",
@ -75,6 +86,7 @@ stack_snapshot(
"generic-lens",
"generic-monoid",
"hashable",
"haskeline",
"hedgehog",
"hostname",
"hscolour",
@ -93,6 +105,7 @@ stack_snapshot(
"pretty-simple",
"prettyprinter",
"prettyprinter-ansi-terminal",
"process",
"proto-lens",
"proto-lens-jsonpb",
"proto-lens-runtime",
@ -112,12 +125,13 @@ stack_snapshot(
"tasty-hedgehog",
"tasty-hspec",
"tasty-hunit",
"template-haskell",
"temporary",
"terminal-size",
"text",
"time",
"transformers",
"tree-sitter",
"tree-sitter-go",
"tree-sitter-java",
"tree-sitter-json",
"tree-sitter-php",
@ -135,6 +149,10 @@ stack_snapshot(
"yaml",
],
tools = ["@happy"],
vendored_packages = {
#"tree-sitter-python": "@tree-sitter-python//"
"tree-sitter-go": "@tree-sitter-go//:tree-sitter-go",
},
)
# Download Happy and make it accessible to the build process.
@ -155,9 +173,16 @@ haskell_cabal_binary(name = "happy", srcs = glob(["**"]), visibility = ["//visib
load(
"//:build/common.bzl",
"tree_sitter_node_types_git",
"tree_sitter_node_types_hackage",
"tree_sitter_node_types_release",
)
tree_sitter_node_types_hackage(
name = "tree-sitter-go",
sha256 = "364a0ae4e683bda1e348fa85c6828cad72122af155560b680f6052852d98db6c",
version = "0.5.0.1",
)
tree_sitter_node_types_release(
name = "tree-sitter-python",
sha256 = "50d3fa560391dc4ab8d9a3466f68f2c6a4c12f9cc6421358d2c307023bd740ab",
@ -182,11 +207,11 @@ tree_sitter_node_types_release(
version = "0.16.0",
)
tree_sitter_node_types_release(
name = "tree-sitter-go",
sha256 = "7278f1fd4dc4de8a13b0f60407425d38c5cb3973e1938d3031a68e1e69bd0b75",
version = "0.16.1",
)
# tree_sitter_node_types_release(
# name = "tree-sitter-go",
# sha256 = "7278f1fd4dc4de8a13b0f60407425d38c5cb3973e1938d3031a68e1e69bd0b75",
# version = "0.16.1",
# )
tree_sitter_node_types_release(
name = "tree-sitter-typescript",

View File

@ -70,6 +70,38 @@ def tree_sitter_node_types_git(name, commit, shallow_since):
shallow_since = shallow_since,
)
_attempt = """
package(default_visibility = ["//visibility:public"])
load("@rules_haskell//haskell:cabal.bzl", "haskell_cabal_library")
load("@stackage//:packages.bzl", "packages")
exports_files(glob(["**/node-types.json"]))
alias(
name = "src/node-types.json",
actual = ":vendor/{}/src/node-types.json",
)
haskell_cabal_library(
name = "{}",
version = packages["{}"].version,
srcs = glob(["**"]),
deps = packages["{}"].deps,
visibility = ["//visibility:public"],
)
filegroup(name = "corpus", srcs = glob(["**/corpus/*.txt"]))
"""
def tree_sitter_node_types_hackage(name, version, sha256):
http_archive(
name = name,
build_file_content = _attempt.format(name, name, name, name),
urls = ["https://hackage.haskell.org/package/{}-{}/{}-{}.tar.gz".format(name, version, name, version)],
strip_prefix = "{}-{}".format(name, version),
sha256 = sha256,
)
# These macros declare library targets inside the language packages.
def semantic_language_library(language, name, srcs, ts_package = "", nodetypes = ""):

View File

@ -17,7 +17,6 @@ packages:
- tree-sitter-python-0.9.0.2
- tree-sitter-ruby-0.5.0.2
- tree-sitter-rust-0.1.0.0
- tree-sitter-go-0.5.0.1
- tree-sitter-java-0.7.0.1
- tree-sitter-typescript-0.5.0.1
- tree-sitter-tsx-0.5.0.1