Class: RubyLsp::Requests::BaseRequest
- Inherits:
-
SyntaxTree::Visitor
- Object
- SyntaxTree::Visitor
- RubyLsp::Requests::BaseRequest
- Extended by:
- T::Helpers, T::Sig
- Defined in:
- lib/ruby_lsp/requests/base_request.rb
Overview
:nodoc:
Direct Known Subclasses
CodeActions, Diagnostics, DocumentHighlight, DocumentLink, DocumentSymbol, FoldingRanges, Formatting, InlayHints, OnTypeFormatting, SelectionRanges, SemanticHighlighting
Instance Method Summary collapse
-
#initialize(document) ⇒ BaseRequest
constructor
A new instance of BaseRequest.
- #range_from_syntax_tree_node(node) ⇒ Object
- #run ⇒ Object
Constructor Details
#initialize(document) ⇒ BaseRequest
Returns a new instance of BaseRequest.
14 15 16 17 18 |
# File 'lib/ruby_lsp/requests/base_request.rb', line 14 def initialize(document) @document = document super() end |
Instance Method Details
#range_from_syntax_tree_node(node) ⇒ Object
24 25 26 27 28 29 30 31 32 |
# File 'lib/ruby_lsp/requests/base_request.rb', line 24 def range_from_syntax_tree_node(node) loc = node.location LanguageServer::Protocol::Interface::Range.new( start: LanguageServer::Protocol::Interface::Position.new(line: loc.start_line - 1, character: loc.start_column), end: LanguageServer::Protocol::Interface::Position.new(line: loc.end_line - 1, character: loc.end_column), ) end |
#run ⇒ Object
21 |
# File 'lib/ruby_lsp/requests/base_request.rb', line 21 def run; end |