Skip to content

Commit 76b7cf1

Browse files
committed
Turn off runtime checks
1 parent e40f3bb commit 76b7cf1

File tree

1 file changed

+15
-0
lines changed

1 file changed

+15
-0
lines changed

lib/ruby_lsp/ruby_lsp_rails/server.rb

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,21 @@
44
require "sorbet-runtime"
55
require "json"
66

7+
begin
8+
T::Configuration.default_checked_level = :never
9+
# Suppresses call validation errors
10+
T::Configuration.call_validation_error_handler = ->(*) {}
11+
# Suppresses errors caused by T.cast, T.let, T.must, etc.
12+
T::Configuration.inline_type_error_handler = ->(*) {}
13+
# Suppresses errors caused by incorrect parameter ordering
14+
T::Configuration.sig_validation_error_handler = ->(*) {}
15+
rescue
16+
# Need this rescue so that if another gem has
17+
# already set the checked level by the time we
18+
# get to it, we don't fail outright.
19+
nil
20+
end
21+
722
module RubyLsp
823
module Rails
924
class Server

0 commit comments

Comments
 (0)