class RubyLsp::Tapioca::Addon

def file_updated?(change, path)

def file_updated?(change, path)
  case change[:type]
  when Constant::FileChangeType::CREATED
    @file_checksums[path] = Zlib.crc32(File.read(path)).to_s
    return true
  when Constant::FileChangeType::CHANGED
    current_checksum = Zlib.crc32(File.read(path)).to_s
    if @file_checksums[path] == current_checksum
      T.must(@outgoing_queue) << Notification.window_log_message(
        "File has not changed. Skipping #{path}",
        type: Constant::MessageType::INFO,
      )
    else
      @file_checksums[path] = current_checksum
      return true
    end
  when Constant::FileChangeType::DELETED
    @file_checksums.delete(path)
  else
    T.must(@outgoing_queue) << Notification.window_log_message(
      "Unexpected file change type: #{change[:type]}",
      type: Constant::MessageType::WARNING,
    )
  end
  false
end