mirror of
https://github.com/github/semantic.git
synced 2025-01-03 21:16:12 +03:00
Merge pull request #955 from github/external-scanners
Add ruby external scanners
This commit is contained in:
commit
ce6686bc3a
2
.gitignore
vendored
2
.gitignore
vendored
@ -27,3 +27,5 @@ vendor/icu/common/
|
||||
vendor/icu/bin/
|
||||
vendor/icu/Makefile
|
||||
bin/
|
||||
|
||||
languages/ruby/lib
|
||||
|
@ -3,4 +3,4 @@ module Text.Parser.TreeSitter.C where
|
||||
import Text.Parser.TreeSitter
|
||||
import Foreign.Ptr
|
||||
|
||||
foreign import ccall "vendor/tree-sitter-c/src/parser.c ts_language_c" ts_language_c :: Ptr Language
|
||||
foreign import ccall "vendor/tree-sitter-c/src/parser.c tree_sitter_c" tree_sitter_c :: Ptr Language
|
||||
|
2
languages/c/vendor/tree-sitter-c
vendored
2
languages/c/vendor/tree-sitter-c
vendored
@ -1 +1 @@
|
||||
Subproject commit e87026a962645ee225c12a75b1556293218e3f76
|
||||
Subproject commit 1e46713a228508ae83e2513b194647f6c508a17c
|
@ -3,4 +3,4 @@ module Text.Parser.TreeSitter.Go where
|
||||
import Text.Parser.TreeSitter
|
||||
import Foreign.Ptr
|
||||
|
||||
foreign import ccall "vendor/tree-sitter-go/src/parser.c ts_language_go" ts_language_go :: Ptr Language
|
||||
foreign import ccall "vendor/tree-sitter-go/src/parser.c tree_sitter_go" tree_sitter_go :: Ptr Language
|
||||
|
2
languages/go/vendor/tree-sitter-go
vendored
2
languages/go/vendor/tree-sitter-go
vendored
@ -1 +1 @@
|
||||
Subproject commit 0cc565e6aaedc0465b1e397cf8310d6ea8407dce
|
||||
Subproject commit af776b9c9575948775ec8a35ca80bb6d1f5f8638
|
@ -3,4 +3,4 @@ module Text.Parser.TreeSitter.JavaScript where
|
||||
import Text.Parser.TreeSitter
|
||||
import Foreign.Ptr
|
||||
|
||||
foreign import ccall "vendor/tree-sitter-javascript/src/parser.c ts_language_javascript" ts_language_javascript :: Ptr Language
|
||||
foreign import ccall "vendor/tree-sitter-javascript/src/parser.c tree_sitter_javascript" tree_sitter_javascript :: Ptr Language
|
||||
|
@ -1 +1 @@
|
||||
Subproject commit 97458010e5ab4b3f178998078c708ef7e9e910d1
|
||||
Subproject commit c3843f2e024e397e0a34eeb6d4bb00cc4b8f4140
|
@ -1,2 +1,55 @@
|
||||
import Distribution.Simple
|
||||
main = defaultMain
|
||||
import Distribution.PackageDescription
|
||||
import Distribution.Simple.Setup
|
||||
import Distribution.Simple.Utils
|
||||
import Distribution.Simple.LocalBuildInfo
|
||||
import Data.Maybe
|
||||
import System.Directory
|
||||
import Distribution.System
|
||||
import System.FilePath.Posix
|
||||
|
||||
main = defaultMainWithHooks simpleUserHooks {
|
||||
preConf = makeScannerLib,
|
||||
confHook = \a f -> confHook simpleUserHooks a f >>= updateExtraLibDirs,
|
||||
postCopy = copyScannerLib,
|
||||
postClean = cleanScannerLib
|
||||
}
|
||||
|
||||
makeScannerLib :: Args -> ConfigFlags -> IO HookedBuildInfo
|
||||
makeScannerLib _ flags = do
|
||||
let verbosity = fromFlag $ configVerbosity flags
|
||||
rawSystemExit verbosity "env" ["mkdir", "-p", "lib"]
|
||||
let flag = if buildOS == OSX then "-std=c++11" else "-std=c++0x"
|
||||
rawSystemExit verbosity "env" ["g++", flag, "-lstdc++", "-Ivendor/tree-sitter-ruby/src/", "-fPIC", "vendor/tree-sitter-ruby/src/scanner.cc", "-c", "-o", "lib/scanner.o"]
|
||||
rawSystemExit verbosity "env" ["ar", "rcvs", "lib/libscanner.a", "lib/scanner.o"]
|
||||
pure emptyHookedBuildInfo
|
||||
|
||||
updateExtraLibDirs :: LocalBuildInfo -> IO LocalBuildInfo
|
||||
updateExtraLibDirs localBuildInfo = do
|
||||
let packageDescription = localPkgDescr localBuildInfo
|
||||
lib = fromJust $ library packageDescription
|
||||
libBuild = libBuildInfo lib
|
||||
dir <- getCurrentDirectory
|
||||
pure localBuildInfo {
|
||||
localPkgDescr = packageDescription {
|
||||
library = Just $ lib {
|
||||
libBuildInfo = libBuild {
|
||||
extraLibDirs = (dir </> "lib") : extraLibDirs libBuild
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
copyScannerLib :: Args -> CopyFlags -> PackageDescription -> LocalBuildInfo -> IO ()
|
||||
copyScannerLib _ flags pkg_descr lbi = do
|
||||
let libPref = libdir . absoluteInstallDirs pkg_descr lbi
|
||||
. fromFlag . copyDest
|
||||
$ flags
|
||||
let verbosity = fromFlag $ copyVerbosity flags
|
||||
rawSystemExit verbosity "cp" ["lib/libscanner.a", libPref]
|
||||
|
||||
cleanScannerLib :: Args -> CleanFlags -> PackageDescription -> () -> IO ()
|
||||
cleanScannerLib _ flags _ _ = do
|
||||
let verbosity = fromFlag $ cleanVerbosity flags
|
||||
dir <- getCurrentDirectory
|
||||
rawSystemExit verbosity "env" ["rm", "-rf", dir </> "lib"]
|
||||
|
@ -7,7 +7,7 @@ author: semantic-code
|
||||
maintainer: tclem@github.com
|
||||
copyright: 2017 GitHub
|
||||
category: Web
|
||||
build-type: Simple
|
||||
build-type: Custom
|
||||
-- extra-source-files:
|
||||
cabal-version: >=1.10
|
||||
|
||||
@ -18,6 +18,7 @@ library
|
||||
, haskell-tree-sitter
|
||||
default-language: Haskell2010
|
||||
c-sources: vendor/tree-sitter-ruby/src/parser.c
|
||||
extra-libraries: scanner, stdc++
|
||||
|
||||
source-repository head
|
||||
type: git
|
||||
|
@ -3,4 +3,4 @@ module Text.Parser.TreeSitter.Ruby where
|
||||
import Text.Parser.TreeSitter
|
||||
import Foreign.Ptr
|
||||
|
||||
foreign import ccall "vendor/tree-sitter-ruby/src/parser.c ts_language_ruby" ts_language_ruby :: Ptr Language
|
||||
foreign import ccall "vendor/tree-sitter-ruby/src/parser.c tree_sitter_ruby" tree_sitter_ruby :: Ptr Language
|
||||
|
2
languages/ruby/vendor/tree-sitter-ruby
vendored
2
languages/ruby/vendor/tree-sitter-ruby
vendored
@ -1 +1 @@
|
||||
Subproject commit 95e3f84750fb6e8943d97518d5b9fa9cbdb4aa8b
|
||||
Subproject commit 5f71c72bb45586811436a4c3d2e3da12e3009283
|
@ -117,7 +117,9 @@ categoryForRubyName = \case
|
||||
"false" -> Boolean
|
||||
"float" -> NumberLiteral
|
||||
"for" -> For
|
||||
"formal_parameters" -> Params
|
||||
"method_parameters" -> Params
|
||||
"lambda_parameters" -> Params
|
||||
"block_parameters" -> Params
|
||||
"hash_splat_parameter" -> HashSplatParameter
|
||||
"hash" -> Object
|
||||
"identifier" -> Identifier
|
||||
|
@ -75,11 +75,11 @@ parserWithSource path blob = decorateTerm (termSourceDecorator (source blob)) <$
|
||||
-- | Return a parser based on the file extension (including the ".").
|
||||
parserForType :: Text -> Parser (Syntax Text) (Record '[Range, Category, SourceSpan])
|
||||
parserForType mediaType = case languageForType mediaType of
|
||||
Just C -> treeSitterParser C ts_language_c
|
||||
Just JavaScript -> treeSitterParser JavaScript ts_language_javascript
|
||||
Just C -> treeSitterParser C tree_sitter_c
|
||||
Just JavaScript -> treeSitterParser JavaScript tree_sitter_javascript
|
||||
Just Markdown -> cmarkParser
|
||||
Just Ruby -> treeSitterParser Ruby ts_language_ruby
|
||||
Just Language.Go -> treeSitterParser Language.Go ts_language_go
|
||||
Just Ruby -> treeSitterParser Ruby tree_sitter_ruby
|
||||
Just Language.Go -> treeSitterParser Language.Go tree_sitter_go
|
||||
_ -> lineByLineParser
|
||||
|
||||
-- | Decorate a 'Term' using a function to compute the annotation values at every node.
|
||||
|
File diff suppressed because it is too large
Load Diff
@ -51,8 +51,8 @@
|
||||
1
|
||||
],
|
||||
"end": [
|
||||
3,
|
||||
5
|
||||
4,
|
||||
1
|
||||
]
|
||||
}
|
||||
},
|
||||
@ -93,8 +93,8 @@
|
||||
1
|
||||
],
|
||||
"end": [
|
||||
3,
|
||||
5
|
||||
4,
|
||||
1
|
||||
]
|
||||
},
|
||||
{
|
||||
@ -157,8 +157,8 @@
|
||||
1
|
||||
],
|
||||
"end": [
|
||||
3,
|
||||
5
|
||||
4,
|
||||
1
|
||||
]
|
||||
}
|
||||
]
|
||||
@ -200,8 +200,8 @@
|
||||
1
|
||||
],
|
||||
"end": [
|
||||
3,
|
||||
5
|
||||
4,
|
||||
1
|
||||
]
|
||||
}
|
||||
},
|
||||
|
@ -35,7 +35,7 @@
|
||||
"+end"
|
||||
],
|
||||
"gitDir": "test/corpus/repos/ruby",
|
||||
"shas": "5458878541d4dbd326730893f8986cee3285d576..b73bf47832991c4a3399b47b1d27c657d861e609"
|
||||
"shas": "52a29dd44dc7f27db3f3279b39b4eae4d3ba98cb..ec0f0b058d56b9299fe3a429027d66082a797fc4"
|
||||
}
|
||||
,{
|
||||
"testCaseDescription": "ruby-method-declaration-required-keyword-param-replacement-insert-test",
|
||||
@ -93,7 +93,7 @@
|
||||
" end"
|
||||
],
|
||||
"gitDir": "test/corpus/repos/ruby",
|
||||
"shas": "b73bf47832991c4a3399b47b1d27c657d861e609..60fa8a2728763fdb9d2ffa8aa56bbfd2f6967f0b"
|
||||
"shas": "ec0f0b058d56b9299fe3a429027d66082a797fc4..f05fd9e0c9db3a9978f1bd1998905e2b11f3174b"
|
||||
}
|
||||
,{
|
||||
"testCaseDescription": "ruby-method-declaration-required-keyword-param-delete-insert-test",
|
||||
@ -135,7 +135,7 @@
|
||||
" end"
|
||||
],
|
||||
"gitDir": "test/corpus/repos/ruby",
|
||||
"shas": "60fa8a2728763fdb9d2ffa8aa56bbfd2f6967f0b..9646f88e1303a125db3c184abcc3a915db7779e5"
|
||||
"shas": "f05fd9e0c9db3a9978f1bd1998905e2b11f3174b..4c5b0ee021a2ceb825b4dbeb32f6d1fd14a2edc7"
|
||||
}
|
||||
,{
|
||||
"testCaseDescription": "ruby-method-declaration-required-keyword-param-replacement-test",
|
||||
@ -177,7 +177,7 @@
|
||||
" end"
|
||||
],
|
||||
"gitDir": "test/corpus/repos/ruby",
|
||||
"shas": "9646f88e1303a125db3c184abcc3a915db7779e5..9ce0060c2587e67bfc9ff2e9716b9cb56e1eb09c"
|
||||
"shas": "4c5b0ee021a2ceb825b4dbeb32f6d1fd14a2edc7..b5a1c874b43fae16b3cd23ba9729a0c406b255cc"
|
||||
}
|
||||
,{
|
||||
"testCaseDescription": "ruby-method-declaration-required-keyword-param-delete-replacement-test",
|
||||
@ -251,7 +251,7 @@
|
||||
" end"
|
||||
],
|
||||
"gitDir": "test/corpus/repos/ruby",
|
||||
"shas": "9ce0060c2587e67bfc9ff2e9716b9cb56e1eb09c..c5baaef18232cc643c8c8826e574d4c7842b2fd2"
|
||||
"shas": "b5a1c874b43fae16b3cd23ba9729a0c406b255cc..57ea4eeec323fe555cbf9c8fc28e5a1b59b58552"
|
||||
}
|
||||
,{
|
||||
"testCaseDescription": "ruby-method-declaration-required-keyword-param-delete-test",
|
||||
@ -292,7 +292,7 @@
|
||||
" end"
|
||||
],
|
||||
"gitDir": "test/corpus/repos/ruby",
|
||||
"shas": "c5baaef18232cc643c8c8826e574d4c7842b2fd2..adbc1e83473b1f4efe5207aa66caaf2ee9549c5d"
|
||||
"shas": "57ea4eeec323fe555cbf9c8fc28e5a1b59b58552..c5e286928850b92f6e22d635402db88ce6041030"
|
||||
}
|
||||
,{
|
||||
"testCaseDescription": "ruby-method-declaration-required-keyword-param-delete-rest-test",
|
||||
@ -331,5 +331,5 @@
|
||||
"-end"
|
||||
],
|
||||
"gitDir": "test/corpus/repos/ruby",
|
||||
"shas": "adbc1e83473b1f4efe5207aa66caaf2ee9549c5d..9feb37874cac5581ef001c084f185f8b5ff224ed"
|
||||
"shas": "c5e286928850b92f6e22d635402db88ce6041030..2564df555031825f37b8416fa96fa790ced587f1"
|
||||
}]
|
||||
|
@ -5,7 +5,7 @@
|
||||
"number.rb": [
|
||||
{
|
||||
"span": {
|
||||
"insert": {
|
||||
"delete": {
|
||||
"start": [
|
||||
1,
|
||||
1
|
||||
@ -16,11 +16,11 @@
|
||||
]
|
||||
}
|
||||
},
|
||||
"summary": "Added '1234'"
|
||||
"summary": "Deleted '1235'"
|
||||
},
|
||||
{
|
||||
"span": {
|
||||
"insert": {
|
||||
"delete": {
|
||||
"start": [
|
||||
2,
|
||||
1
|
||||
@ -31,11 +31,11 @@
|
||||
]
|
||||
}
|
||||
},
|
||||
"summary": "Added '1_234'"
|
||||
"summary": "Deleted '1_235'"
|
||||
},
|
||||
{
|
||||
"span": {
|
||||
"insert": {
|
||||
"delete": {
|
||||
"start": [
|
||||
3,
|
||||
1
|
||||
@ -46,11 +46,11 @@
|
||||
]
|
||||
}
|
||||
},
|
||||
"summary": "Added '0d1_234'"
|
||||
"summary": "Deleted '0d1_235'"
|
||||
},
|
||||
{
|
||||
"span": {
|
||||
"insert": {
|
||||
"delete": {
|
||||
"start": [
|
||||
4,
|
||||
1
|
||||
@ -61,11 +61,11 @@
|
||||
]
|
||||
}
|
||||
},
|
||||
"summary": "Added '0xa_bcd_ef0_123_456_789'"
|
||||
"summary": "Deleted '0xa_bcd_ef0_123_456_788'"
|
||||
},
|
||||
{
|
||||
"span": {
|
||||
"insert": {
|
||||
"delete": {
|
||||
"start": [
|
||||
5,
|
||||
1
|
||||
@ -76,11 +76,11 @@
|
||||
]
|
||||
}
|
||||
},
|
||||
"summary": "Added '0o1234567'"
|
||||
"summary": "Deleted '0o1234576'"
|
||||
},
|
||||
{
|
||||
"span": {
|
||||
"insert": {
|
||||
"delete": {
|
||||
"start": [
|
||||
6,
|
||||
1
|
||||
@ -91,11 +91,11 @@
|
||||
]
|
||||
}
|
||||
},
|
||||
"summary": "Added '0b1_0'"
|
||||
"summary": "Deleted '0b1_1'"
|
||||
},
|
||||
{
|
||||
"span": {
|
||||
"insert": {
|
||||
"delete": {
|
||||
"start": [
|
||||
7,
|
||||
1
|
||||
@ -106,7 +106,112 @@
|
||||
]
|
||||
}
|
||||
},
|
||||
"summary": "Added '1.234_5e678_90'"
|
||||
"summary": "Deleted '1.234_5e678_91'"
|
||||
},
|
||||
{
|
||||
"span": {
|
||||
"delete": {
|
||||
"start": [
|
||||
9,
|
||||
1
|
||||
],
|
||||
"end": [
|
||||
9,
|
||||
5
|
||||
]
|
||||
}
|
||||
},
|
||||
"summary": "Deleted '1234'"
|
||||
},
|
||||
{
|
||||
"span": {
|
||||
"delete": {
|
||||
"start": [
|
||||
10,
|
||||
1
|
||||
],
|
||||
"end": [
|
||||
10,
|
||||
6
|
||||
]
|
||||
}
|
||||
},
|
||||
"summary": "Deleted '1_234'"
|
||||
},
|
||||
{
|
||||
"span": {
|
||||
"delete": {
|
||||
"start": [
|
||||
11,
|
||||
1
|
||||
],
|
||||
"end": [
|
||||
11,
|
||||
8
|
||||
]
|
||||
}
|
||||
},
|
||||
"summary": "Deleted '0d1_234'"
|
||||
},
|
||||
{
|
||||
"span": {
|
||||
"delete": {
|
||||
"start": [
|
||||
12,
|
||||
1
|
||||
],
|
||||
"end": [
|
||||
12,
|
||||
24
|
||||
]
|
||||
}
|
||||
},
|
||||
"summary": "Deleted '0xa_bcd_ef0_123_456_789'"
|
||||
},
|
||||
{
|
||||
"span": {
|
||||
"delete": {
|
||||
"start": [
|
||||
13,
|
||||
1
|
||||
],
|
||||
"end": [
|
||||
13,
|
||||
10
|
||||
]
|
||||
}
|
||||
},
|
||||
"summary": "Deleted '0o1234567'"
|
||||
},
|
||||
{
|
||||
"span": {
|
||||
"delete": {
|
||||
"start": [
|
||||
14,
|
||||
1
|
||||
],
|
||||
"end": [
|
||||
14,
|
||||
6
|
||||
]
|
||||
}
|
||||
},
|
||||
"summary": "Deleted '0b1_0'"
|
||||
},
|
||||
{
|
||||
"span": {
|
||||
"delete": {
|
||||
"start": [
|
||||
15,
|
||||
1
|
||||
],
|
||||
"end": [
|
||||
15,
|
||||
15
|
||||
]
|
||||
}
|
||||
},
|
||||
"summary": "Deleted '1.234_5e678_90'"
|
||||
}
|
||||
]
|
||||
},
|
||||
@ -117,21 +222,32 @@
|
||||
],
|
||||
"patch": [
|
||||
"diff --git a/number.rb b/number.rb",
|
||||
"index e69de29..1a73a0e 100644",
|
||||
"index ed36c77..1a73a0e 100644",
|
||||
"--- a/number.rb",
|
||||
"+++ b/number.rb",
|
||||
"@@ -0,0 +1,8 @@",
|
||||
"+1234",
|
||||
"+1_234",
|
||||
"+0d1_234",
|
||||
"+0xa_bcd_ef0_123_456_789",
|
||||
"+0o1234567",
|
||||
"+0b1_0",
|
||||
"+1.234_5e678_90",
|
||||
"+"
|
||||
"@@ -1,19 +1,3 @@",
|
||||
"-1235",
|
||||
"-1_235",
|
||||
"-0d1_235",
|
||||
"-0xa_bcd_ef0_123_456_788",
|
||||
"-0o1234576",
|
||||
"-0b1_1",
|
||||
"-1.234_5e678_91",
|
||||
"-",
|
||||
"-1234",
|
||||
"-1_234",
|
||||
"-0d1_234",
|
||||
"-0xa_bcd_ef0_123_456_789",
|
||||
"-0o1234567",
|
||||
"-0b1_0",
|
||||
"-1.234_5e678_90",
|
||||
"-",
|
||||
" 1234",
|
||||
" 1_234",
|
||||
" 0d1_234"
|
||||
],
|
||||
"gitDir": "test/corpus/repos/ruby",
|
||||
"shas": "3345b250a3b074d0b3725cfa9ada030ac0733c03..b35c0ae4461db11b6bc1c00ce53aced00ee35f9f"
|
||||
"shas": "bf43f06516c04aef2a1ce9e432bf0df8958101ed..50a7bb73b3463e2544743eb5dcf5179f6fee7291"
|
||||
}
|
||||
,{
|
||||
"testCaseDescription": "ruby-number-replacement-insert-test",
|
||||
@ -247,7 +363,7 @@
|
||||
"span": {
|
||||
"insert": {
|
||||
"start": [
|
||||
8,
|
||||
9,
|
||||
1
|
||||
],
|
||||
"end": [
|
||||
@ -256,7 +372,7 @@
|
||||
]
|
||||
}
|
||||
},
|
||||
"summary": "Added '\n1234'"
|
||||
"summary": "Added '1234'"
|
||||
},
|
||||
{
|
||||
"span": {
|
||||
@ -290,30 +406,18 @@
|
||||
},
|
||||
{
|
||||
"span": {
|
||||
"replace": [
|
||||
{
|
||||
"start": [
|
||||
1,
|
||||
1
|
||||
],
|
||||
"end": [
|
||||
1,
|
||||
5
|
||||
]
|
||||
},
|
||||
{
|
||||
"start": [
|
||||
12,
|
||||
1
|
||||
],
|
||||
"end": [
|
||||
12,
|
||||
24
|
||||
]
|
||||
}
|
||||
]
|
||||
"insert": {
|
||||
"start": [
|
||||
12,
|
||||
1
|
||||
],
|
||||
"end": [
|
||||
12,
|
||||
24
|
||||
]
|
||||
}
|
||||
},
|
||||
"summary": "Replaced '1234' with '0xa_bcd_ef0_123_456_789'"
|
||||
"summary": "Added '0xa_bcd_ef0_123_456_789'"
|
||||
},
|
||||
{
|
||||
"span": {
|
||||
@ -359,21 +463,6 @@
|
||||
}
|
||||
},
|
||||
"summary": "Added '1.234_5e678_90'"
|
||||
},
|
||||
{
|
||||
"span": {
|
||||
"insert": {
|
||||
"start": [
|
||||
16,
|
||||
1
|
||||
],
|
||||
"end": [
|
||||
17,
|
||||
5
|
||||
]
|
||||
}
|
||||
},
|
||||
"summary": "Added '\n1234'"
|
||||
}
|
||||
]
|
||||
},
|
||||
@ -409,7 +498,7 @@
|
||||
" 0d1_234"
|
||||
],
|
||||
"gitDir": "test/corpus/repos/ruby",
|
||||
"shas": "b35c0ae4461db11b6bc1c00ce53aced00ee35f9f..722327896e7ef9a21676eca5e8eb6715e7401aa2"
|
||||
"shas": "50a7bb73b3463e2544743eb5dcf5179f6fee7291..aca5d08d02f79729a800d0b9c4e0c2663ae7ed87"
|
||||
}
|
||||
,{
|
||||
"testCaseDescription": "ruby-number-delete-insert-test",
|
||||
@ -658,7 +747,7 @@
|
||||
" 1_234"
|
||||
],
|
||||
"gitDir": "test/corpus/repos/ruby",
|
||||
"shas": "722327896e7ef9a21676eca5e8eb6715e7401aa2..d544881fc9626b821f44434f08e418475cf152de"
|
||||
"shas": "aca5d08d02f79729a800d0b9c4e0c2663ae7ed87..5675d08708803436bed00ddfa1d2893260e3e2c8"
|
||||
}
|
||||
,{
|
||||
"testCaseDescription": "ruby-number-replacement-test",
|
||||
@ -907,28 +996,13 @@
|
||||
" 1_234"
|
||||
],
|
||||
"gitDir": "test/corpus/repos/ruby",
|
||||
"shas": "d544881fc9626b821f44434f08e418475cf152de..67a6d066a1c1934842185072f8b4d14bed470dcd"
|
||||
"shas": "5675d08708803436bed00ddfa1d2893260e3e2c8..c007b52ad8b5f53a08d98dd3ed2921189030e735"
|
||||
}
|
||||
,{
|
||||
"testCaseDescription": "ruby-number-delete-replacement-test",
|
||||
"expectedResult": {
|
||||
"changes": {
|
||||
"number.rb": [
|
||||
{
|
||||
"span": {
|
||||
"insert": {
|
||||
"start": [
|
||||
1,
|
||||
1
|
||||
],
|
||||
"end": [
|
||||
1,
|
||||
5
|
||||
]
|
||||
}
|
||||
},
|
||||
"summary": "Added '1234'"
|
||||
},
|
||||
{
|
||||
"span": {
|
||||
"delete": {
|
||||
@ -1038,7 +1112,7 @@
|
||||
"span": {
|
||||
"delete": {
|
||||
"start": [
|
||||
8,
|
||||
9,
|
||||
1
|
||||
],
|
||||
"end": [
|
||||
@ -1047,7 +1121,7 @@
|
||||
]
|
||||
}
|
||||
},
|
||||
"summary": "Deleted '\n1234'"
|
||||
"summary": "Deleted '1234'"
|
||||
},
|
||||
{
|
||||
"span": {
|
||||
@ -1139,26 +1213,11 @@
|
||||
},
|
||||
"summary": "Deleted '1.234_5e678_90'"
|
||||
},
|
||||
{
|
||||
"span": {
|
||||
"delete": {
|
||||
"start": [
|
||||
16,
|
||||
1
|
||||
],
|
||||
"end": [
|
||||
17,
|
||||
5
|
||||
]
|
||||
}
|
||||
},
|
||||
"summary": "Deleted '\n1234'"
|
||||
},
|
||||
{
|
||||
"span": {
|
||||
"insert": {
|
||||
"start": [
|
||||
8,
|
||||
9,
|
||||
1
|
||||
],
|
||||
"end": [
|
||||
@ -1167,7 +1226,7 @@
|
||||
]
|
||||
}
|
||||
},
|
||||
"summary": "Added '\n1235'"
|
||||
"summary": "Added '1235'"
|
||||
},
|
||||
{
|
||||
"span": {
|
||||
@ -1304,28 +1363,13 @@
|
||||
" "
|
||||
],
|
||||
"gitDir": "test/corpus/repos/ruby",
|
||||
"shas": "67a6d066a1c1934842185072f8b4d14bed470dcd..c4ebf6bf580826410bf6f43b1cddb603f489e60f"
|
||||
"shas": "c007b52ad8b5f53a08d98dd3ed2921189030e735..4620a50dba65807c26a68f11001e74bf9cfa3560"
|
||||
}
|
||||
,{
|
||||
"testCaseDescription": "ruby-number-delete-test",
|
||||
"expectedResult": {
|
||||
"changes": {
|
||||
"number.rb": [
|
||||
{
|
||||
"span": {
|
||||
"insert": {
|
||||
"start": [
|
||||
1,
|
||||
1
|
||||
],
|
||||
"end": [
|
||||
1,
|
||||
5
|
||||
]
|
||||
}
|
||||
},
|
||||
"summary": "Added '1235'"
|
||||
},
|
||||
{
|
||||
"span": {
|
||||
"delete": {
|
||||
@ -1430,21 +1474,6 @@
|
||||
}
|
||||
},
|
||||
"summary": "Deleted '1.234_5e678_90'"
|
||||
},
|
||||
{
|
||||
"span": {
|
||||
"delete": {
|
||||
"start": [
|
||||
8,
|
||||
1
|
||||
],
|
||||
"end": [
|
||||
9,
|
||||
5
|
||||
]
|
||||
}
|
||||
},
|
||||
"summary": "Deleted '\n1235'"
|
||||
}
|
||||
]
|
||||
},
|
||||
@ -1472,7 +1501,7 @@
|
||||
" 0d1_235"
|
||||
],
|
||||
"gitDir": "test/corpus/repos/ruby",
|
||||
"shas": "c4ebf6bf580826410bf6f43b1cddb603f489e60f..2ff54d83dfd80eba661e8a5c4c7ed2b61d289e87"
|
||||
"shas": "4620a50dba65807c26a68f11001e74bf9cfa3560..e3453a3021a93a610510d6200f1e41600e7c1e45"
|
||||
}
|
||||
,{
|
||||
"testCaseDescription": "ruby-number-delete-rest-test",
|
||||
@ -1607,5 +1636,5 @@
|
||||
"-"
|
||||
],
|
||||
"gitDir": "test/corpus/repos/ruby",
|
||||
"shas": "2ff54d83dfd80eba661e8a5c4c7ed2b61d289e87..5063a6e97353e552c8a9a38f3cf69ef68790c3ab"
|
||||
"shas": "e3453a3021a93a610510d6200f1e41600e7c1e45..89c097f9e80701ff5aadf5bc16bccefb1a2dd88f"
|
||||
}]
|
||||
|
@ -34,7 +34,7 @@
|
||||
"+/^(foo|bar[^_])$/i"
|
||||
],
|
||||
"gitDir": "test/corpus/repos/ruby",
|
||||
"shas": "72d6e4e549ce17f88e6130002ccc0ecd6302fdf2..c3d9695417e6678a456a6692f3f708f3578a9cf2"
|
||||
"shas": "d873b65ce39ee8f41bdbdb381d42fa08d4d6828b..a81497514efad14130af67a6c59da3e38a203338"
|
||||
}
|
||||
,{
|
||||
"testCaseDescription": "ruby-regex-replacement-insert-test",
|
||||
@ -43,30 +43,48 @@
|
||||
"regex.rb": [
|
||||
{
|
||||
"span": {
|
||||
"replace": [
|
||||
{
|
||||
"start": [
|
||||
1,
|
||||
1
|
||||
],
|
||||
"end": [
|
||||
1,
|
||||
19
|
||||
]
|
||||
},
|
||||
{
|
||||
"start": [
|
||||
1,
|
||||
1
|
||||
],
|
||||
"end": [
|
||||
5,
|
||||
1
|
||||
]
|
||||
}
|
||||
]
|
||||
"insert": {
|
||||
"start": [
|
||||
1,
|
||||
1
|
||||
],
|
||||
"end": [
|
||||
1,
|
||||
6
|
||||
]
|
||||
}
|
||||
},
|
||||
"summary": "Replaced the '/^(foo|bar[^_])$/i' regex with '%r/a/\n%r<a<b>c>\n/^(foo|bar[^_])$/i\n/^(foo|bar[^_])$/i\n' at line 1, column 1 - line 5, column 1"
|
||||
"summary": "Added the '%r/a/' regex"
|
||||
},
|
||||
{
|
||||
"span": {
|
||||
"insert": {
|
||||
"start": [
|
||||
2,
|
||||
1
|
||||
],
|
||||
"end": [
|
||||
2,
|
||||
10
|
||||
]
|
||||
}
|
||||
},
|
||||
"summary": "Added the '%r<a<b>c>' regex"
|
||||
},
|
||||
{
|
||||
"span": {
|
||||
"insert": {
|
||||
"start": [
|
||||
3,
|
||||
1
|
||||
],
|
||||
"end": [
|
||||
3,
|
||||
19
|
||||
]
|
||||
}
|
||||
},
|
||||
"summary": "Added the '/^(foo|bar[^_])$/i' regex"
|
||||
}
|
||||
]
|
||||
},
|
||||
@ -87,7 +105,7 @@
|
||||
" /^(foo|bar[^_])$/i"
|
||||
],
|
||||
"gitDir": "test/corpus/repos/ruby",
|
||||
"shas": "c3d9695417e6678a456a6692f3f708f3578a9cf2..390ab71fc475ff76aa74e63dc827efa8d620fd7c"
|
||||
"shas": "a81497514efad14130af67a6c59da3e38a203338..2c4bff251c3af7f257db7e04b537d243dfd50b3f"
|
||||
}
|
||||
,{
|
||||
"testCaseDescription": "ruby-regex-delete-insert-test",
|
||||
@ -103,8 +121,8 @@
|
||||
1
|
||||
],
|
||||
"end": [
|
||||
5,
|
||||
1
|
||||
1,
|
||||
6
|
||||
]
|
||||
},
|
||||
{
|
||||
@ -119,7 +137,22 @@
|
||||
}
|
||||
]
|
||||
},
|
||||
"summary": "Replaced '%r/a/\n%r<a<b>c>\n/^(foo|bar[^_])$/i\n/^(foo|bar[^_])$/i\n' at line 1, column 1 - line 5, column 1 with the '/^(foo|bar[^_])$/i' regex"
|
||||
"summary": "Replaced the '%r/a/' regex with the '/^(foo|bar[^_])$/i' regex"
|
||||
},
|
||||
{
|
||||
"span": {
|
||||
"delete": {
|
||||
"start": [
|
||||
2,
|
||||
1
|
||||
],
|
||||
"end": [
|
||||
2,
|
||||
10
|
||||
]
|
||||
}
|
||||
},
|
||||
"summary": "Deleted the '%r<a<b>c>' regex"
|
||||
}
|
||||
]
|
||||
},
|
||||
@ -141,7 +174,7 @@
|
||||
" /^(foo|bar[^_])$/i"
|
||||
],
|
||||
"gitDir": "test/corpus/repos/ruby",
|
||||
"shas": "390ab71fc475ff76aa74e63dc827efa8d620fd7c..226f8b30f81ea0db57e79e1212adfc07130c6872"
|
||||
"shas": "2c4bff251c3af7f257db7e04b537d243dfd50b3f..202c9b305f328abb00348bf4fa60ddcaa685c98d"
|
||||
}
|
||||
,{
|
||||
"testCaseDescription": "ruby-regex-replacement-test",
|
||||
@ -167,13 +200,28 @@
|
||||
1
|
||||
],
|
||||
"end": [
|
||||
5,
|
||||
1
|
||||
1,
|
||||
6
|
||||
]
|
||||
}
|
||||
]
|
||||
},
|
||||
"summary": "Replaced the '/^(foo|bar[^_])$/i' regex with '%r/a/\n%r<a<b>c>\n/^(foo|bar[^_])$/i\n/^(foo|bar[^_])$/i\n' at line 1, column 1 - line 5, column 1"
|
||||
"summary": "Replaced the '/^(foo|bar[^_])$/i' regex with the '%r/a/' regex"
|
||||
},
|
||||
{
|
||||
"span": {
|
||||
"insert": {
|
||||
"start": [
|
||||
2,
|
||||
1
|
||||
],
|
||||
"end": [
|
||||
2,
|
||||
10
|
||||
]
|
||||
}
|
||||
},
|
||||
"summary": "Added the '%r<a<b>c>' regex"
|
||||
}
|
||||
]
|
||||
},
|
||||
@ -195,7 +243,7 @@
|
||||
" /^(foo|bar[^_])$/i"
|
||||
],
|
||||
"gitDir": "test/corpus/repos/ruby",
|
||||
"shas": "226f8b30f81ea0db57e79e1212adfc07130c6872..b8e98f854bb60e2823c562708c8ac5a4d4668d1e"
|
||||
"shas": "202c9b305f328abb00348bf4fa60ddcaa685c98d..76228a36df23d3d149aa5d30ba17ed62f5b05e46"
|
||||
}
|
||||
,{
|
||||
"testCaseDescription": "ruby-regex-delete-replacement-test",
|
||||
@ -204,30 +252,18 @@
|
||||
"regex.rb": [
|
||||
{
|
||||
"span": {
|
||||
"replace": [
|
||||
{
|
||||
"start": [
|
||||
1,
|
||||
1
|
||||
],
|
||||
"end": [
|
||||
5,
|
||||
1
|
||||
]
|
||||
},
|
||||
{
|
||||
"start": [
|
||||
1,
|
||||
1
|
||||
],
|
||||
"end": [
|
||||
1,
|
||||
19
|
||||
]
|
||||
}
|
||||
]
|
||||
"delete": {
|
||||
"start": [
|
||||
4,
|
||||
1
|
||||
],
|
||||
"end": [
|
||||
4,
|
||||
19
|
||||
]
|
||||
}
|
||||
},
|
||||
"summary": "Replaced '%r/a/\n%r<a<b>c>\n/^(foo|bar[^_])$/i\n/^(foo|bar[^_])$/i\n' at line 1, column 1 - line 5, column 1 with the '/^(foo|bar[^_])$/i' regex"
|
||||
"summary": "Deleted the '/^(foo|bar[^_])$/i' regex"
|
||||
}
|
||||
]
|
||||
},
|
||||
@ -249,7 +285,7 @@
|
||||
"-/^(foo|bar[^_])$/i"
|
||||
],
|
||||
"gitDir": "test/corpus/repos/ruby",
|
||||
"shas": "b8e98f854bb60e2823c562708c8ac5a4d4668d1e..e9466dc38a6269d4defca09ae238272e8b593087"
|
||||
"shas": "76228a36df23d3d149aa5d30ba17ed62f5b05e46..bb8882a6f19767910795de2881377a431902ea2c"
|
||||
}
|
||||
,{
|
||||
"testCaseDescription": "ruby-regex-delete-test",
|
||||
@ -289,13 +325,28 @@
|
||||
" %r<a<b>c>"
|
||||
],
|
||||
"gitDir": "test/corpus/repos/ruby",
|
||||
"shas": "e9466dc38a6269d4defca09ae238272e8b593087..5f3afced7715c5a7e7454ccf1817f4f3450def9f"
|
||||
"shas": "bb8882a6f19767910795de2881377a431902ea2c..9fc4528f1d251dfd14aff31ee7218848aacf54ec"
|
||||
}
|
||||
,{
|
||||
"testCaseDescription": "ruby-regex-delete-rest-test",
|
||||
"expectedResult": {
|
||||
"changes": {
|
||||
"regex.rb": [
|
||||
{
|
||||
"span": {
|
||||
"delete": {
|
||||
"start": [
|
||||
1,
|
||||
1
|
||||
],
|
||||
"end": [
|
||||
1,
|
||||
6
|
||||
]
|
||||
}
|
||||
},
|
||||
"summary": "Deleted the '%r/a/' regex"
|
||||
},
|
||||
{
|
||||
"span": {
|
||||
"delete": {
|
||||
@ -313,25 +364,7 @@
|
||||
}
|
||||
]
|
||||
},
|
||||
"errors": {
|
||||
"regex.rb": [
|
||||
{
|
||||
"span": {
|
||||
"delete": {
|
||||
"start": [
|
||||
1,
|
||||
1
|
||||
],
|
||||
"end": [
|
||||
1,
|
||||
6
|
||||
]
|
||||
}
|
||||
},
|
||||
"summary": "Deleted '%r/a/' at line 1, column 1 - line 1, column 6"
|
||||
}
|
||||
]
|
||||
}
|
||||
"errors": {}
|
||||
},
|
||||
"filePaths": [
|
||||
"regex.rb"
|
||||
@ -346,5 +379,5 @@
|
||||
"-%r<a<b>c>"
|
||||
],
|
||||
"gitDir": "test/corpus/repos/ruby",
|
||||
"shas": "5f3afced7715c5a7e7454ccf1817f4f3450def9f..38a4fc97908a2d22a188038b11a90fee2a3326eb"
|
||||
"shas": "9fc4528f1d251dfd14aff31ee7218848aacf54ec..c8a25ca0d6f2394e96b96d759ea4c21d2a5a12f7"
|
||||
}]
|
||||
|
@ -52,8 +52,8 @@
|
||||
1
|
||||
],
|
||||
"end": [
|
||||
4,
|
||||
5
|
||||
5,
|
||||
1
|
||||
]
|
||||
}
|
||||
},
|
||||
@ -95,8 +95,8 @@
|
||||
1
|
||||
],
|
||||
"end": [
|
||||
4,
|
||||
5
|
||||
5,
|
||||
1
|
||||
]
|
||||
},
|
||||
{
|
||||
@ -159,8 +159,8 @@
|
||||
1
|
||||
],
|
||||
"end": [
|
||||
4,
|
||||
5
|
||||
5,
|
||||
1
|
||||
]
|
||||
}
|
||||
]
|
||||
@ -202,8 +202,8 @@
|
||||
1
|
||||
],
|
||||
"end": [
|
||||
4,
|
||||
5
|
||||
5,
|
||||
1
|
||||
]
|
||||
}
|
||||
},
|
||||
|
@ -44,18 +44,7 @@
|
||||
"when.rb": [
|
||||
{
|
||||
"span": {
|
||||
"replace": [
|
||||
{
|
||||
"start": [
|
||||
1,
|
||||
1
|
||||
],
|
||||
"end": [
|
||||
3,
|
||||
1
|
||||
]
|
||||
},
|
||||
{
|
||||
"insert": {
|
||||
"start": [
|
||||
1,
|
||||
1
|
||||
@ -65,9 +54,8 @@
|
||||
4
|
||||
]
|
||||
}
|
||||
]
|
||||
},
|
||||
"summary": "Replaced 'case foo\nend\n' at line 1, column 1 - line 3, column 1 with the 'foo' case statement"
|
||||
"summary": "Added the 'foo' case statement"
|
||||
}
|
||||
]
|
||||
},
|
||||
@ -178,30 +166,18 @@
|
||||
"when.rb": [
|
||||
{
|
||||
"span": {
|
||||
"replace": [
|
||||
{
|
||||
"start": [
|
||||
1,
|
||||
1
|
||||
],
|
||||
"end": [
|
||||
3,
|
||||
4
|
||||
]
|
||||
},
|
||||
{
|
||||
"start": [
|
||||
1,
|
||||
1
|
||||
],
|
||||
"end": [
|
||||
3,
|
||||
1
|
||||
]
|
||||
}
|
||||
]
|
||||
"delete": {
|
||||
"start": [
|
||||
1,
|
||||
1
|
||||
],
|
||||
"end": [
|
||||
3,
|
||||
4
|
||||
]
|
||||
}
|
||||
},
|
||||
"summary": "Replaced the 'foo' case statement with 'case foo\nend\n' at line 1, column 1 - line 3, column 1"
|
||||
"summary": "Deleted the 'foo' case statement"
|
||||
}
|
||||
]
|
||||
},
|
||||
|
@ -1 +1 @@
|
||||
Subproject commit d873b65ce39ee8f41bdbdb381d42fa08d4d6828b
|
||||
Subproject commit 40ddeab1794ffd56578b63bcea8a678e08f5ece8
|
2
vendor/haskell-tree-sitter
vendored
2
vendor/haskell-tree-sitter
vendored
@ -1 +1 @@
|
||||
Subproject commit 548ef8d114c55c228ef52f02763feae538fdbbf5
|
||||
Subproject commit 8116ff5ec37cae106ed78771a9676057ad702b80
|
Loading…
Reference in New Issue
Block a user