class Solargraph::Parser::CommentRipper

def on_comment *args

def on_comment *args
  result = super
  if @buffer_lines[result[2][0]][0..result[2][1]].strip =~ /^#/
    chomped = result[1].chomp
    if result[2][0] == 0 && chomped.encode('UTF-8', 'binary', invalid: :replace, undef: :replace, replace: '').match(/^#\s*frozen_string_literal:/)
      chomped = '#'
    end
    @comments[result[2][0]] = Snippet.new(Range.from_to(result[2][0], result[2][1], result[2][0], result[2][1] + chomped.length), chomped)
  end
  result
end