Class: RubyLsp::RubyDocument

Inherits:
Document show all
Defined in:
lib/ruby_lsp/ruby_document.rb

Constant Summary

Constants inherited from Document

Document::EditShape, Document::PositionShape, Document::RangeShape

Instance Attribute Summary

Attributes inherited from Document

#parse_result, #source, #uri, #version

Instance Method Summary collapse

Methods inherited from Document

#==, #cache_fetch, #cache_get, #cache_set, #comments, #create_scanner, #initialize, #locate, #locate_node, #push_edits, #syntax_error?, #tree

Constructor Details

This class inherits a constructor from RubyLsp::Document

Instance Method Details

#parseObject



7
8
9
10
11
12
# File 'lib/ruby_lsp/ruby_document.rb', line 7

def parse
  return @parse_result unless @needs_parsing

  @needs_parsing = false
  @parse_result = Prism.parse(@source)
end