1
1
mirror of https://github.com/github/semantic.git synced 2025-01-08 08:30:27 +03:00

parse-examples seems to work

This commit is contained in:
Patrick Thomson 2020-06-27 13:42:43 -04:00
parent 335c3f728d
commit ac282c3135
4 changed files with 31 additions and 2 deletions

View File

@ -62,6 +62,7 @@ stack_snapshot(
"directory",
"directory-tree",
"doctest",
"foldl",
"fused-effects",
"fused-effects-exceptions",
"fused-effects-readline",
@ -98,6 +99,7 @@ stack_snapshot(
"raw-strings-qq",
"recursion-schemes",
"reducers",
"resourcet",
"safe-exceptions",
"scientific",
"semigroupoids",

View File

@ -264,7 +264,7 @@ instance ToTags Rb.Lhs where
Prj Rb.Call {ann = Loc {byteRange}, method} -> case method of
EPrj Rb.Identifier {text, ann} -> yieldCall text ann byteRange
EPrj Rb.Constant {text, ann} -> yieldCall text ann byteRange
EPrj Rb.Operator {text, ann} -> yieldCall text ann byteRangeg
EPrj Rb.Operator {text, ann} -> yieldCall text ann byteRange
_ -> gtags t
-- These do check for locals before yielding a call tag
Prj (Rb.Variable (Prj Rb.Identifier {ann = loc@Loc {byteRange}, text})) -> yield text P.CALL loc byteRange

View File

@ -168,3 +168,30 @@ haskell_test(
"@stackage//:tree-sitter",
],
)
haskell_test(
name = "parse-examples",
srcs = ["test/Examples.hs"],
compiler_flags = STANDARD_GHC_WARNINGS + STANDARD_EXECUTABLE_FLAGS + [
"-XStrictData",
],
data = glob(include = [
"test/fixtures/**/*.json",
"test/fixtures/go/**/*.go",
"test/fixtures/python/**/*.py",
"test/fixtures/ruby/**/*.rb",
"test/fixtures/javascript/**/*.js",
"test/fixtures/typescript/**/*.ts",
"test/fixtures/cli/*.json",
]),
deps = semantic_common_dependencies + [
"//:base",
"//semantic",
"//semantic-proto",
"@stackage//:Glob",
"@stackage//:bazel-runfiles",
"@stackage//:lens",
"@stackage//:tasty",
"@stackage//:tasty-hunit",
],
)

View File

@ -242,7 +242,7 @@ test-suite test
test-suite parse-examples
import: haskell, dependencies, executable-flags
type: exitcode-stdio-1.0
type:
hs-source-dirs: test
main-is: Examples.hs
build-depends: semantic