editors

changeset 34:41e1f22adc1d

TextMate/e-TextEditor bundle now processes ex.err files and allows the user to jump right to the error. Added to syntax.ex a bit more eudoc examples for better testing.
author Jeremy Cowgar <jeremy@cowgar.com>
date Sat Nov 27 14:09:56 2010 -0500 (2010-11-27)
parents 5269ddea49c2
children d5b077700445
files Euphoria.tmbundle/Commands/Test Current File.tmCommand syntax.ex
line diff
     1.1 --- a/Euphoria.tmbundle/Commands/Test Current File.tmCommand	Sat Nov 27 12:41:39 2010 -0500
     1.2 +++ b/Euphoria.tmbundle/Commands/Test Current File.tmCommand	Sat Nov 27 14:09:56 2010 -0500
     1.3 @@ -9,7 +9,7 @@
     1.4          <key>input</key>
     1.5          <string>none</string>
     1.6          <key>output</key>
     1.7 -        <string>showAsTooltip</string>
     1.8 +        <string>showAsHTML</string>
     1.9          <key>command</key>
    1.10          <string># just to remind you of some useful environment variables
    1.11  
    1.12 @@ -22,17 +22,45 @@
    1.13          <string>#!/usr/bin/env eui
    1.14  
    1.15  include std/filesys.e
    1.16 +include std/io.e
    1.17 +include std/search.e
    1.18  
    1.19  sequence FilePath = getenv("TM_FILEPATH")
    1.20  sequence FileDir  = getenv("TM_DIRECTORY")
    1.21  
    1.22  filesys:chdir(FileDir)
    1.23 +filesys:delete_file("ex.err")
    1.24  
    1.25 -sequence command = sprintf("eui -test -batch %s", { FilePath })
    1.26 +sequence command = sprintf("eui -wf ex.warn -test -batch %s", { FilePath })
    1.27  if system_exec(command) = 0 then
    1.28 -	puts(1, "Success")
    1.29 +	puts(1, `&lt;font color="#448844"&gt;&lt;b&gt;Success&lt;/b&gt;&lt;/font&gt;`)
    1.30  else
    1.31 -	puts(1, "Failure")
    1.32 +	puts(1, `&lt;font color="#ff0000"&gt;&lt;b&gt;Failure&lt;/b&gt;&lt;/font&gt;: `)
    1.33 +	
    1.34 +	object exerr = io:read_lines("ex.err")
    1.35 +	if sequence(exerr) and length(exerr) then
    1.36 +		integer colon_pos = rfind(':', exerr[1])
    1.37 +		if colon_pos != 0 then
    1.38 +			sequence file_name = exerr[1][1 .. colon_pos - 1]
    1.39 +			sequence line_no   = exerr[1][colon_pos + 1 .. $]
    1.40 +			
    1.41 +			file_name = find_replace('\\', file_name, '/')
    1.42 +			
    1.43 +			sequence error_line = sprintf(`&lt;a href="txmt://open?url=file:///%s&amp;line=%s"&gt;%s, Line %s&lt;/a&gt;`, {
    1.44 +					file_name, line_no,
    1.45 +					file_name, line_no
    1.46 +				})
    1.47 +			printf(1, "%s\n", { error_line })
    1.48 +		end if
    1.49 +		puts(1, "&lt;pre&gt;\n")
    1.50 +		for i = 1 to length(exerr) do
    1.51 +			sequence line = exerr[i]
    1.52 +			
    1.53 +			printf(1, "%s\n", { line })
    1.54 +		end for
    1.55 +	else
    1.56 +		puts(1, "Unknown Failure")
    1.57 +	end if
    1.58  end if
    1.59  </string>
    1.60          <key>scope</key>
     2.1 --- a/syntax.ex	Sat Nov 27 12:41:39 2010 -0500
     2.2 +++ b/syntax.ex	Sat Nov 27 14:09:56 2010 -0500
     2.3 @@ -1,8 +1,16 @@
     2.4  --**
     2.5  -- Section Heading:
     2.6 +--
     2.7  -- This file was created for the purpose of testing syntax
     2.8  -- highlighting for various editors. It is syntactically correct
     2.9 --- but will not execute or do anything useful.
    2.10 +-- but will **not** execute or do anything useful.
    2.11 +--
    2.12 +-- Parameters:
    2.13 +--   * ##name## - name of person to say hello to
    2.14 +--   * ##greeting## - greeting to say to `name`, defaults to "Hello"
    2.15 +--
    2.16 +-- See Also:
    2.17 +--   [[:check_method]] and [[:say_hello]]
    2.18  --
    2.19  
    2.20  namespace abc

SCM Home | OpenEuphoria.org Home