Sha256: 161d516673c4f5af50e102ea597447a3a968acd5f7996909f81cfa797e409d89
Contents?: true
Size: 994 Bytes
Versions: 17
Compression:
Stored size: 994 Bytes
Contents
# typed: strict # frozen_string_literal: true module RubyLsp class RBSDocument < Document extend T::Sig extend T::Generic ParseResultType = type_member { { fixed: T::Array[RBS::AST::Declarations::Base] } } sig { params(source: String, version: Integer, uri: URI::Generic, encoding: Encoding).void } def initialize(source:, version:, uri:, encoding: Encoding::UTF_8) @syntax_error = T.let(false, T::Boolean) super end sig { override.returns(T::Boolean) } def parse! return false unless @needs_parsing @needs_parsing = false _, _, declarations = RBS::Parser.parse_signature(@source) @syntax_error = false @parse_result = declarations true rescue RBS::ParsingError @syntax_error = true true end sig { override.returns(T::Boolean) } def syntax_error? @syntax_error end sig { override.returns(LanguageId) } def language_id LanguageId::RBS end end end
Version data entries
17 entries across 17 versions & 1 rubygems