Skip to content

Commit

Permalink
Change how we format warnings/errors
Browse files Browse the repository at this point in the history
We now show the line as it appeared in the original output, except shortening the path. Only the leading file component of the line is a link and its tooltip show the full path (but not potential line and column info, as that should now be in the visible output).
  • Loading branch information
sorbits committed Jan 13, 2013
1 parent 9a2f0ef commit 9f10c2c
Showing 1 changed file with 7 additions and 11 deletions.
18 changes: 7 additions & 11 deletions Support/lib/make.rb
Expand Up @@ -30,27 +30,23 @@ def perform_make(target = nil)
elsif line =~ /^g?make.*?: Leaving directory `(.*?)'$/ and not $1.nil? and File.directory?($1) elsif line =~ /^g?make.*?: Leaving directory `(.*?)'$/ and not $1.nil? and File.directory?($1)
dirs.delete($1) dirs.delete($1)
"" ""
elsif line =~ /^\s*(.*?)\((\d+),(\d+)\):\s*((?:warning|error)\s+.*)$/ and not $1.nil? elsif line =~ /^\s*((.*?)\((\d+),(\d+)\):)(\s*(?:warning|error)\s+.*)$/ and not $1.nil?
# smcs (C#) # smcs (C#)
make_txmt_link(dirs, $1, $2, $3, $4) make_txmt_link(dirs, $2, $3, $4, $1, $5)
elsif line =~ /^(.*?):(?:(\d+):)?(?:(\d+):)?\s*(.*?)$/ and not $1.nil? elsif line =~ /^((.*?):(?:(\d+):)?(?:(\d+):)?)(.*?)$/ and not $1.nil?
# GCC, et al # GCC, et al
make_txmt_link(dirs, $1, $2, $3, $4) make_txmt_link(dirs, $2, $3, $4, $1, $5)
end end
end end
end end


def make_txmt_link(dirs, file, lineno, column, message) def make_txmt_link(dirs, file, lineno, column, title, message)
path = dirs.map{ |dir| File.expand_path(file, dir) }.find{ |path| File.file? path } path = dirs.map{ |dir| File.expand_path(file, dir) }.find{ |path| File.file? path }
unless path.nil? unless path.nil?
parms = [ "url=file://#{e_url path}" ] parms = [ "url=file://#{e_url path}" ]
parms << [ "line=#{lineno}" ] unless lineno.nil? parms << [ "line=#{lineno}" ] unless lineno.nil?
parms << [ "column=#{column}" ] unless column.nil? parms << [ "column=#{column}" ] unless column.nil?
info = file info = file.gsub('&', '&amp;').gsub('<', '&lt;').gsub('"', '&quot;')
info << " at line #{lineno}" unless lineno.nil? "<a href=\"txmt://open?#{parms.join '&'}\" title=\"#{info}\">#{title}</a>#{htmlize message}<br>\n"
info << ", column #{column}" unless column.nil?
info << "."
info = info.gsub('&', '&amp;').gsub('<', '&lt;').gsub('"', '&quot;')
"<a href=\"txmt://open?#{parms.join '&'}\" title=\"#{info}\">#{htmlize message}</a><br>\n"
end end
end end

0 comments on commit 9f10c2c

Please sign in to comment.