class RubyLsp::Document

def initialize(source:, version:, uri:, global_state:)

: (source: String, version: Integer, uri: URI::Generic, global_state: GlobalState) -> void
def initialize(source:, version:, uri:, global_state:)
  @source = source
  @version = version
  @global_state = global_state
  @cache = Hash.new(EMPTY_CACHE) #: Hash[String, untyped]
  @semantic_tokens = EMPTY_CACHE #: (Interface::SemanticTokens | Object)
  @encoding = global_state.encoding #: Encoding
  @uri = uri #: URI::Generic
  @needs_parsing = true #: bool
  @last_edit = nil #: Edit?
  # Workaround to be able to type parse_result properly. It is immediately set when invoking parse!
  @parse_result = ( # rubocop:disable Style/RedundantParentheses
    nil #: as untyped
  ) #: ParseResultType
  parse!
end