[Gd-chatter] r11749 - trunk/fundev/sources/environment/dswank
hannes at gwydiondylan.org
hannes at gwydiondylan.org
Tue Mar 25 00:52:36 CET 2008
Author: hannes
Date: Tue Mar 25 00:52:36 2008
New Revision: 11749
Modified:
trunk/fundev/sources/environment/dswank/dswank.dylan
Log:
Job: fd
support for reading compiler warnings. this currently reads "all"
compiler warnings and serious warnings. It should only read those
from the actual library, probably.
Modified: trunk/fundev/sources/environment/dswank/dswank.dylan
==============================================================================
--- trunk/fundev/sources/environment/dswank/dswank.dylan (original)
+++ trunk/fundev/sources/environment/dswank/dswank.dylan Tue Mar 25 00:52:36 2008
@@ -99,8 +99,36 @@
new-directory;
end;
-//define swank-function compiler-notes-for-emacs ()
-//end;
+define swank-function compiler-notes-for-emacs ()
+ *project* := open-projects()[0];
+ let warnings = project-warnings(*project*);
+ let res = make(<stretchy-vector>);
+ for (w in warnings)
+ let message = compiler-warning-full-message(*project*, w);
+ let short-message = compiler-warning-short-message(*project*, w);
+ let source-form = warning-owner(*project*, w);
+ let location = if (source-form)
+ get-location-as-sexp(#f, source-form).tail.head;
+ else
+ #(#":error", "No error location available")
+ end;
+ let severity = if (instance?(w, <compiler-error-object>))
+ #":error"
+ elseif (instance?(w, <serious-compiler-warning-object>))
+ #":warning"
+ else
+ #":note"
+ end;
+ let warning =
+ list(#":message", message,
+ #":severity", severity,
+ #":location", location,
+ #":references", #(),
+ #":short-message", short-message);
+ res := add!(res, warning);
+ end;
+ res;
+end;
//define swank-function describe-symbol (symbol-name)
//end;
@@ -163,12 +191,16 @@
list(#":location",
list(#":file", as(<string>, source-name)),
list(#":line", lineno, column),
- list(#":snippet" search)));
+ if (search)
+ list(#":snippet" search)
+ else
+ #()
+ end));
end;
define swank-function find-definitions-for-emacs (symbol-name)
let env-obj = get-environment-object(symbol-name);
- list(get-location-as-sexp(symbol-name, env-obj));
+ list(get-location-as-sexp(#f, env-obj));
end;
define swank-function listener-eval (arg)
More information about the chatter
mailing list