class Standard::Lsp::Diagnostic
def line_disable_comment
def line_disable_comment new_text = if @offense.source_line.include?(" # standard:disable ") ",#{@offense.cop_name}" else " # standard:disable #{@offense.cop_name}" end eol = Interface::Position.new( line: @offense.line - 1, character: length_of_line(@offense.source_line) ) # TODO: fails for multiline strings - may be preferable to use block # comments to disable some offenses inline_comment = Interface::TextEdit.new( range: Interface::Range.new(start: eol, end: eol), new_text: new_text ) [inline_comment] end