rbi 0.0.17 → 0.1.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/Gemfile +1 -1
- data/lib/rbi/loc.rb +15 -0
- data/lib/rbi/parser.rb +596 -545
- data/lib/rbi/version.rb +1 -1
- metadata +7 -35
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 6a2cb2f6b2287a3faed50161d70e0c863892c88c6eef5a3c798ccf8e16e0c441
|
4
|
+
data.tar.gz: e851f3b85aa62534a3a1c867085add40aa7669df3b003f17e62eb81ce36c58ed
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: b566ecfc9c01ebf7524efb055302e3da780caf0e0cc3ab36bdca798ff8390cce5247bce1318c5373c8339fede498f3bc87ffd5071ace658880c0b3724a9f1d15
|
7
|
+
data.tar.gz: d95c6b6ea53cf84c348b2426b9bf10ad8213282f48ec9364cb9b1512aef9dd4c896d18c09c1dac79abe40f136194ab550571ac141e960eab61e4026bdbf3c578
|
data/Gemfile
CHANGED
@@ -10,7 +10,7 @@ group(:development, :test) do
|
|
10
10
|
gem("minitest")
|
11
11
|
gem("minitest-reporters")
|
12
12
|
gem("rake", "~> 13.0")
|
13
|
-
gem("rubocop", "~> 1.
|
13
|
+
gem("rubocop", "~> 1.56", require: false)
|
14
14
|
gem("rubocop-shopify", require: false)
|
15
15
|
gem("rubocop-sorbet", require: false)
|
16
16
|
gem("sorbet", ">= 0.5.9204", require: false)
|
data/lib/rbi/loc.rb
CHANGED
@@ -5,6 +5,21 @@ module RBI
|
|
5
5
|
class Loc
|
6
6
|
extend T::Sig
|
7
7
|
|
8
|
+
class << self
|
9
|
+
extend T::Sig
|
10
|
+
|
11
|
+
sig { params(file: String, yarp_location: YARP::Location).returns(Loc) }
|
12
|
+
def from_yarp(file, yarp_location)
|
13
|
+
new(
|
14
|
+
file: file,
|
15
|
+
begin_line: yarp_location.start_line,
|
16
|
+
end_line: yarp_location.end_line,
|
17
|
+
begin_column: yarp_location.start_column,
|
18
|
+
end_column: yarp_location.end_column + 1, # TODO: Why is this off by one?
|
19
|
+
)
|
20
|
+
end
|
21
|
+
end
|
22
|
+
|
8
23
|
sig { returns(T.nilable(String)) }
|
9
24
|
attr_reader :file
|
10
25
|
|