ruby / typeprof Goto Github PK
View Code? Open in Web Editor NEWAn experimental type-level Ruby interpreter for testing and understanding Ruby code
License: MIT License
An experimental type-level Ruby interpreter for testing and understanding Ruby code
License: MIT License
I seems to require a type variable(s).
Currently, TypeProf completely ignores Array[X]
of class Bar[X] < Foo[Array[X]]
.
class Foo[X]
def test_superclass: -> X
end
module M[X]
def test_module: -> X
end
class Bar[X] < Foo[Array[X]]
def initialize: (X) -> void
include M[Integer]
end
obj = Bar.new("str")
p obj #=> Foo[String]
p obj.test_superclass #=> expected: Array[String], actual: String
p obj.test_module #=> expected: Integer, actual: String
More practical example:
p({ a: 1 }.find { true }) #=> nil | untyped
because:
Enumerable[[K, V], Hash[K, V]]
.Enumerable#find
returns Elem?
. In this case, Elem
== [K, V]
Elem
== [K, V]
, so it replaces Elem
with untyped
While testing TypeProf, I tried different scenarios, and when using a one-line condition, I noticed that if there are 2 opposite one-line conditions, only the last one is taken in TypeProf's analysis.
def demo(arg)
{} if arg
[] unless arg
end
TypeProf analyze def demo: (untyped arg) -> Array[untyped]?
def demo2(arg)
return {} if arg
return [] unless arg
end
TypeProf analyze def demo2: (untyped arg) -> ((Array[untyped] | Hash[untyped, untyped])?)
Here are the scenarios in the playground:
https://mame.github.io/typeprof-playground/#rb=def+demo%28arg%29%0A++%7B%7D+if+arg%0A++%5B%5D+unless+arg%0Aend%0A%0Adef+demo2%28arg%29%0A++return+%7B%7D+if+arg%0A++return+%5B%5D+unless+arg%0Aend%0A%0A%0Adef+demo3%28arg%29%0A++arg+%3F+%7B%7D+%3A+%5B%5D%0Aend%0A%0Adef+demo4%28arg%29%0A++if+arg%0A++++%7B%7D%0A++else%0A++++%5B%5D%0A++end%0Aend&rbs=
Kinda // @ts-expect-error
feature.
# Prevent an error report in the next line
1 + "str" # tp-expected-error
I ran typeprof with rexml and it stuck.
https://github.com/ruby/rexml 2f019f9
It is not raising any errors, and probably the process is slow around Vertex#show
.
Sorry I don't have more information as I don't have time.
I will check it later for more information on the problem.
Example:
class AppResource
# def assign: (untyped apps, untyped collaborators) -> untyped
| (untyped apps, untyped collaborators) -> untyped
| (untyped apps, untyped invitations) -> untyped
end
The comment needs to be extended onto the wrapped lines
Recently, I found that the typeprof VSCode extension does not work correctly on lib/typeprof/
when using the latest master branch (50d2d7c). However, it works fine with the previous commit (b21905b).
The execution results of tool/dog_bench.rb
also reflect this behavior.
Given that the former results in an error and the latter succeeds, I am reporting this as a problem.
$ bundle exec ruby tool/dog_bench.rb
failed$ bundle exec ruby tool/dog_bench.rb ; echo $?
lib/typeprof/code_range.rb
lib/typeprof/core/ast/base.rb
/Users/hoshino/ghq/github.com/ruby/typeprof/lib/typeprof/core/env.rb:297:in `get_var': unhandled exception
from /Users/hoshino/ghq/github.com/ruby/typeprof/lib/typeprof/core/ast/control.rb:189:in `install0'
from /Users/hoshino/ghq/github.com/ruby/typeprof/lib/typeprof/core/ast/base.rb:93:in `install'
from /Users/hoshino/ghq/github.com/ruby/typeprof/lib/typeprof/core/ast/misc.rb:23:in `block in install0'
from /Users/hoshino/ghq/github.com/ruby/typeprof/lib/typeprof/core/ast/misc.rb:22:in `each'
from /Users/hoshino/ghq/github.com/ruby/typeprof/lib/typeprof/core/ast/misc.rb:22:in `install0'
from /Users/hoshino/ghq/github.com/ruby/typeprof/lib/typeprof/core/ast/base.rb:93:in `install'
from /Users/hoshino/ghq/github.com/ruby/typeprof/lib/typeprof/core/ast/control.rb:66:in `install0'
from /Users/hoshino/ghq/github.com/ruby/typeprof/lib/typeprof/core/ast/base.rb:93:in `install'
from /Users/hoshino/ghq/github.com/ruby/typeprof/lib/typeprof/core/ast/misc.rb:23:in `block in install0'
from /Users/hoshino/ghq/github.com/ruby/typeprof/lib/typeprof/core/ast/misc.rb:22:in `each'
from /Users/hoshino/ghq/github.com/ruby/typeprof/lib/typeprof/core/ast/misc.rb:22:in `install0'
from /Users/hoshino/ghq/github.com/ruby/typeprof/lib/typeprof/core/ast/base.rb:93:in `install'
from /Users/hoshino/ghq/github.com/ruby/typeprof/lib/typeprof/core/ast/control.rb:139:in `install0'
from /Users/hoshino/ghq/github.com/ruby/typeprof/lib/typeprof/core/ast/base.rb:93:in `install'
from /Users/hoshino/ghq/github.com/ruby/typeprof/lib/typeprof/core/ast/misc.rb:23:in `block in install0'
from /Users/hoshino/ghq/github.com/ruby/typeprof/lib/typeprof/core/ast/misc.rb:22:in `each'
from /Users/hoshino/ghq/github.com/ruby/typeprof/lib/typeprof/core/ast/misc.rb:22:in `install0'
from /Users/hoshino/ghq/github.com/ruby/typeprof/lib/typeprof/core/ast/base.rb:93:in `install'
from /Users/hoshino/ghq/github.com/ruby/typeprof/lib/typeprof/core/ast/method.rb:224:in `install0'
from /Users/hoshino/ghq/github.com/ruby/typeprof/lib/typeprof/core/ast/base.rb:93:in `install'
from /Users/hoshino/ghq/github.com/ruby/typeprof/lib/typeprof/core/ast/method.rb:189:in `install'
from /Users/hoshino/ghq/github.com/ruby/typeprof/lib/typeprof/core/ast/misc.rb:23:in `block in install0'
from /Users/hoshino/ghq/github.com/ruby/typeprof/lib/typeprof/core/ast/misc.rb:22:in `each'
from /Users/hoshino/ghq/github.com/ruby/typeprof/lib/typeprof/core/ast/misc.rb:22:in `install0'
from /Users/hoshino/ghq/github.com/ruby/typeprof/lib/typeprof/core/ast/base.rb:93:in `install'
from /Users/hoshino/ghq/github.com/ruby/typeprof/lib/typeprof/core/ast/module.rb:67:in `install0'
from /Users/hoshino/ghq/github.com/ruby/typeprof/lib/typeprof/core/ast/module.rb:113:in `install0'
from /Users/hoshino/ghq/github.com/ruby/typeprof/lib/typeprof/core/ast/base.rb:93:in `install'
from /Users/hoshino/ghq/github.com/ruby/typeprof/lib/typeprof/core/ast/misc.rb:23:in `block in install0'
from /Users/hoshino/ghq/github.com/ruby/typeprof/lib/typeprof/core/ast/misc.rb:22:in `each'
from /Users/hoshino/ghq/github.com/ruby/typeprof/lib/typeprof/core/ast/misc.rb:22:in `install0'
from /Users/hoshino/ghq/github.com/ruby/typeprof/lib/typeprof/core/ast/base.rb:93:in `install'
from /Users/hoshino/ghq/github.com/ruby/typeprof/lib/typeprof/core/ast/module.rb:67:in `install0'
from /Users/hoshino/ghq/github.com/ruby/typeprof/lib/typeprof/core/ast/module.rb:113:in `install0'
from /Users/hoshino/ghq/github.com/ruby/typeprof/lib/typeprof/core/ast/base.rb:93:in `install'
from /Users/hoshino/ghq/github.com/ruby/typeprof/lib/typeprof/core/ast/misc.rb:23:in `block in install0'
from /Users/hoshino/ghq/github.com/ruby/typeprof/lib/typeprof/core/ast/misc.rb:22:in `each'
from /Users/hoshino/ghq/github.com/ruby/typeprof/lib/typeprof/core/ast/misc.rb:22:in `install0'
from /Users/hoshino/ghq/github.com/ruby/typeprof/lib/typeprof/core/ast/base.rb:93:in `install'
from /Users/hoshino/ghq/github.com/ruby/typeprof/lib/typeprof/core/ast/module.rb:67:in `install0'
from /Users/hoshino/ghq/github.com/ruby/typeprof/lib/typeprof/core/ast/base.rb:93:in `install'
from /Users/hoshino/ghq/github.com/ruby/typeprof/lib/typeprof/core/ast/misc.rb:23:in `block in install0'
from /Users/hoshino/ghq/github.com/ruby/typeprof/lib/typeprof/core/ast/misc.rb:22:in `each'
from /Users/hoshino/ghq/github.com/ruby/typeprof/lib/typeprof/core/ast/misc.rb:22:in `install0'
from /Users/hoshino/ghq/github.com/ruby/typeprof/lib/typeprof/core/ast/base.rb:93:in `install'
from /Users/hoshino/ghq/github.com/ruby/typeprof/lib/typeprof/core/ast/base.rb:211:in `install0'
from /Users/hoshino/ghq/github.com/ruby/typeprof/lib/typeprof/core/ast/base.rb:93:in `install'
from /Users/hoshino/ghq/github.com/ruby/typeprof/lib/typeprof/core/service.rb:81:in `update_rb_file'
from tool/dog_bench.rb:10:in `block in main'
from <internal:dir>:411:in `glob'
from tool/dog_bench.rb:7:in `main'
from tool/dog_bench.rb:31:in `block in <main>'
from tool/dog_bench.rb:30:in `run'
from tool/dog_bench.rb:30:in `<main>'
1
$ bundle exec ruby tool/dog_bench.rb
succeeds$ bundle exec ruby tool/dog_bench.rb ; echo $?
lib/typeprof/code_range.rb
lib/typeprof/core/ast/base.rb
lib/typeprof/core/ast/call.rb
lib/typeprof/core/ast/const.rb
lib/typeprof/core/ast/control.rb
lib/typeprof/core/ast/meta.rb
lib/typeprof/core/ast/method.rb
lib/typeprof/core/ast/misc.rb
lib/typeprof/core/ast/module.rb
lib/typeprof/core/ast/sig_decl.rb
lib/typeprof/core/ast/sig_type.rb
lib/typeprof/core/ast/value.rb
lib/typeprof/core/ast/variable.rb
lib/typeprof/core/ast.rb
lib/typeprof/core/builtin.rb
lib/typeprof/core/env/method.rb
lib/typeprof/core/env/method_entity.rb
lib/typeprof/core/env/module_entity.rb
lib/typeprof/core/env/static_read.rb
lib/typeprof/core/env/type_alias_entity.rb
lib/typeprof/core/env/value_entity.rb
lib/typeprof/core/env.rb
lib/typeprof/core/graph/box.rb
lib/typeprof/core/graph/change_set.rb
lib/typeprof/core/graph/filter.rb
lib/typeprof/core/graph/vertex.rb
lib/typeprof/core/graph.rb
lib/typeprof/core/service.rb
lib/typeprof/core/type.rb
lib/typeprof/core/util.rb
lib/typeprof/core.rb
lib/typeprof/diagnostic.rb
lib/typeprof/version.rb
Elapsed: 0.708826
{TypeProf::Core::Type::Instance=>1822,
TypeProf::Core::Type::Singleton=>539,
TypeProf::Core::Type::Array=>615,
TypeProf::Core::Type::Proc=>1132,
TypeProf::Core::Type::Symbol=>464,
TypeProf::Core::Type::Hash=>135,
TypeProf::Core::Type::Bot=>1,
TypeProf::Core::Type::Var=>236}
0
I believe the following part of core/ast/base.rb
is causing typeprof to fail:
typeprof/lib/typeprof/core/ast/base.rb
Lines 26 to 28 in 50d2d7c
In other words, I think the program fails when it looks like this.
until (cond)
next
end
Ideally, I would have solved the root cause of the issue, but I was unable to do so ๐. Therefore, I created a PR marking it as a known issue. I would appreciate it if you could review it. #210 .
This change makes the tests pass, but currently, I am not fully sure what I am doing ๐ ๐
--- a/lib/typeprof/core/ast/control.rb
+++ b/lib/typeprof/core/ast/control.rb
@@ -186,7 +186,9 @@ module TypeProf::Core
def install0(genv)
@arg.install(genv)
- @lenv.add_next_box(@changes.add_escape_box(genv, @arg.ret, @lenv.get_var(:"*expected_block_ret")))
+ if @lenv.locals[:"*expected_block_ret"]
+ @lenv.add_next_box(@changes.add_escape_box(genv, @arg.ret, @lenv.get_var(:"*expected_block_ret")))
+ end
Source.new(Type::Bot.new(genv))
end
end
Customer = Struct.new(:name, :address) do
def greeting
"Hello #{name}!"
end
end
Generated:
class Object
private
def greeting: -> String
end
class Customer < Struct[untyped]
attr_accessor name(): untyped
attr_accessor address(): untyped
end
When trying to add types to complex ruby projects (e.g, Ruby on Rails), it will be hard to analyze correctly entire projects and we will need to add types manually.
But even if we specify types based on typeprof outpus, running typeprof again will override our manually typed files.
I think we need --exclude-untyped
options.
For example, I want to analyze Ruby on Rails projects like following steps.
FYI Pocke san's blog
git submodule add https://github.com/ruby/gem_rbs.git gem_rbs
)bin/rake rbs_rails:all
)--exlude-untyped
to analyze types (typeprof --exclude-untyped gem_rbs/gems/**/*.rbs sig/rbs_rails**/*.rbs app/models/*.rb -o sig/typeprof/models.rbs
)rbs prototype
(typeprof gem_rbs/gems/**/*.rbs sig/rbs_rails**/*.rbs sig/typeprof/models.rbs -o sig/manual/models.rbs
)sig/manual/models.rbs
manuallygem_rbs/gems/**/*.rbs
, sig/rbs_rails**/*.rbs
, sig/typeprof/*.rbs
, sig/manual/*.rbs
I noticed that I see a. weird error message when I execute typeprof
command with rbs_collection
settings.
Here's a reproduction repository:
https://github.com/okuramasafumi/typeprof-bug-repro
To reproduce this error, you can do such as:
$ tree
.
โโโ Gemfile
โโโ Gemfile.lock
โโโ rbs_collection.yaml
โโโ target.rb
Here is the log:
[vscode] Try to start TypeProf for IDE
[vscode] typeprof version: typeprof 0.21.4
[vscode] Starting Ruby TypeProf (typeprof 0.21.4)...
[Info - 11:06:55 PM] TypeProf for IDE is started successfully
[vscode] Ruby TypeProf is running
[Info - 11:06:55 PM] bundler: failed to load command: typeprof (/Users/s15236/.rbenv/versions/3.1.0/bin/typeprof)
[Info - 11:06:55 PM] Connection to server got closed. Server will restart.
[Info - 11:06:55 PM] <internal:ast>:67:in `of': Interrupt
[Info - 11:06:55 PM] from /Users/s15236/.rbenv/versions/3.1.0/lib/ruby/3.1.0/error_highlight/core_ext.rb:19:in `to_s'
[Info - 11:06:55 PM] from /Users/s15236/.rbenv/versions/3.1.0/lib/ruby/3.1.0/did_you_mean/core_ext/name_error.rb:15:in `to_s'
[Info - 11:06:55 PM] from /Users/s15236/.rbenv/versions/3.1.0/lib/ruby/gems/3.1.0/gems/bundler-2.3.15/lib/bundler/vendor/thor/lib/thor/command.rb:114:in `message'
[Info - 11:06:55 PM] from /Users/s15236/.rbenv/versions/3.1.0/lib/ruby/gems/3.1.0/gems/bundler-2.3.15/lib/bundler/vendor/thor/lib/thor/command.rb:114:in `handle_no_method_error?'
[Info - 11:06:55 PM] from /Users/s15236/.rbenv/versions/3.1.0/lib/ruby/gems/3.1.0/gems/bundler-2.3.15/lib/bundler/vendor/thor/lib/thor/command.rb:36:in `rescue in run'
[Info - 11:06:55 PM] from /Users/s15236/.rbenv/versions/3.1.0/lib/ruby/gems/3.1.0/gems/bundler-2.3.15/lib/bundler/vendor/thor/lib/thor/command.rb:20:in `run'
[Info - 11:06:55 PM] from /Users/s15236/.rbenv/versions/3.1.0/lib/ruby/gems/3.1.0/gems/bundler-2.3.15/lib/bundler/vendor/thor/lib/thor/invocation.rb:127:in `invoke_command'
[Info - 11:06:55 PM] from /Users/s15236/.rbenv/versions/3.1.0/lib/ruby/gems/3.1.0/gems/bundler-2.3.15/lib/bundler/vendor/thor/lib/thor.rb:392:in `dispatch'
[Info - 11:06:55 PM] from /Users/s15236/.rbenv/versions/3.1.0/lib/ruby/gems/3.1.0/gems/bundler-2.3.15/lib/bundler/cli.rb:31:in `dispatch'
[Info - 11:06:55 PM] from /Users/s15236/.rbenv/versions/3.1.0/lib/ruby/gems/3.1.0/gems/bundler-2.3.15/lib/bundler/vendor/thor/lib/thor/base.rb:485:in `start'
[Info - 11:06:55 PM] from /Users/s15236/.rbenv/versions/3.1.0/lib/ruby/gems/3.1.0/gems/bundler-2.3.15/lib/bundler/cli.rb:25:in `start'
[Info - 11:06:55 PM] from /Users/s15236/.rbenv/versions/3.1.0/lib/ruby/gems/3.1.0/gems/bundler-2.3.15/exe/bundle:48:in `block in <top (required)>'
[Info - 11:06:55 PM] from /Users/s15236/.rbenv/versions/3.1.0/lib/ruby/gems/3.1.0/gems/bundler-2.3.15/lib/bundler/friendly_errors.rb:117:in `with_friendly_errors'
[Info - 11:06:55 PM] from /Users/s15236/.rbenv/versions/3.1.0/lib/ruby/gems/3.1.0/gems/bundler-2.3.15/exe/bundle:36:in `<top (required)>'
[Info - 11:06:55 PM] from /Users/s15236/.rbenv/versions/3.1.0/bin/bundle:25:in `load'
[Info - 11:06:55 PM] from /Users/s15236/.rbenv/versions/3.1.0/bin/bundle:25:in `<main>'
[Info - 11:06:55 PM] /Users/s15236/.rbenv/versions/3.1.0/lib/ruby/gems/3.1.0/gems/typeprof-0.21.4/lib/typeprof/import.rb:10:in `initialize': undefined method `repo_path' for nil:NilClass (NoMethodError)
[Info - 11:06:55 PM]
[Info - 11:06:55 PM] @repo.add(collection_lock.repo_path)
[Info - 11:06:55 PM] ^^^^^^^^^^
[Info - 11:06:55 PM] from /Users/s15236/.rbenv/versions/3.1.0/lib/ruby/gems/3.1.0/gems/typeprof-0.21.4/lib/typeprof/analyzer.rb:306:in `new'
[Info - 11:06:55 PM] from /Users/s15236/.rbenv/versions/3.1.0/lib/ruby/gems/3.1.0/gems/typeprof-0.21.4/lib/typeprof/analyzer.rb:306:in `initialize'
[Info - 11:06:55 PM] from /Users/s15236/.rbenv/versions/3.1.0/lib/ruby/gems/3.1.0/gems/typeprof-0.21.4/lib/typeprof/config.rb:89:in `new'
[Info - 11:06:55 PM] from /Users/s15236/.rbenv/versions/3.1.0/lib/ruby/gems/3.1.0/gems/typeprof-0.21.4/lib/typeprof/config.rb:89:in `analyze'
[Info - 11:06:55 PM] from /Users/s15236/.rbenv/versions/3.1.0/lib/ruby/gems/3.1.0/gems/typeprof-0.21.4/lib/typeprof/lsp.rb:289:in `analyze'
[Info - 11:06:55 PM] from /Users/s15236/.rbenv/versions/3.1.0/lib/ruby/gems/3.1.0/gems/typeprof-0.21.4/lib/typeprof/lsp.rb:89:in `initialize'
[Info - 11:06:55 PM] from /Users/s15236/.rbenv/versions/3.1.0/lib/ruby/gems/3.1.0/gems/typeprof-0.21.4/lib/typeprof/lsp.rb:567:in `new'
[Info - 11:06:55 PM] from /Users/s15236/.rbenv/versions/3.1.0/lib/ruby/gems/3.1.0/gems/typeprof-0.21.4/lib/typeprof/lsp.rb:567:in `run'
[Info - 11:06:55 PM] from /Users/s15236/.rbenv/versions/3.1.0/lib/ruby/gems/3.1.0/gems/typeprof-0.21.4/lib/typeprof/lsp.rb:857:in `block in run'
[Info - 11:06:55 PM] from /Users/s15236/.rbenv/versions/3.1.0/lib/ruby/gems/3.1.0/gems/typeprof-0.21.4/lib/typeprof/lsp.rb:792:in `read'
[Info - 11:06:55 PM] from /Users/s15236/.rbenv/versions/3.1.0/lib/ruby/gems/3.1.0/gems/typeprof-0.21.4/lib/typeprof/lsp.rb:852:in `run'
[Info - 11:06:55 PM] from /Users/s15236/.rbenv/versions/3.1.0/lib/ruby/gems/3.1.0/gems/typeprof-0.21.4/lib/typeprof/lsp.rb:32:in `block (2 levels) in start_lsp_server'
[Info - 11:06:55 PM] from /Users/s15236/.rbenv/versions/3.1.0/lib/ruby/3.1.0/socket.rb:810:in `block (2 levels) in accept_loop'
[Info - 11:06:55 PM] from /Users/s15236/.rbenv/versions/3.1.0/lib/ruby/3.1.0/socket.rb:807:in `each'
[Info - 11:06:55 PM] from /Users/s15236/.rbenv/versions/3.1.0/lib/ruby/3.1.0/socket.rb:807:in `block in accept_loop'
[Info - 11:06:55 PM] from /Users/s15236/.rbenv/versions/3.1.0/lib/ruby/3.1.0/socket.rb:805:in `loop'
[Info - 11:06:55 PM] from /Users/s15236/.rbenv/versions/3.1.0/lib/ruby/3.1.0/socket.rb:805:in `accept_loop'
[Info - 11:06:55 PM] from /Users/s15236/.rbenv/versions/3.1.0/lib/ruby/gems/3.1.0/gems/typeprof-0.21.4/lib/typeprof/lsp.rb:27:in `block in start_lsp_server'
[Info - 11:06:55 PM] from /Users/s15236/.rbenv/versions/3.1.0/lib/ruby/3.1.0/socket.rb:782:in `tcp_server_sockets'
[Info - 11:06:55 PM] from /Users/s15236/.rbenv/versions/3.1.0/lib/ruby/gems/3.1.0/gems/typeprof-0.21.4/lib/typeprof/lsp.rb:16:in `start_lsp_server'
[Info - 11:06:55 PM] from /Users/s15236/.rbenv/versions/3.1.0/lib/ruby/gems/3.1.0/gems/typeprof-0.21.4/exe/typeprof:7:in `<top (required)>'
[Info - 11:06:55 PM] from /Users/s15236/.rbenv/versions/3.1.0/bin/typeprof:25:in `load'
[Info - 11:06:55 PM] from /Users/s15236/.rbenv/versions/3.1.0/bin/typeprof:25:in `<top (required)>'
[Info - 11:06:55 PM] from /Users/s15236/.rbenv/versions/3.1.0/lib/ruby/gems/3.1.0/gems/bundler-2.3.15/lib/bundler/cli/exec.rb:58:in `load'
[Info - 11:06:55 PM] from /Users/s15236/.rbenv/versions/3.1.0/lib/ruby/gems/3.1.0/gems/bundler-2.3.15/lib/bundler/cli/exec.rb:58:in `kernel_load'
[Info - 11:06:55 PM] from /Users/s15236/.rbenv/versions/3.1.0/lib/ruby/gems/3.1.0/gems/bundler-2.3.15/lib/bundler/cli/exec.rb:23:in `run'
[Info - 11:06:55 PM] from /Users/s15236/.rbenv/versions/3.1.0/lib/ruby/gems/3.1.0/gems/bundler-2.3.15/lib/bundler/cli.rb:483:in `exec'
[Info - 11:06:55 PM] from /Users/s15236/.rbenv/versions/3.1.0/lib/ruby/gems/3.1.0/gems/bundler-2.3.15/lib/bundler/vendor/thor/lib/thor/command.rb:27:in `run'
[Info - 11:06:55 PM] from /Users/s15236/.rbenv/versions/3.1.0/lib/ruby/gems/3.1.0/gems/bundler-2.3.15/lib/bundler/vendor/thor/lib/thor/invocation.rb:127:in `invoke_command'
[Info - 11:06:55 PM] from /Users/s15236/.rbenv/versions/3.1.0/lib/ruby/gems/3.1.0/gems/bundler-2.3.15/lib/bundler/vendor/thor/lib/thor.rb:392:in `dispatch'
[Info - 11:06:55 PM] from /Users/s15236/.rbenv/versions/3.1.0/lib/ruby/gems/3.1.0/gems/bundler-2.3.15/lib/bundler/cli.rb:31:in `dispatch'
[Info - 11:06:55 PM] from /Users/s15236/.rbenv/versions/3.1.0/lib/ruby/gems/3.1.0/gems/bundler-2.3.15/lib/bundler/vendor/thor/lib/thor/base.rb:485:in `start'
[Info - 11:06:55 PM] from /Users/s15236/.rbenv/versions/3.1.0/lib/ruby/gems/3.1.0/gems/bundler-2.3.15/lib/bundler/cli.rb:25:in `start'
[Info - 11:06:55 PM] from /Users/s15236/.rbenv/versions/3.1.0/lib/ruby/gems/3.1.0/gems/bundler-2.3.15/exe/bundle:48:in `block in <top (required)>'
[Info - 11:06:55 PM] from /Users/s15236/.rbenv/versions/3.1.0/lib/ruby/gems/3.1.0/gems/bundler-2.3.15/lib/bundler/friendly_errors.rb:117:in `with_friendly_errors'
[Info - 11:06:55 PM] from /Users/s15236/.rbenv/versions/3.1.0/lib/ruby/gems/3.1.0/gems/bundler-2.3.15/exe/bundle:36:in `<top (required)>'
[Info - 11:06:55 PM] from /Users/s15236/.rbenv/versions/3.1.0/bin/bundle:25:in `load'
[Info - 11:06:55 PM] from /Users/s15236/.rbenv/versions/3.1.0/bin/bundle:25:in `<main>'
ARGF.each {} #=> [error] undefined method: Object#each
Hello. I'm delighted to see such a fantastic tool being developed.
It would be beneficial to indicate the current extent of typeprof's syntax support. This would demonstrate the tool's usefulness and assist those interested in contributing (I am particularly focused on the latter).
This should ideally indicate the stages of support rather than just a checklist, but as a first step, I have marked the syntax that is at least partially supported.
In my specific case, it is overwriting the parent type with something overly specific:
class Base
@warnings_suppressed: bool
end
class Subclass < Base
@warnings_suppressed: bot
end
Rough code:
class Base
def initialize
@warnings_suppressed = false
end
def suppress_warnings!
tap { @warnings_suppressed = true }
end
def warn(message, event = nil)
return if @warnings_suppressed
puts message
end
end
class Subclass < Base
def do_stuff
warn("Something went wrong")
end
end
Please feel free to rename this issue to something more appropriate.
The following code causes an error when run through typeprof.
[].each_with_object({}) do |(key, value), acc|
acc[key] =
case value
when Array
:array
else
:other
end
end
/Users/peterwagenet/.rvm/gems/ruby-3.0.1/gems/typeprof-0.20.4/lib/typeprof/iseq.rb:824:in `check_send_branch': Unknown insn: #<struct TypeProf::ISeq::Insn insn=:getlocal_checkmatch_branch, operands=[[3, 0], [:if, 19]], lineno=nil, code_range=nil, definitions=nil> (RuntimeError)
from /Users/peterwagenet/.rvm/gems/ruby-3.0.1/gems/typeprof-0.20.4/lib/typeprof/iseq.rb:573:in `block in unify_instructions'
from /Users/peterwagenet/.rvm/gems/ruby-3.0.1/gems/typeprof-0.20.4/lib/typeprof/iseq.rb:567:in `times'
from /Users/peterwagenet/.rvm/gems/ruby-3.0.1/gems/typeprof-0.20.4/lib/typeprof/iseq.rb:567:in `unify_instructions'
from /Users/peterwagenet/.rvm/gems/ruby-3.0.1/gems/typeprof-0.20.4/lib/typeprof/iseq.rb:57:in `block in compile_core'
from /Users/peterwagenet/.rvm/gems/ruby-3.0.1/gems/typeprof-0.20.4/lib/typeprof/iseq.rb:56:in `each'
from /Users/peterwagenet/.rvm/gems/ruby-3.0.1/gems/typeprof-0.20.4/lib/typeprof/iseq.rb:56:in `compile_core'
from /Users/peterwagenet/.rvm/gems/ruby-3.0.1/gems/typeprof-0.20.4/lib/typeprof/iseq.rb:19:in `compile'
from /Users/peterwagenet/.rvm/gems/ruby-3.0.1/gems/typeprof-0.20.4/lib/typeprof/analyzer.rb:1020:in `type_profile'
from /Users/peterwagenet/.rvm/gems/ruby-3.0.1/gems/typeprof-0.20.4/lib/typeprof/config.rb:123:in `analyze'
from /Users/peterwagenet/.rvm/gems/ruby-3.0.1/gems/typeprof-0.20.4/exe/typeprof:9:in `<top (required)>'
from /Users/peterwagenet/.rvm/gems/ruby-3.0.1/bin/typeprof:23:in `load'
from /Users/peterwagenet/.rvm/gems/ruby-3.0.1/bin/typeprof:23:in `<main>'
Here is the log:
[vscode] Try to start TypeProf for IDE
[vscode] stderr: /System/Library/Frameworks/Ruby.framework/Versions/2.6/usr/lib/ruby/2.6.0/rubygems.rb:283:in `find_spec_for_exe': Could not find 'bundler' (2.3.15) required by your /Users/s15236/workspace/typeprof/vscode/src/test/simpleProgram/Gemfile.lock. (Gem::GemNotFoundException)
[vscode] stderr: To update to the latest version installed on your system, run `bundle update --bundler`.
[vscode] stderr: To install the missing version, run `gem install bundler:2.3.15`
[vscode] stderr: from /System/Library/Frameworks/Ruby.framework/Versions/2.6/usr/lib/ruby/2.6.0/rubygems.rb:302:in `activate_bin_path'
[vscode] stderr: from /usr/bin/bundle:23:in `<main>'
[vscode] failed to invoke typeprof: error code 1
My environment:
I created a simple blog application for the demo and I use VSCode.
When I open any file then the typeprof gem show warning and an error message but the app does not error any.
[warning] superclass is any; Object is used insteadTypeProf
[error] undefined method: singleton(PostsController)#before_actionTypeProf
Hi,
I'm trying to build typeprof 0.21.7 against ruby 3.1 but I'm getting errors from the tests:
(none):1: warning: possibly useless use of a literal in void context
Loaded suite /usr/lib/ruby/gems/3.1.0/gems/rake-13.0.6/lib/rake/rake_test_loader
Started
....F
===============================================================================
Failure: test: testbed/diff-lcs(TypeProf::DiffLCSTest): <nil> is not true.
/build/ruby-typeprof/src/typeprof-0.21.7/test/typeprof/diff-lcs_test.rb:20:in `block in <class:DiffLCSTest>'
17:
18: # No special reason to choose these two classes (Goodcheck::Analyzer and Trigger)
19:
=> 20: assert(actual =~ /^module Diff\n module LCS\n(?:(?: .*?\n|\n)*)^ end\n^end\n/)
21: assert_include($&, "def self.diff: (Array[T] | LCS seq1, Array[T] seq2, ?nil callbacks) ?{ (Array[Change] | Change | ContextChange) -> nil } -> (Array[(Array[Change?] | Change | ContextChange)?])")
22:
23: assert(actual =~ /^ class Change\n(?:(?: .*?\n|\n)*)^ end\n/)
===============================================================================
E
===============================================================================
Error: test: testbed/goodcheck(TypeProf::GoodcheckTest): Bundler::GemfileNotFound: /build/ruby-typeprof/src/typeprof-0.21.7/testbed/goodcheck/Gemfile not found
/usr/lib/ruby/3.1.0/bundler/definition.rb:36:in `build'
/usr/lib/ruby/3.1.0/bundler.rb:207:in `definition'
/usr/lib/ruby/3.1.0/bundler.rb:155:in `setup'
/build/ruby-typeprof/src/typeprof-0.21.7/test/typeprof/goodcheck_test.rb:34:in `block in <class:GoodcheckTest>'
===============================================================================(none):25: warning: possibly useless use of a constant in void context
path/to/file:25: warning: possibly useless use of a constant in void context
....TypeProf for IDE is started successfully
...........................................................................
...............................................................................
...............................................................................
............................................................................
Finished in 48.261118663 seconds.
-------------------------------------------------------------------------------
319 tests, 355 assertions, 1 failures, 1 errors, 0 pendings, 0 omissions, 0 notifications
99.373% passed
-------------------------------------------------------------------------------
6.61 tests/s, 7.36 assertions/s
rake aborted!
Any idea what is wrong?
Currently, the repository linked on the Ruby TypeProf extension page is pointing to https://github.com/mame/vscode-typeprof. I believe the extension has completely been moved into this repo, so I think the updated link should be https://github.com/ruby/typeprof/tree/master/vscode or https://github.com/ruby/typeprof.
Not a huge issue, but typeprof
sometimes repeats terms in unions.
Here's an example with Array[Vector] | Array[Vector]
Probably a beginner's question, but since Array
is covariant, shouldn't Array[Vector] | Array[untyped]
be simplified to Array[untyped]
?
I don't think these files are necessary or useful to ship in Ruby implementations, so it seems best to not include them in the .gem
.
$ tree /home/eregon/.rubies/ruby-3.0.2/lib/ruby/gems/3.0.0/gems/typeprof-0.12.0
/home/eregon/.rubies/ruby-3.0.2/lib/ruby/gems/3.0.0/gems/typeprof-0.12.0
โโโ doc
โย ย โโโ demo.md
โย ย โโโ doc.ja.md
โย ย โโโ doc.md
โย ย โโโ ppl2019.pdf
โย ย โโโ todo.md
โโโ exe
โย ย โโโ typeprof
โโโ Gemfile
โโโ Gemfile.lock
โโโ lib
โย ย โโโ typeprof
โย ย โย ย โโโ analyzer.rb
โย ย โย ย โโโ arguments.rb
โย ย โย ย โโโ block.rb
โย ย โย ย โโโ builtin.rb
โย ย โย ย โโโ cli.rb
โย ย โย ย โโโ config.rb
โย ย โย ย โโโ container-type.rb
โย ย โย ย โโโ export.rb
โย ย โย ย โโโ import.rb
โย ย โย ย โโโ insns-def.rb
โย ย โย ย โโโ iseq.rb
โย ย โย ย โโโ method.rb
โย ย โย ย โโโ type.rb
โย ย โย ย โโโ utils.rb
โย ย โย ย โโโ version.rb
โย ย โโโ typeprof.rb
โโโ LICENSE
โโโ Rakefile
โโโ README.md
โโโ smoke
โย ย โโโ alias2.rb
โย ย โโโ alias.rb
โย ย โโโ any1.rb
โย ย โโโ any2.rb
โย ย โโโ any-cbase.rb
โย ย โโโ arguments2.rb
โย ย โโโ arguments.rb
โย ย โโโ array10.rb
โย ย โโโ array11.rb
โย ย โโโ array12.rb
โย ย โโโ array13.rb
โย ย โโโ array14.rb
โย ย โโโ array15.rb
โย ย โโโ array1.rb
โย ย โโโ array2.rb
โย ย โโโ array3.rb
โย ย โโโ array4.rb
โย ย โโโ array5.rb
โย ย โโโ array6.rb
โย ย โโโ array7.rb
โย ย โโโ array8.rb
โย ย โโโ array9.rb
โย ย โโโ array-each2.rb
โย ย โโโ array-each3.rb
โย ย โโโ array-each.rb
โย ย โโโ array-ltlt2.rb
โย ย โโโ array-ltlt.rb
โย ย โโโ array-map2.rb
โย ย โโโ array-map3.rb
โย ย โโโ array-map.rb
โย ย โโโ array-mul.rb
โย ย โโโ array-plus1.rb
โย ย โโโ array-plus2.rb
โย ย โโโ array-pop.rb
โย ย โโโ array-range-aref.rb
โย ย โโโ array-replace.rb
โย ย โโโ array-s-aref.rb
โย ย โโโ attr-module.rb
โย ย โโโ attr.rb
โย ย โโโ attr-vis.rb
โย ย โโโ attr-vis.rbs
โย ย โโโ autoload.rb
โย ย โโโ backtrace.rb
โย ย โโโ block10.rb
โย ย โโโ block11.rb
โย ย โโโ block12.rb
โย ย โโโ block13.rb
โย ย โโโ block13.rbs
โย ย โโโ block14.rb
โย ย โโโ block1.rb
โย ย โโโ block2.rb
โย ย โโโ block3.rb
โย ย โโโ block4.rb
โย ย โโโ block5.rb
โย ย โโโ block6.rb
โย ย โโโ block7.rb
โย ย โโโ block8.rb
โย ย โโโ block9.rb
โย ย โโโ block-ambiguous.rb
โย ย โโโ block-args1.rb
โย ย โโโ block-args1-rest.rb
โย ย โโโ block-args2.rb
โย ย โโโ block-args2-rest.rb
โย ย โโโ block-args3.rb
โย ย โโโ block-args3-rest.rb
โย ย โโโ block-blockarg.rb
โย ย โโโ block_given.rb
โย ย โโโ block-kwarg.rb
โย ย โโโ blown.rb
โย ย โโโ break1.rb
โย ย โโโ break2.rb
โย ย โโโ break3.rb
โย ย โโโ case2.rb
โย ย โโโ case3.rb
โย ย โโโ case.rb
โย ย โโโ class-hierarchy2.rb
โย ย โโโ class-hierarchy.rb
โย ย โโโ class_instance_var.rb
โย ย โโโ class_method2.rb
โย ย โโโ class_method3.rb
โย ย โโโ class_method.rb
โย ย โโโ class-new.rb
โย ย โโโ class.rb
โย ย โโโ constant1.rb
โย ย โโโ constant2.rb
โย ย โโโ constant3.rb
โย ย โโโ constant4.rb
โย ย โโโ context-sensitive1.rb
โย ย โโโ cvar2.rb
โย ย โโโ cvar.rb
โย ย โโโ define_method2.rb
โย ย โโโ define_method3.rb
โย ย โโโ define_method3.rbs
โย ย โโโ define_method4.rb
โย ย โโโ define_method4.rbs
โย ย โโโ define_method5.rb
โย ย โโโ define_method6.rb
โย ย โโโ define_method.rb
โย ย โโโ demo10.rb
โย ย โโโ demo11.rb
โย ย โโโ demo1.rb
โย ย โโโ demo2.rb
โย ย โโโ demo3.rb
โย ย โโโ demo4.rb
โย ย โโโ demo5.rb
โย ย โโโ demo6.rb
โย ย โโโ demo7.rb
โย ย โโโ demo8.rb
โย ย โโโ demo9.rb
โย ย โโโ demo.rb
โย ย โโโ dummy_element.rb
โย ย โโโ dummy-execution1.rb
โย ย โโโ dummy-execution2.rb
โย ย โโโ ensure1.rb
โย ย โโโ enumerator.rb
โย ย โโโ enum_for2.rb
โย ย โโโ enum_for.rb
โย ย โโโ expandarray1.rb
โย ย โโโ expandarray2.rb
โย ย โโโ fib.rb
โย ย โโโ flip-flop.rb
โย ย โโโ flow10.rb
โย ย โโโ flow1.rb
โย ย โโโ flow2.rb
โย ย โโโ flow3.rb
โย ย โโโ flow4.rb
โย ย โโโ flow5.rb
โย ย โโโ flow6.rb
โย ย โโโ flow7.rb
โย ย โโโ flow8.rb
โย ย โโโ flow9.rb
โย ย โโโ for.rb
โย ย โโโ freeze.rb
โย ย โโโ function.rb
โย ย โโโ gvar2.rb
โย ย โโโ gvar2.rbs
โย ย โโโ gvar.rb
โย ย โโโ hash1.rb
โย ย โโโ hash2.rb
โย ย โโโ hash3.rb
โย ย โโโ hash4.rb
โย ย โโโ hash5.rb
โย ย โโโ hash-bot.rb
โย ย โโโ hash-fetch.rb
โย ย โโโ hash-merge-bang.rb
โย ย โโโ inheritance2.rb
โย ย โโโ inheritance.rb
โย ย โโโ initialize.rb
โย ย โโโ instance_eval2.rb
โย ย โโโ instance_eval3.rb
โย ย โโโ instance_eval.rb
โย ย โโโ integer.rb
โย ย โโโ int_times.rb
โย ย โโโ ivar2.rb
โย ย โโโ ivar3.rb
โย ย โโโ ivar3.rbs
โย ย โโโ ivar4.rb
โย ย โโโ ivar.rb
โย ย โโโ kernel-class.rb
โย ย โโโ keyword1.rb
โย ย โโโ keyword2.rb
โย ย โโโ keyword3.rb
โย ย โโโ keyword4.rb
โย ย โโโ keyword5.rb
โย ย โโโ kwrest.rb
โย ย โโโ kwrest.rbs
โย ย โโโ kwsplat1.rb
โย ย โโโ kwsplat2.rb
โย ย โโโ lit-complex.rb
โย ย โโโ lit-encoding.rb
โย ย โโโ manual-rbs2.rb
โย ย โโโ manual-rbs2.rbs
โย ย โโโ manual-rbs3.rb
โย ย โโโ manual-rbs3.rbs
โย ย โโโ manual-rbs.rb
โย ย โโโ manual-rbs.rbs
โย ย โโโ masgn1.rb
โย ย โโโ masgn2.rb
โย ย โโโ masgn3.rb
โย ย โโโ method_in_branch.rb
โย ย โโโ method_missing.rb
โย ย โโโ module1.rb
โย ย โโโ module2.rb
โย ย โโโ module3.rb
โย ย โโโ module4.rb
โย ย โโโ module5.rb
โย ย โโโ module6.rb
โย ย โโโ module_function1.rb
โย ย โโโ module_function2.rb
โย ย โโโ multiple-include.rb
โย ย โโโ multiple-superclass.rb
โย ย โโโ next1.rb
โย ย โโโ next2.rb
โย ย โโโ object-send1.rb
โย ย โโโ object-send2.rb
โย ย โโโ object-send3.rb
โย ย โโโ once.rb
โย ย โโโ optional1.rb
โย ย โโโ optional2.rb
โย ย โโโ optional3.rb
โย ย โโโ parameterizedd-self2.rb
โย ย โโโ parameterizedd-self.rb
โย ย โโโ pathname1.rb
โย ย โโโ pathname2.rb
โย ย โโโ pattern-match1.rb
โย ย โโโ pattern-match2.rb
โย ย โโโ prepend1.rb
โย ย โโโ prepend2.rb
โย ย โโโ prepend2.rbs
โย ย โโโ primitive_method.rb
โย ย โโโ printf.rb
โย ย โโโ proc2.rb
โย ย โโโ proc3.rb
โย ย โโโ proc4.rb
โย ย โโโ proc5.rb
โย ย โโโ proc.rb
โย ย โโโ public.rb
โย ย โโโ range.rb
โย ย โโโ rbs-alias.rb
โย ย โโโ rbs-alias.rbs
โย ย โโโ rbs-attr2.rb
โย ย โโโ rbs-attr2.rbs
โย ย โโโ rbs-attr.rb
โย ย โโโ rbs-attr.rbs
โย ย โโโ rbs-extend.rb
โย ย โโโ rbs-extend.rbs
โย ย โโโ rbs-interface.rb
โย ย โโโ rbs-interface.rbs
โย ย โโโ rbs-module.rb
โย ย โโโ rbs-module.rbs
โย ย โโโ rbs-opt-and-rest.rb
โย ย โโโ rbs-opt-and-rest.rbs
โย ย โโโ rbs-proc1.rb
โย ย โโโ rbs-proc1.rbs
โย ย โโโ rbs-proc2.rb
โย ย โโโ rbs-proc2.rbs
โย ย โโโ rbs-proc3.rb
โย ย โโโ rbs-proc3.rbs
โย ย โโโ rbs-record.rb
โย ย โโโ rbs-record.rbs
โย ย โโโ rbs-tyvar2.rb
โย ย โโโ rbs-tyvar2.rbs
โย ย โโโ rbs-tyvar3.rb
โย ย โโโ rbs-tyvar3.rbs
โย ย โโโ rbs-tyvar4.rb
โย ย โโโ rbs-tyvar5.rb
โย ย โโโ rbs-tyvar5.rbs
โย ย โโโ rbs-tyvar6.rb
โย ย โโโ rbs-tyvar6.rbs
โย ย โโโ rbs-tyvar7.rb
โย ย โโโ rbs-tyvar7.rbs
โย ย โโโ rbs-tyvar.rb
โย ย โโโ rbs-tyvar.rbs
โย ย โโโ rbs-vars.rb
โย ย โโโ rbs-vars.rbs
โย ย โโโ redo1.rb
โย ย โโโ redo2.rb
โย ย โโโ req-keyword.rb
โย ย โโโ rescue1.rb
โย ย โโโ rescue2.rb
โย ย โโโ rescue3.rb
โย ย โโโ rescue4.rb
โย ย โโโ respond_to.rb
โย ย โโโ rest1.rb
โย ย โโโ rest2.rb
โย ย โโโ rest3.rb
โย ย โโโ rest4.rb
โย ย โโโ rest5.rb
โย ย โโโ rest6.rb
โย ย โโโ rest-farg.rb
โย ย โโโ retry1.rb
โย ย โโโ return.rb
โย ย โโโ reveal.rb
โย ย โโโ simple.rb
โย ย โโโ singleton_class.rb
โย ย โโโ singleton_method.rb
โย ย โโโ step.rb
โย ย โโโ string-split.rb
โย ย โโโ struct2.rb
โย ย โโโ struct3.rb
โย ย โโโ struct4.rb
โย ย โโโ struct5.rb
โย ย โโโ struct6.rb
โย ย โโโ struct7.rb
โย ย โโโ struct-keyword_init.rb
โย ย โโโ struct.rb
โย ย โโโ stub-keyword.rb
โย ย โโโ super1.rb
โย ย โโโ super2.rb
โย ย โโโ super3.rb
โย ย โโโ super4.rb
โย ย โโโ super5.rb
โย ย โโโ svar1.rb
โย ย โโโ symbol-proc-attr2.rb
โย ย โโโ symbol-proc-attr.rb
โย ย โโโ symbol-proc-bot.rb
โย ย โโโ symbol-proc.rb
โย ย โโโ tap1.rb
โย ย โโโ toplevel.rb
โย ย โโโ two-map.rb
โย ย โโโ typed_method.rb
โย ย โโโ type_var.rb
โย ย โโโ uninitialize-var.rb
โย ย โโโ union-recv.rb
โย ย โโโ user-demo.rb
โย ย โโโ wrong-extend.rb
โย ย โโโ wrong-include2.rb
โย ย โโโ wrong-include.rb
โย ย โโโ wrong-rbs.rb
โย ย โโโ wrong-rbs.rbs
โโโ testbed
โย ย โโโ ao.rb
โย ย โโโ diff-lcs-entrypoint.rb
โย ย โโโ goodcheck-Gemfile.lock
โโโ tools
โโโ coverage.rb
โโโ setup-insns-def.rb
7 directories, 342 files
define_singleton_method
define_method
{local,thread,instance,class}_variable_{set,get}
Receiving check errors because defined methods parameters are untyped.
A file with the following causes a crash
require 'uri/generic'
require 'uri'
/Users/peterwagenet/Development/Ruby/typeprof/lib/typeprof/analyzer.rb:1252:in `block (2 levels) in get_instance_variable': undefined method `detailed_source_location' for nil:NilClass (NoMethodError)
from /Users/peterwagenet/Development/Ruby/typeprof/lib/typeprof/analyzer.rb:1245:in `each'
from /Users/peterwagenet/Development/Ruby/typeprof/lib/typeprof/analyzer.rb:1245:in `block in get_instance_variable'
from /Users/peterwagenet/Development/Ruby/typeprof/lib/typeprof/analyzer.rb:851:in `block in add_write!'
from /Users/peterwagenet/Development/Ruby/typeprof/lib/typeprof/analyzer.rb:850:in `each'
from /Users/peterwagenet/Development/Ruby/typeprof/lib/typeprof/analyzer.rb:850:in `add_write!'
from /Users/peterwagenet/Development/Ruby/typeprof/lib/typeprof/analyzer.rb:896:in `block in add_ivar_write!'
from /Users/peterwagenet/Development/Ruby/typeprof/lib/typeprof/type.rb:90:in `each_child'
from /Users/peterwagenet/Development/Ruby/typeprof/lib/typeprof/analyzer.rb:892:in `add_ivar_write!'
from /Users/peterwagenet/Development/Ruby/typeprof/lib/typeprof/import.rb:611:in `block (2 levels) in import'
from /Users/peterwagenet/Development/Ruby/typeprof/lib/typeprof/import.rb:606:in `each'
from /Users/peterwagenet/Development/Ruby/typeprof/lib/typeprof/import.rb:606:in `block in import'
from /Users/peterwagenet/Development/Ruby/typeprof/lib/typeprof/import.rb:577:in `each'
from /Users/peterwagenet/Development/Ruby/typeprof/lib/typeprof/import.rb:577:in `import'
from /Users/peterwagenet/Development/Ruby/typeprof/lib/typeprof/import.rb:529:in `import_library'
from /Users/peterwagenet/Development/Ruby/typeprof/lib/typeprof/builtin.rb:643:in `file_require'
from /Users/peterwagenet/Development/Ruby/typeprof/lib/typeprof/builtin.rb:684:in `kernel_require'
from /Users/peterwagenet/Development/Ruby/typeprof/lib/typeprof/method.rb:323:in `[]'
from /Users/peterwagenet/Development/Ruby/typeprof/lib/typeprof/method.rb:323:in `do_send'
from /Users/peterwagenet/Development/Ruby/typeprof/lib/typeprof/analyzer.rb:2392:in `block (2 levels) in do_send'
from /Users/peterwagenet/Development/Ruby/typeprof/lib/typeprof/utils.rb:101:in `each_key'
from /Users/peterwagenet/Development/Ruby/typeprof/lib/typeprof/utils.rb:101:in `each'
from /Users/peterwagenet/Development/Ruby/typeprof/lib/typeprof/analyzer.rb:2391:in `block in do_send'
from /Users/peterwagenet/Development/Ruby/typeprof/lib/typeprof/type.rb:90:in `each_child'
from /Users/peterwagenet/Development/Ruby/typeprof/lib/typeprof/analyzer.rb:2367:in `do_send'
from /Users/peterwagenet/Development/Ruby/typeprof/lib/typeprof/analyzer.rb:1512:in `step'
from /Users/peterwagenet/Development/Ruby/typeprof/lib/typeprof/analyzer.rb:1050:in `type_profile'
from /Users/peterwagenet/Development/Ruby/typeprof/lib/typeprof/config.rb:123:in `analyze'
from exe/typeprof:9:in `<main>'
It would be good to have something like "generated by TypeProf version 0.12.0 at 2021-01-04 00:53:00" in the head of output.
This is similar to what we have in RuboCop.
See: https://github.com/rubocop-hq/rubocop/blob/master/lib/rubocop/formatter/disabled_config_formatter.rb
This might not be a good idea if generated output is designed to be edited by human after it's generated.
Is it too early for bug reports?
I tried typeprof
on lib/matrix.rb
and all the methods that call Array#each_with_index
crash it with:
DEBUG: ../dev/lib/matrix.rb:620 (each_with_index) PC=68 insn=send sp=1
["../dev/lib/matrix.rb:620", "[error] undefined method: String#each_with_index"]
["../dev/lib/matrix.rb:620", "[error] undefined method: nil#each_with_index"]
bundler: failed to load command: typeprof (/Users/mal/.rvm/gems/ruby-head/bin/typeprof)
RuntimeError: nil
/Users/mal/ruby/typeprof/lib/typeprof/type.rb:205:in `block in initialize'
If I comment out these methods, typeprof
seems to take many minutes analysing a few (unusual) lines like these.
After ~12 minutes (I have a 2013 MacbookAir ๐ ), it crashes with:
NoMethodError: undefined method `each' for nil:NilClass
/Users/mal/ruby/typeprof/lib/typeprof/analyzer.rb:1976:in `block (2 levels) in show_block_signature'
/Users/mal/ruby/typeprof/lib/typeprof/type.rb:94:in `each_child_global'
/Users/mal/ruby/typeprof/lib/typeprof/analyzer.rb:1966:in `block in show_block_signature'
/Users/mal/ruby/typeprof/lib/typeprof/analyzer.rb:1965:in `each'
/Users/mal/ruby/typeprof/lib/typeprof/analyzer.rb:1965:in `show_block_signature'
/Users/mal/ruby/typeprof/lib/typeprof/type.rb:803:in `screen_name'
/Users/mal/ruby/typeprof/lib/typeprof/analyzer.rb:2023:in `show_method_signature'
/Users/mal/ruby/typeprof/lib/typeprof/export.rb:139:in `block (3 levels) in conv_class'
/Users/mal/ruby/typeprof/lib/typeprof/utils.rb:101:in `each_key'
/Users/mal/ruby/typeprof/lib/typeprof/utils.rb:101:in `each'
/Users/mal/ruby/typeprof/lib/typeprof/export.rb:131:in `block (2 levels) in conv_class'
/Users/mal/ruby/typeprof/lib/typeprof/utils.rb:101:in `each_key'
/Users/mal/ruby/typeprof/lib/typeprof/utils.rb:101:in `each'
/Users/mal/ruby/typeprof/lib/typeprof/export.rb:125:in `block in conv_class'
/Users/mal/ruby/typeprof/lib/typeprof/export.rb:124:in `each'
/Users/mal/ruby/typeprof/lib/typeprof/export.rb:124:in `conv_class'
/Users/mal/ruby/typeprof/lib/typeprof/export.rb:241:in `block in build_class_hierarchy'
/Users/mal/ruby/typeprof/lib/typeprof/export.rb:239:in `each'
/Users/mal/ruby/typeprof/lib/typeprof/export.rb:239:in `map'
/Users/mal/ruby/typeprof/lib/typeprof/export.rb:239:in `build_class_hierarchy'
/Users/mal/ruby/typeprof/lib/typeprof/export.rb:214:in `show'
/Users/mal/ruby/typeprof/lib/typeprof/analyzer.rb:857:in `report'
/Users/mal/ruby/typeprof/lib/typeprof/config.rb:90:in `analyze'
/Users/mal/ruby/typeprof/exe/typeprof:6:in `<top (required)>'
/Users/mal/.rvm/gems/ruby-head/bin/typeprof:23:in `load'
/Users/mal/.rvm/gems/ruby-head/bin/typeprof:23:in `<top (required)>'
Hi, I have a local setup using chruby
(shouldn't be much different from other setups). I usually switch to the right ruby then open the project on VSCode via code .
, in order to make sure that the extensions use the right ruby and deps versions. This works well for the steep
plugin. However, the typeprof plugin picks up the wrong ruby, i.e. the system ruby. So, I switch to ruby 3, but I get the following error output from within vscode:
[vscode] Try to start TypeProf for IDE
[vscode] stderr: /System/Library/Frameworks/Ruby.framework/Versions/2.6/usr/lib/ruby/2.6.0/rubygems.rb:283:in `find_spec_for_exe': Could not find 'bundler' (2.2.15) required by your /Users/tiago.cardoso/dev/jwt-token-kms/Gemfile.lock. (Gem::GemNotFoundException)
[vscode] stderr: To update to the latest version installed on your system, run `bundle update --bundler`.
[vscode] stderr: To install the missing version, run `gem install bundler:2.2.15`
[vscode] stderr: from /System/Library/Frameworks/Ruby.framework/Versions/2.6/usr/lib/ruby/2.6.0/rubygems.rb:302:in `activate_bin_path'
[vscode] stderr: from /usr/bin/bundle:23:in `<main>'
[vscode] failed to invoke typeprof: error code 1
# that's the location from system ruby, not ruby 3
I suspect I'm entering this path, where the extensions recognizes the existence of a Gemfile, and runs typeprof via bundler, but picks up the wrong bundler. And this might be so because typeprof's not picking up the ruby defined by the VSCode ruby plugin, which I set to ruby
(should have been ruby 3). steep does this a bit differently, but can't figure out what's the correct way to patch typeprof's command.
This can also be produced with the following file:
require "json"
class Exception
def as_json(options = nil)
to_s
end
end
This causes the following backtrace
/Users/peterwagenet/Development/Ruby/typeprof/lib/typeprof/utils.rb:4:in `array_update': undefined method `%' for nil:NilClass (NoMethodError)
from /Users/peterwagenet/Development/Ruby/typeprof/lib/typeprof/analyzer.rb:234:in `local_update'
from /Users/peterwagenet/Development/Ruby/typeprof/lib/typeprof/method.rb:117:in `do_check_send'
from /Users/peterwagenet/Development/Ruby/typeprof/lib/typeprof/method.rb:307:in `block in do_match_iseq_mdef'
from /Users/peterwagenet/Development/Ruby/typeprof/lib/typeprof/method.rb:306:in `each'
from /Users/peterwagenet/Development/Ruby/typeprof/lib/typeprof/method.rb:306:in `do_match_iseq_mdef'
from /Users/peterwagenet/Development/Ruby/typeprof/lib/typeprof/analyzer.rb:2421:in `block in do_define_iseq_method'
from /Users/peterwagenet/Development/Ruby/typeprof/lib/typeprof/analyzer.rb:2420:in `each'
from /Users/peterwagenet/Development/Ruby/typeprof/lib/typeprof/analyzer.rb:2420:in `do_define_iseq_method'
from /Users/peterwagenet/Development/Ruby/typeprof/lib/typeprof/analyzer.rb:1413:in `step'
from /Users/peterwagenet/Development/Ruby/typeprof/lib/typeprof/analyzer.rb:1050:in `type_profile'
from /Users/peterwagenet/Development/Ruby/typeprof/lib/typeprof/config.rb:123:in `analyze'
from exe/typeprof:9:in `<main>'
Encountered on an unreleased gem that uses metaprogramming.
It is useful to keep the elements of Array#zip
as tuples. RBS of Array#zip
has less information for the behavior, so it would be good to implement it as a built-in method.
as = [1, 2, 3]
bs = %w(a b c)
p as.zip(bs)
#=> expected: Array[[Integer, String]] (or [Integer, String?])
# actual: Array[Array[(Integer | String)?]]
as.zip(bs) do |a, b|
p a #=> expected: Integer
# actual: (Integer | String)?
p b #=> expected: String (or String?)
# actual: (Integer | String)?
end
cs = [1.0, 2.0, 3.0]
as.zip(bs, cs) do |a, b, c|
p a #=> expected: Integer
# actual: untyped
p b #=> expected: String (or String?)
# actual: untyped
p c #=> expected: Float (or Float?)
# actual: untyped
end
The doc directory is 66% of the total size of this gem and is probably not needed at runtime. can we exclude it as well as smoke and testbed?
$ pwd
/home/ursm/.gem/ruby/3.0.2/gems/typeprof-0.20.3
$ du -h .
4.0K ./.github/workflows
4.0K ./.github
964K ./doc
4.0K ./exe
348K ./lib/typeprof
352K ./lib
8.0K ./tools
4.0K ./vscode/.vscode
4.0K ./vscode/sandbox
12K ./vscode/src
180K ./vscode
1.6M .
While running the test for version 0.21.7 I ran into the issue that https://github.com/sider/goodcheck is gone. This makes https://github.com/ruby/typeprof/blob/v0.21.7/test/typeprof/goodcheck_test.rb unusable.
Hello! The last time i tried define_method
typeprof couldn't handle it at all. I am happy that it changed and it is nice to see the progress.
As you can see i provide an array of method names, iterate over them and create an empty method.
My expectation would be that the class Human
would have two methods in the typeprof output: :a
and :b
. But only :a
is shown.
I am quite sure this is a hard bug, because it relies on loop unwrapping.
class Human
define_method(:fo) { }
[:a, :b].each { |m|
define_method(m) { }
}
end
# TypeProf 0.12.0
# Classes
class Human
def a: -> nil
end
## Version info:
## * Ruby: 3.0.0
## * RBS: 1.0.3
## * TypeProf: 0.12.0
"foo 123 bar".gsub(/\w+/) do
$&.upcase #=> [error] undefined method: nil#upcase
end
It would be great if $&
, $1
, etc. respects the context.
BTW, Steep seems to handle such variables as always Strings. It is not correct but maybe more useful.
When running the tests for this gem I get the following error:
(none):1: warning: possibly useless use of a literal in void context
Loaded suite /usr/lib/ruby/gems/3.2.0/gems/rake-13.0.6/lib/rake/rake_test_loader
Started
....Initialized empty Git repository in /build/ruby-typeprof/src/typeprof-0.21.8/testbed/diff-lcs/.git/
From https://github.com/mame/diff-lcs
* branch de838d2df80514adbf22c26daed728ddd06af60b -> FETCH_HEAD
.(none):25: warning: possibly useless use of a constant in void context
path/to/file:25: warning: possibly useless use of a constant in void context
....TypeProf for IDE is started successfully
......................................................................
...............................................................................
............F
===============================================================================
Failure: test: smoke/integer.rb(TypeProf::SmokeTest)
/build/ruby-typeprof/src/typeprof-0.21.8/test/typeprof/smoke_test.rb:36:in `block (2 levels) in <class:SmokeTest>'
33: expected = actual
34: end
35:
=> 36: assert_equal(expected, actual)
37: end
38: end
39: end
<"# Classes\n" +
"class Object\n" +
" private\n" +
" def foo: (Integer? x) -> nil\n" +
"end\n"> expected but was
<"# Classes\n" +
"class Object\n" +
" private\n" +
" def foo: (Integer x) -> nil\n" +
"end\n">
diff:
# Classes
class Object
private
? def foo: (Integer? x) -> nil
end
===============================================================================
...............................................................................
....................................................................
Finished in 43.381750919 seconds.
-------------------------------------------------------------------------------
318 tests, 361 assertions, 1 failures, 0 errors, 0 pendings, 0 omissions, 0 notifications
99.6855% passed
-------------------------------------------------------------------------------
7.33 tests/s, 8.32 assertions/s
rake aborted!
Command failed with status (1)
Tasks: TOP => test
(See full trace by running task with --trace)
This seems to be a regression from 30a334e which is designed to make the tests compatible to rbs
3.2.0. This seems to make the tests only support rbs
>= 3.2.0, but the gemspec file stills says rbs
>= 1.8.1 is required and supported: https://github.com/ruby/typeprof/blob/v0.21.8/typeprof.gemspec#L33
So I guess either the test needs to be updated to somehow support all the rbs
versions, or the gem needs to update its requirements for the minimal required version of rbs
.
When analyzing ActiveRecord children class with rbs_rails outputs, this error has occured.
$ typeprof gem_rbs/gems/**/*.rbs sig/rbs_rails**/*.rbs app/models/post.rb -o sig/post.rbs
/Users/foo/.rbenv/versions/3.0.0/lib/ruby/gems/3.0.0/gems/typeprof-0.11.0/lib/typeprof/import.rb:262:in `each_class_decl': undefined method `decls' for nil:NilClass (NoMethodError)
from /Users/foo/.rbenv/versions/3.0.0/lib/ruby/gems/3.0.0/gems/typeprof-0.11.0/lib/typeprof/import.rb:113:in `conv_classes'
from /Users/foo/.rbenv/versions/3.0.0/lib/ruby/gems/3.0.0/gems/typeprof-0.11.0/lib/typeprof/import.rb:80:in `dump_json'
from /Users/foo/.rbenv/versions/3.0.0/lib/ruby/gems/3.0.0/gems/typeprof-0.11.0/lib/typeprof/import.rb:69:in `load_rbs'
from /Users/foo/.rbenv/versions/3.0.0/lib/ruby/gems/3.0.0/gems/typeprof-0.11.0/lib/typeprof/import.rb:48:in `load_path'
from /Users/foo/.rbenv/versions/3.0.0/lib/ruby/gems/3.0.0/gems/typeprof-0.11.0/lib/typeprof/import.rb:481:in `import_rbs_file'
from /Users/foo/.rbenv/versions/3.0.0/lib/ruby/gems/3.0.0/gems/typeprof-0.11.0/lib/typeprof/config.rb:100:in `block in analyze'
from /Users/foo/.rbenv/versions/3.0.0/lib/ruby/gems/3.0.0/gems/typeprof-0.11.0/lib/typeprof/config.rb:96:in `each'
from /Users/foo/.rbenv/versions/3.0.0/lib/ruby/gems/3.0.0/gems/typeprof-0.11.0/lib/typeprof/config.rb:96:in `analyze'
from /Users/foo/.rbenv/versions/3.0.0/lib/ruby/gems/3.0.0/gems/typeprof-0.11.0/exe/typeprof:6:in `<top (required)>'
from /Users/foo/.rbenv/versions/3.0.0/bin/typeprof:23:in `load'
from /Users/foo/.rbenv/versions/3.0.0/bin/typeprof:23:in `<main>'
Please setup this minimum rbs_rails sample, and run typeprof gem_rbs/gems/**/*.rbs sig/rbs_rails**/*.rbs app/models/post.rb -o sig/post.rbs
.
https://github.com/nullnull/rails_with_rbs_rails_sample
$ typeprof --version
typeprof 0.11.0
Thanks for developing cool library!
as = [1, 2, 3]
as.min.to_s(2) #=> [error] failed to resolve overload: nil#to_s
Array[Elem]#min
returns Elem | nil
in RBS definition. It is correct but it would be useful to return Elem
when the receiver is a non-empty tuple.
For example on TruffleRuby:
$ typeprof --version
Currently, TypeProf can work on a Ruby implementation that supports RubyVM::InstructionSequence, such as CRuby.
zsh: exit 1 typeprof --version
If none of typeprof can work on non-CRuby I guess that makes sense, but still shouldn't --version
and maybe also --help
still work, and only fail when actually needing RubyVM::InstructionSequence
?
I think that's what most libraries do and I think it's closer to expected behavior.
Context: I'm updating TruffleRuby to Ruby 3 compatibility.
Another option would be to not include typeprof on TruffleRuby/non-CRuby but I think that's bad because suddenly there would be some expected bundled gem missing, bundle install
might fail if typeprof
is in it, etc.
Sometimes, at least, this happens because of Struct.new with a block.
The warning [warning] already initialized constant Foo::A
is displayed.
When a class with constants exists in an RBS file that has already been created.
Ruby TypeProf Playground
https://mame.github.io/typeprof-playground/#rb=class+Foo%0A++A+%3D+1%0Aend%0A&rbs=class+Foo%0A++A%3A+Integer%0Aend
Ruby
class Foo
A = 1
end
RBS
class Foo
A: Integer
end
Output
# TypeProf 0.15.0
# Errors
test.rb:2: [warning] already initialized constant Foo::A
# Classes
class Foo
A: Integer
end
## Version info:
## * Ruby: 3.0.0
## * RBS: 1.3.1
## * TypeProf: 0.15.0
See this PR and this comment I made Updated below
In particular, if I give a type of @rows
, I was expecting to see attr_reader rows : <exact same type here>
. Instead I get a complex expression.
For some reason, typeprof
on lib/matrix
generates rbs for Matrix
, then Vector
, but if I provide a hint file below, then the order is reversed, Vector
first then Matrix
:
type numeric = Integer | Float | Rational | Complex
class Matrix
@rows : Array[Array[numeric]]
end
class Vector
@elements : Array[numeric]
end
I'm not sure if this is technically a Ruby bug or a typeprof bug, but if you have a file with require 'openssl'
you'll get the error: "A constant 'TCPServer' is used but not defined in RBS". This can be resolved by adding require 'socket'
before require 'openssl'
.
Trying with matrix
, with a hint rbs using generics, I get a crash.
I bypassed the crash calling warn
, but it crashes further down. I didn't investigate more.
Are generics supported?
RBS hint file I'm trying (it's the last commit of my PR):
class Matrix[unchecked out Elem]
@rows : Array[Array[Elem]]
end
class Vector[unchecked out Elem]
@elements : Array[Elem]
end
Error I'm getting:
$ bundle exec typeprof ../matrix/sig/matrix.rbs ../matrix/lib/matrix.rb -o ../matrix/sig/matrix_gen.rbs
bundler: failed to load command: typeprof (/Users/mal/.rvm/gems/ruby-head/bin/typeprof)
ArgumentError: wrong number of arguments (given 1, expected 2)
/Users/mal/ruby/typeprof/lib/typeprof/analyzer.rb:708:in `warn'
/Users/mal/ruby/typeprof/lib/typeprof/analyzer.rb:658:in `get_ivar'
/Users/mal/ruby/typeprof/lib/typeprof/analyzer.rb:673:in `block in add_ivar_write!'
/Users/mal/ruby/typeprof/lib/typeprof/type.rb:90:in `each_child'
/Users/mal/ruby/typeprof/lib/typeprof/analyzer.rb:672:in `add_ivar_write!'
/Users/mal/ruby/typeprof/lib/typeprof/analyzer.rb:945:in `set_instance_variable'
/Users/mal/ruby/typeprof/lib/typeprof/analyzer.rb:1372:in `step'
/Users/mal/ruby/typeprof/lib/typeprof/analyzer.rb:807:in `type_profile'
/Users/mal/ruby/typeprof/lib/typeprof/config.rb:87:in `analyze'
/Users/mal/ruby/typeprof/exe/typeprof:6:in `<top (required)>'
/Users/mal/.rvm/gems/ruby-head/bin/typeprof:23:in `load'
/Users/mal/.rvm/gems/ruby-head/bin/typeprof:23:in `<top (required)>'
After bypassing that bug:
[23:50][~/ruby/typeprof(master)]$ bundle exec typeprof ../matrix/sig/matrix.rbs ../matrix/lib/matrix.rb -o ../matrix/sig/matrix_gen.rbs
bundler: failed to load command: typeprof (/Users/mal/.rvm/gems/ruby-head/bin/typeprof)
NoMethodError: undefined method `get_method' for #<TypeProf::Type::Var:0x00007ff5b4f1f9a8 @name=:Elem>
/Users/mal/ruby/typeprof/lib/typeprof/analyzer.rb:1929:in `do_send'
/Users/mal/ruby/typeprof/lib/typeprof/analyzer.rb:1204:in `block in step'
/Users/mal/ruby/typeprof/lib/typeprof/type.rb:90:in `each_child'
/Users/mal/ruby/typeprof/lib/typeprof/analyzer.rb:1203:in `step'
/Users/mal/ruby/typeprof/lib/typeprof/analyzer.rb:807:in `type_profile'
/Users/mal/ruby/typeprof/lib/typeprof/config.rb:87:in `analyze'
/Users/mal/ruby/typeprof/exe/typeprof:6:in `<top (required)>'
/Users/mal/.rvm/gems/ruby-head/bin/typeprof:23:in `load'
/Users/mal/.rvm/gems/ruby-head/bin/typeprof:23:in `<top (required)>'
sig/typeprof/app/services/usage_anomalies/detector.rbs:5:2: [error] Type `::Enumerable` is generic but used as a non generic type
โ Diagnostic ID: RBS::InvalidTypeApplication
โ
โ class Detector
~~~~~~~~~~~~~~
sig/typeprof/app/models/requests_fetcher.rbs:19:41: [error] Type `::Enumerator` expects 2 arguments, but 1 arguments are given
โ Diagnostic ID: RBS::InvalidTypeApplication
โ
โ def responses_for_guid: (untyped guid, Enumerator[untyped] times, untyped client) -> untyped
sig/typeprof/app/services/usage_checker.rbs:33:21: [error] Type `::Range` is generic but used as a non generic type
โ Diagnostic ID: RBS::InvalidTypeApplication
โ
โ def date_range: -> Range
$ rails -v
Rails 6.1.6
stevenaguilar ~/portal on add-linux-platform[$]
$ ruby -v
ruby 3.1.2p20 (2022-04-12 revision 4491bb740a) [x86_64-darwin21]
I'm currently trying to upgrade a Rails app to use Ruby 3.1.2. When I try to deploy to heroku I get the following error:
remote: ERROR in vendor/ruby-3.1.2/lib/ruby/gems/3.1.0/gems/typeprof-0.21.2/vscode/src/extension.ts:3:25
remote: TS2307: Cannot find module 'vscode' or its corresponding type declarations.
It seems that it comes from typeprof-0.21.2
. Here is the full stack trace:
remote: [0] ./node_modules/react/index.js 190 bytes {0} {1} [built]
remote: [6] ./app/javascript/components/v2/App/Claims/ClaimDetails/ClaimStyles.tsx 16.8 KiB {0} {1} [built]
remote: [9] ./app/javascript/components/v2/App/utils/index.ts + 2 modules 13.1 KiB {0} {1} [built]
remote: | ./app/javascript/components/v2/App/utils/index.ts 9.34 KiB [built]
remote: | ./node_modules/date-fns/esm/subMonths/index.js 1.17 KiB [built]
remote: | ./node_modules/date-fns/esm/sub/index.js 2.53 KiB [built]
remote: [12] ./app/javascript/components/v2/App/testUtils/Wrapper.tsx 795 bytes {0} {1} [built]
remote: [13] ./app/javascript/components/v2/App/interfaces.ts 4.07 KiB {0} {1} [built]
remote: [19] ./app/javascript/components/v2/App/utils/userRole.ts 1.57 KiB {0} {1} [built]
remote: [20] ./app/javascript/components/v2/App/toast/use-toast.tsx 288 bytes {0} {1} [built]
remote: [22] ./app/javascript/components/v2/App/Invitation/Styles.tsx 2.69 KiB {0} {1} [built]
remote: [24] ./app/javascript/components/v2/App/utils/constants.ts 2.3 KiB {0} {1} [built]
remote: [348] ./app/javascript/components/datatables/index.ts 837 bytes {0} {1} [built]
remote: [647] ./app/javascript/components/modals/2fa_disable_modal.ts 1.52 KiB {0} {1} [built]
remote: [828] ./app/javascript/components sync ^\.\/.*$ 38.2 KiB {0} {1} [built]
remote: [1231] ./node_modules/react_ujs/react_ujs/index.js 5.89 KiB {0} {1} [built]
remote: [1243] ./app/javascript/packs/application.ts 1.45 KiB {0} [built]
remote: [1250] ./app/javascript/packs/server_rendering.ts 292 bytes {1} [built]
remote: + 1528 hidden modules
remote:
remote: ERROR in vendor/ruby-3.1.2/lib/ruby/gems/3.1.0/gems/typeprof-0.21.2/vscode/src/extension.ts:3:25
remote: TS2307: Cannot find module 'vscode' or its corresponding type declarations.
remote: 1 | "use strict";
remote: 2 |
remote: > 3 | import * as vscode from "vscode";
remote: | ^^^^^^^^
remote: 4 | import {
remote: 5 | LanguageClient,
remote: 6 | LanguageClientOptions,
remote:
remote: ERROR in vendor/ruby-3.1.2/lib/ruby/gems/3.1.0/gems/typeprof-0.21.2/vscode/src/extension.ts:8:8
remote: TS2307: Cannot find module 'vscode-languageclient/node' or its corresponding type declarations.
remote: 6 | LanguageClientOptions,
remote: 7 | ServerOptions,
remote: > 8 | } from "vscode-languageclient/node";
remote: | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^
remote: 9 | import * as net from "net";
remote: 10 | import * as child_process from "child_process";
remote: 11 | import { existsSync } from "fs";
remote:
remote: ERROR in vendor/ruby-3.1.2/lib/ruby/gems/3.1.0/gems/typeprof-0.21.2/vscode/src/extension.ts:278:9
remote: TS2571: Object is of type 'unknown'.
remote: 276 |
remote: 277 | activeFolders.forEach((folder) => {
remote: > 278 | if (folder.uri.scheme === "file" && !clientSessions.has(folder)) {
remote: | ^^^^^^
remote: 279 | startTypeProf(folder);
remote: 280 | }
remote: 281 | });
remote: Child mini-css-extract-plugin node_modules/css-loader/dist/cjs.js??ref--5-1!node_modules/postcss-loader/src/index.js??ref--5-2!node_modules/@reach/combobox/styles.css:
remote: Entrypoint mini-css-extract-plugin = *
remote: [0] ./node_modules/css-loader/dist/runtime/cssWithMappingToString.js 2.27 KiB {0} [built]
remote: [1] ./node_modules/css-loader/dist/runtime/api.js 1.57 KiB {0} [built]
remote: [2] ./node_modules/css-loader/dist/cjs.js??ref--5-1!./node_modules/postcss-loader/src??ref--5-2!./node_modules/@reach/combobox/styles.css 2.33 KiB {0} [built]
remote: Child mini-css-extract-plugin node_modules/css-loader/dist/cjs.js??ref--5-1!node_modules/postcss-loader/src/index.js??ref--5-2!node_modules/@sayrhino/rhino-shared-js/build/datepicker.css:
remote: Entrypoint mini-css-extract-plugin = *
remote: [0] ./node_modules/css-loader/dist/runtime/cssWithMappingToString.js 2.27 KiB {0} [built]
remote: [1] ./node_modules/css-loader/dist/runtime/api.js 1.57 KiB {0} [built]
remote: [2] ./node_modules/css-loader/dist/cjs.js??ref--5-1!./node_modules/postcss-loader/src??ref--5-2!./node_modules/@sayrhino/rhino-shared-js/build/datepicker.css 53.1 KiB {0} [built]
remote: Child mini-css-extract-plugin node_modules/css-loader/dist/cjs.js??ref--6-1!node_modules/postcss-loader/src/index.js??ref--6-2!node_modules/sass-loader/dist/cjs.js??ref--6-3!app/javascript/components/common/forms/RadioLabel.scss:
remote: Entrypoint mini-css-extract-plugin = *
remote: [0] ./node_modules/css-loader/dist/runtime/cssWithMappingToString.js 2.27 KiB {0} [built]
remote: [1] ./node_modules/css-loader/dist/runtime/api.js 1.57 KiB {0} [built]
remote: [2] ./node_modules/css-loader/dist/cjs.js??ref--6-1!./node_modules/postcss-loader/src??ref--6-2!./node_modules/sass-loader/dist/cjs.js??ref--6-3!./app/javascript/components/common/forms/RadioLabel.scss 765 bytes {0} [built]
remote: Child mini-css-extract-plugin node_modules/css-loader/dist/cjs.js??ref--6-1!node_modules/postcss-loader/src/index.js??ref--6-2!node_modules/sass-loader/dist/cjs.js??ref--6-3!app/javascript/components/common/functions.scss:
remote: Entrypoint mini-css-extract-plugin = *
remote: [0] ./node_modules/css-loader/dist/runtime/cssWithMappingToString.js 2.27 KiB {0} [built]
remote: [1] ./node_modules/css-loader/dist/runtime/api.js 1.57 KiB {0} [built]
remote: [2] ./node_modules/css-loader/dist/cjs.js??ref--6-1!./node_modules/postcss-loader/src??ref--6-2!./node_modules/sass-loader/dist/cjs.js??ref--6-3!./app/javascript/components/common/functions.scss 516 bytes {0} [built]
remote:
remote:
remote: !
remote: ! Precompiling assets failed.
remote: !
remote: ! Push rejected, failed to compile Ruby app.
remote:
remote: ! Push failed
remote: Verifying deploy...
remote:
I found that the ruby-type-profiler is being renamed to typeprof
.
It seems that Readme and some files still contain the old names, and I guess you're going to update them including some file names and the repository name soon.
Should we wait for the finish of the updates?
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.