[TxMt] XCode - Clickable error messages
throw-away-1 at macromates.com
Thu May 3 02:46:41 UTC 2007
On 5. Apr 2007, at 18:54, Gerd Knops wrote:
> On Apr 5, 2007, at 12:26 AM, Allan Odgaard wrote:
>> Related to this, I have an ASSERT() macro which aborts() and does
>> a stack dump from the place where it aborts, this stack dump has
>> files and line numbers, and I’ve been pondering making that into
>> clickable links -- the format though is not the standard:
> I have done just that, using a small perl postprocessor parsing the
> output from the run_xcodebuild.sh, looking for patterns and
> replacing them with txmt links. It is kind of ugly, my current
> project has source files divided into folders so I devised a small
> search routine that descends from TM_PROJECT_DIRECTORY to find the
> source file (ignoring _darcs/.svn repositories). Works fairly well,
> but just to ugly and specialized to my environment to share.
> Ideally we'd come up with a standard pattern for error messages,
> and add that functionality into the xcode stuff. That way anyone
> could generate clickable links by just formatting log or error
> messages in a certain way.
Returning to this subject… the way we deal with it in ScriptMate is
by setting a TM_FD variable for the process we launch. This process
can then write HTML to that file descriptor, which will be shown as-
is (i.e. interpreted) in the HTML output window.
This does put a higher burden on the program which wish to have
clickable errors, OTOH it allows for nicer formatting of the output
(which is often possible when we’re dealing with stack dumps).
Would this be a useful implementation for the Xcode runner? Basically
that runner would then only need to create a pipe and set the write-
end’s file descriptor as an environment variable, for the process we
launch (and then start a JS reader process that takes output for the
pipe and inserts it in a special div).
We could offer a standard filter that greps the program output for
«file»:«line»(:«column»)?:«error» and writes a HTML’yfied version to
the $TM_FD file descriptor.
More information about the textmate