class Steep::Services::TypeCheckService::SourceFile
def self.no_data(path:, content:)
def self.no_data(path:, content:) new(path: path, content: content, node: false, errors: nil, typing: nil) end
def self.with_syntax_error(path:, content:, error:)
def self.with_syntax_error(path:, content:, error:) new(path: path, node: false, content: content, errors: [error], typing: nil) end
def self.with_typing(path:, content:, typing:, node:)
def self.with_typing(path:, content:, typing:, node:) new(path: path, node: node, content: content, errors: nil, typing: typing) end
def diagnostics
def diagnostics errors || typing&.errors || [] end
def initialize(path:, node:, content:, typing:, errors:)
def initialize(path:, node:, content:, typing:, errors:) @path = path @node = node @content = content @typing = typing @errors = errors end
def update_content(content)
def update_content(content) self.class.new( path: path, content: content, node: node, errors: errors, typing: typing ) end