Skip to content

Commit

Permalink
Changes for YARP
Browse files Browse the repository at this point in the history
  • Loading branch information
andyw8 committed Aug 15, 2023
1 parent 947e5c3 commit daa79f9
Show file tree
Hide file tree
Showing 4 changed files with 6 additions and 126 deletions.
6 changes: 3 additions & 3 deletions lib/ruby_lsp/event_emitter.rb
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@ def emit_for_target(node)

# Visit dispatchers are below. Notice that for nodes that create a new scope (e.g.: classes, modules, method defs)
# we need both an `on_*` and `after_*` event. This is because some requests must know when we exit the scope
sig { override.params(node: T.nilable(SyntaxTree::Node)).void }
sig { override.params(node: T.nilable(YARP::Node)).void }
def visit(node)
@listeners[:on_node]&.each { |l| T.unsafe(l).on_node(node) }
super
Expand Down Expand Up @@ -129,8 +129,8 @@ def visit_comment(node)
super
end

sig { override.params(node: SyntaxTree::Rescue).void }
def visit_rescue(node)
sig { override.params(node: YARP::RescueNode).void }
def visit_rescue_node(node)
@listeners[:on_rescue]&.each { |l| T.unsafe(l).on_rescue(node) }
super
end
Expand Down
4 changes: 2 additions & 2 deletions lib/ruby_lsp/executor.rb
Original file line number Diff line number Diff line change
Expand Up @@ -24,8 +24,8 @@ def execute(request)

request_time = Benchmark.realtime do
response = run(request)
rescue StandardError, LoadError => e
error = e
# rescue StandardError, LoadError => e
# error = e
end

Result.new(response: response, error: error, request_time: request_time)
Expand Down
2 changes: 1 addition & 1 deletion lib/ruby_lsp/requests/support/common.rb
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ def full_constant_name(node)
name
end

sig { params(node: T.nilable(SyntaxTree::Node), range: T.nilable(T::Range[Integer])).returns(T::Boolean) }
sig { params(node: T.nilable(YARP::Node), range: T.nilable(T::Range[Integer])).returns(T::Boolean) }
def visible?(node, range)
return true if range.nil?
return false if node.nil?
Expand Down
120 changes: 0 additions & 120 deletions sorbet/rbi/shims/yarp.rbi
Original file line number Diff line number Diff line change
Expand Up @@ -57,129 +57,9 @@ module YARP
sig { returns(ConstantPathNode) }
def constant_path; end
end
<<<<<<< HEAD
||||||| parent of 9e19894 (Migrate inlay hint)

class DefNode
sig { returns(String) }
def name; end

sig { returns(T.nilable(YARP::Node)) }
def receiver; end

sig { returns(Location) }
def name_loc; end
end

class CallNode
sig { returns(String) }
def name; end

sig { returns(T.nilable(ArgumentsNode)) }
def arguments; end

sig { returns(T.nilable(YARP::Node)) }
def receiver; end
end

class ArgumentsNode
sig { returns(T::Array[YARP::Node]) }
def arguments; end
end

class StringNode
sig { returns(String) }
def content; end
end

class ConstantPathWriteNode
sig { returns(YARP::Node) }
def target; end
end

class SymbolNode
sig { returns(String) }
def value; end
end

class InstanceVariableWriteNode
sig { returns(String) }
def name; end

sig { returns(Location) }
def name_loc; end
end

class ClassVariableWriteNode
sig { returns(String) }
def name; end

sig { returns(Location) }
def name_loc; end
end
=======

class DefNode
sig { returns(String) }
def name; end

sig { returns(T.nilable(YARP::Node)) }
def receiver; end

sig { returns(Location) }
def name_loc; end
end

class CallNode
sig { returns(String) }
def name; end

sig { returns(T.nilable(ArgumentsNode)) }
def arguments; end

sig { returns(T.nilable(YARP::Node)) }
def receiver; end
end

class ArgumentsNode
sig { returns(T::Array[YARP::Node]) }
def arguments; end
end

class StringNode
sig { returns(String) }
def content; end
end

class ConstantPathWriteNode
sig { returns(YARP::Node) }
def target; end
end

class SymbolNode
sig { returns(String) }
def value; end
end

class InstanceVariableWriteNode
sig { returns(String) }
def name; end

sig { returns(Location) }
def name_loc; end
end

class ClassVariableWriteNode
sig { returns(String) }
def name; end

sig { returns(Location) }
def name_loc; end
end

class RescueNode
sig { returns(T::Array[YARP::Node]) }
def exceptions; end
end
>>>>>>> 9e19894 (Migrate inlay hint)
end

0 comments on commit daa79f9

Please sign in to comment.