typeprof 0.21.7 → 0.21.8
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/.github/workflows/main.yml +1 -1
- data/.gitignore +0 -1
- data/Gemfile.lock +2 -2
- data/lib/typeprof/analyzer.rb +1 -1
- data/lib/typeprof/cli.rb +14 -5
- data/lib/typeprof/import.rb +1 -1
- data/lib/typeprof/lsp.rb +22 -0
- data/lib/typeprof/version.rb +1 -1
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 71c74382cb8602ed9c902218ec5066d20865cc8040e5af6737e8d8a0d19beca9
|
4
|
+
data.tar.gz: 2646a63cd334443a8dc716f99a5828fac960afdf80f8a0f8c8b5f289e6fb957d
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 9c0ca22252a4804152efafafb63c9c8d1d1fb2e796a9d17251f1634dc1393c7fcaac7f924d4a341a0699c5113c3fea8bb03714ceb287ded60bc7057cac7a640c
|
7
|
+
data.tar.gz: 899c481fc8a4a05787ab0e66064220b33b17f8f1f0f045b9a1d05d4ebdae1ea4cd62cfe552342588b5a2834491638303be5a2e05c4b00d99713fe4693a6c557a
|
data/.github/workflows/main.yml
CHANGED
data/.gitignore
CHANGED
data/Gemfile.lock
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
PATH
|
2
2
|
remote: .
|
3
3
|
specs:
|
4
|
-
typeprof (0.21.
|
4
|
+
typeprof (0.21.8)
|
5
5
|
rbs (>= 1.8.1)
|
6
6
|
|
7
7
|
GEM
|
@@ -11,7 +11,7 @@ GEM
|
|
11
11
|
docile (1.4.0)
|
12
12
|
power_assert (2.0.1)
|
13
13
|
rake (13.0.1)
|
14
|
-
rbs (3.0
|
14
|
+
rbs (3.2.0)
|
15
15
|
simplecov (0.21.2)
|
16
16
|
docile (~> 1.1)
|
17
17
|
simplecov-html (~> 0.11)
|
data/lib/typeprof/analyzer.rb
CHANGED
@@ -2273,7 +2273,7 @@ module TypeProf
|
|
2273
2273
|
_flag_args_fcall = flags[ 2] != 0
|
2274
2274
|
_flag_args_vcall = flags[ 3] != 0
|
2275
2275
|
_flag_args_simple = flags[ 4] != 0 # unused in TP
|
2276
|
-
|
2276
|
+
flags <<= 1 if RUBY_VERSION >= "3.3" # blockiseq flag was removed in 3.3
|
2277
2277
|
flag_args_kwarg = flags[ 6] != 0
|
2278
2278
|
flag_args_kw_splat = flags[ 7] != 0
|
2279
2279
|
_flag_tailcall = flags[ 8] != 0
|
data/lib/typeprof/cli.rb
CHANGED
@@ -23,7 +23,8 @@ module TypeProf
|
|
23
23
|
gem_rbs_features = []
|
24
24
|
show_version = false
|
25
25
|
max_sec = max_iter = nil
|
26
|
-
collection_path =
|
26
|
+
collection_path = nil
|
27
|
+
no_collection = false
|
27
28
|
|
28
29
|
load_path_ext = []
|
29
30
|
|
@@ -35,8 +36,8 @@ module TypeProf
|
|
35
36
|
opt.on("--version", "Display typeprof version") { show_version = true }
|
36
37
|
opt.on("-I DIR", "Add DIR to the load/require path") {|v| load_path_ext << v }
|
37
38
|
opt.on("-r FEATURE", "Require RBS of the FEATURE gem") {|v| gem_rbs_features << v }
|
38
|
-
opt.on("--collection PATH", "File path of collection configuration") { |v| collection_path = v }
|
39
|
-
opt.on("--no-collection", "Ignore collection configuration") {
|
39
|
+
opt.on("--collection PATH", "File path of collection configuration") { |v| collection_path = Pathname(v) }
|
40
|
+
opt.on("--no-collection", "Ignore collection configuration") { no_collection = true }
|
40
41
|
opt.on("--lsp", "LSP mode") {|v| options[:lsp] = true }
|
41
42
|
|
42
43
|
opt.separator ""
|
@@ -104,6 +105,14 @@ module TypeProf
|
|
104
105
|
raise OptionParser::InvalidOption.new("lsp options with non-lsp mode")
|
105
106
|
end
|
106
107
|
|
108
|
+
if !no_collection && collection_path && !collection_path.exist?
|
109
|
+
exit if show_version
|
110
|
+
raise OptionParser::InvalidOption.new("collection path not found (#{collection_path})")
|
111
|
+
end
|
112
|
+
|
113
|
+
collection_path ||= RBS::Collection::Config::PATH
|
114
|
+
collection_path = nil if no_collection
|
115
|
+
|
107
116
|
ConfigData.new(
|
108
117
|
rb_files: rb_files,
|
109
118
|
rbs_files: rbs_files,
|
@@ -118,9 +127,9 @@ module TypeProf
|
|
118
127
|
lsp_options: lsp_options,
|
119
128
|
)
|
120
129
|
|
121
|
-
rescue OptionParser::InvalidOption
|
130
|
+
rescue OptionParser::InvalidOption, OptionParser::MissingArgument
|
122
131
|
puts $!
|
123
|
-
exit
|
132
|
+
exit 1
|
124
133
|
end
|
125
134
|
end
|
126
135
|
end
|
data/lib/typeprof/import.rb
CHANGED
@@ -31,7 +31,7 @@ module TypeProf
|
|
31
31
|
lock_path = RBS::Collection::Config.to_lockfile_path(collection_path)
|
32
32
|
if lock_path.exist?
|
33
33
|
collection_lock = RBS::Collection::Config::Lockfile.from_lockfile(lockfile_path: lock_path, data: YAML.load_file(lock_path.to_s))
|
34
|
-
collection_lock.gems.
|
34
|
+
collection_lock.gems.each_value {|gem| @loaded_gems << gem[:name] }
|
35
35
|
loader.add_collection(collection_lock)
|
36
36
|
else
|
37
37
|
raise "Please execute 'rbs collection install'"
|
data/lib/typeprof/lsp.rb
CHANGED
@@ -352,6 +352,7 @@ module TypeProf
|
|
352
352
|
}
|
353
353
|
end
|
354
354
|
|
355
|
+
@server.send_notification('typeprof.enableToggleButton')
|
355
356
|
@server.send_request("workspace/codeLens/refresh")
|
356
357
|
|
357
358
|
@server.send_notification(
|
@@ -827,6 +828,13 @@ module TypeProf
|
|
827
828
|
end
|
828
829
|
end
|
829
830
|
|
831
|
+
module MessageType
|
832
|
+
Error = 1
|
833
|
+
Warning = 2
|
834
|
+
Info = 3
|
835
|
+
Log = 4
|
836
|
+
end
|
837
|
+
|
830
838
|
class Server
|
831
839
|
class Exit < StandardError; end
|
832
840
|
|
@@ -861,6 +869,20 @@ module TypeProf
|
|
861
869
|
end
|
862
870
|
end
|
863
871
|
rescue Exit
|
872
|
+
rescue => e
|
873
|
+
msg = "Tyeprof fatal error: #{e.message}"
|
874
|
+
send_notification(
|
875
|
+
'window/showMessage',
|
876
|
+
type: MessageType::Error,
|
877
|
+
message: msg
|
878
|
+
)
|
879
|
+
send_notification(
|
880
|
+
'window/logMessage',
|
881
|
+
type: MessageType::Error,
|
882
|
+
message: "#{msg} Backtrace: #{e.backtrace}"
|
883
|
+
)
|
884
|
+
send_notification('typeprof.showErrorStatus')
|
885
|
+
retry
|
864
886
|
end
|
865
887
|
|
866
888
|
def send_response(**msg)
|
data/lib/typeprof/version.rb
CHANGED
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: typeprof
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.21.
|
4
|
+
version: 0.21.8
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Yusuke Endoh
|
8
8
|
autorequire:
|
9
9
|
bindir: exe
|
10
10
|
cert_chain: []
|
11
|
-
date: 2023-
|
11
|
+
date: 2023-08-28 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: rbs
|