Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

Change how we format warnings/errors

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...
commit 9f10c2c40ff8f8a88d8af6a3478776e3d6ef749a 1 parent 9a2f0ef
@sorbits sorbits authored
Showing with 7 additions and 11 deletions.
  1. +7 −11 Support/lib/make.rb
View
18 Support/lib/make.rb
@@ -30,27 +30,23 @@ def perform_make(target = nil)
elsif line =~ /^g?make.*?: Leaving directory `(.*?)'$/ and not $1.nil? and File.directory?($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#)
- make_txmt_link(dirs, $1, $2, $3, $4)
- elsif line =~ /^(.*?):(?:(\d+):)?(?:(\d+):)?\s*(.*?)$/ and not $1.nil?
+ make_txmt_link(dirs, $2, $3, $4, $1, $5)
+ elsif line =~ /^((.*?):(?:(\d+):)?(?:(\d+):)?)(.*?)$/ and not $1.nil?
# GCC, et al
- make_txmt_link(dirs, $1, $2, $3, $4)
+ make_txmt_link(dirs, $2, $3, $4, $1, $5)
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 }
unless path.nil?
parms = [ "url=file://#{e_url path}" ]
parms << [ "line=#{lineno}" ] unless lineno.nil?
parms << [ "column=#{column}" ] unless column.nil?
- info = file
- info << " at line #{lineno}" unless lineno.nil?
- 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"
+ info = file.gsub('&', '&amp;').gsub('<', '&lt;').gsub('"', '&quot;')
+ "<a href=\"txmt://open?#{parms.join '&'}\" title=\"#{info}\">#{title}</a>#{htmlize message}<br>\n"
end
end
Please sign in to comment.
Something went wrong with that request. Please try again.