Class: RubyLsp::RubyDocument

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

Instance Attribute Summary

Attributes inherited from Document

#encoding, #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, #sorbet_sigil_is_true_or_higher, #syntax_error?, #tree, #typechecker_enabled?

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