lib/solargraph/library.rb
# Get diagnostics about a file.
#
# @param filename [String]
# @return [Array<Hash>]
Get diagnostics about a file.
Get diagnostics about a file .
def diagnose filename
      return [] unless open?(filename)
      catalog
      result = []
      source = read(filename)
      repargs = {}
      workspace.config.reporters.each do |line|
        if line == 'all!'
          Diagnostics.reporters.each do |reporter|
            repargs[reporter] ||= []
          end
        else
          args = line.split(':').map(&:strip)
          name = args.shift
            reporter = Diagnostics.reporter(name)
          raise DiagnosticsError, "Diagnostics reporter {name} does not exist" if reporter.nil?
          repargs[reporter] ||= []
          repargs[reporter].concat args
        end
      end
      repargs.each_pair do |reporter, args|
        result.concat reporter.new(*args.uniq).diagnose(source, api_map)
      end
      result
    end
def diagnose filename return [ ] unless open? ( filename ) catalog result = [ ] source = read ( filename ) repargs = { } workspace . config . reporters . each do | line | if line == 'all!' Diagnostics . reporters . each do | reporter | repargs [ reporter ] ||= [ ] end else args = line . split ( ':' ) . map ( & :strip ) name = args . shift reporter = Diagnostics . reporter ( name ) raise DiagnosticsError , "Diagnostics reporter #{name} does not exist" if reporter . nil? repargs [ reporter ] ||= [ ] repargs [ reporter ] . concat args end end repargs . each_pair do | reporter , args | result . concat reporter . new ( * args . uniq ) . diagnose ( source , api_map ) end result end
Get diagnostics about a file.
Get diagnostics about a file .
# @todo Only open files get diagnosed. Determine whether anything or #   everything in the workspace should get diagnosed, or if there should #   be an option to do so. #
None
Array<Hash>
filename
<not_specific>
<not_specific>
None