Ruby code • guess types of method arguments and a return value 5 class User def initialize(name) @name = name end end User.new("John") Ruby code class User def initialize:(String name)->void end RBS TypeProf
"Header files suck" • TypeProf for IDE may solve this issue 8 class User def initialize(name) @name = name end end User.new("John") user.rb class User def initialize: (String name) -> void end user.rbs
error found complete "5.ti" maybe "5.times" 5.ti| Do you mean: 5.times 1 + "str" 1 + "str" Is this a bug? • A VSCode extension for Ruby powered by TypeProf
(development version☺) • Add for your Gemfile • Configure RBS collection • if you use gems • Install VSCode extension→ • search "typeprof" • Open your folder with VSCode and pray • More detail: https://github.com/ruby/typeprof/blob/master/doc/ide.md 19 gem "typeprof"
requires a test to guess method signatures •Write RBS to fix method signatures (if needed) • This makes TypeProf analysis faster • This is also useful to make TypeProf faster 25
3.1 • Happy if you could play with it and give us feedback •Ready for production? • Experimental, but hopefully works for small programs • For large code base, please write RBS for gems first! • https://github.com/ruby/gem_rbs_collection 27
soutaro • Katsuhiro Ueno & Eijiro Sumii •Stripe team & Shopify team & Jeff Foster • Yuta Saito (@kateinoigakukun) • Many improvements of TypeProf for IDE 28