Sha256: eecbb633b9d6c17790ca7aa3bd6d9ac051d71b79d6e86462446ab7b0d50e2c35
Contents?: true
Size: 904 Bytes
Versions: 1
Compression:
Stored size: 904 Bytes
Contents
# typed: true # frozen_string_literal: true module RubyLsp module Requests # The # [diagnostics](https://microsoft.github.io/language-server-protocol/specification#textDocument_publishDiagnostics) # request informs the editor of RuboCop offenses for a given file. # # # Example # # ```ruby # def say_hello # puts "Hello" # --> diagnostics: incorrect indentantion # end # ``` class Diagnostics < RuboCopRequest def run return syntax_error_diagnostics if @document.syntax_errors? super @diagnostics end def file_finished(_file, offenses) @diagnostics = offenses.map { |offense| Support::RuboCopDiagnostic.new(offense, @uri) } end private def syntax_error_diagnostics @document.syntax_error_edits.map { |e| Support::SyntaxErrorDiagnostic.new(e) } end end end end
Version data entries
1 entries across 1 versions & 1 rubygems
Version | Path |
---|---|
ruby-lsp-0.0.4 | lib/ruby_lsp/requests/diagnostics.rb |