Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feature request: apply different color for errors in local namespaces #499

Closed
wilkerlucio opened this issue Sep 16, 2014 · 7 comments
Closed
Milestone

Comments

@wilkerlucio
Copy link

Hi,

Doing some debugging here I'm finding that sometimes is very difficult in a long stack to find the calls that happens on my local namespaces.

Would be great if you detect local namespaces (those that are not on dependencies) and put a different color on those, I think that would greatly improve the agility when trying to find the error on the stack.

@cursive-ide
Copy link
Owner

Do you mean in the REPL view?

One thing I'm going to look at implementing is using code folding to optionally hide all elements of the stack trace that don't originate from the current project.

@wilkerlucio
Copy link
Author

Yes, on the REPL, sorry wasn't clear about that.

Yeah, folding would be another great option, I suggested the coloring because I think it's simpler (maybe I'm wrong, hehe), and even with the folding having also the coloring could be nice too (for when you actually want to see the full stack, but making easy to notice which points are local).

@cursive-ide
Copy link
Owner

Ok, I'll see what I can do - this might not be too easy since Cursive now delegates to the underlying exception printing lib used by the project (clj-stacktrace, aviso/pretty or whatever).

@wilkerlucio
Copy link
Author

I see, so, maybe a good option would be pick one of those and see if I can enable the feature there? If someone manage to print the colored stack that way, the colors would appear on the REPL?

@cursive-ide
Copy link
Owner

Yes, if you print the stack lines with different ANSI colours, this will come out in the REPL. The difficulty doing what you want to do in the exception printing library will be knowing which trace elements are within the project.

@wilkerlucio
Copy link
Author

Yeah, another simpler solution that came to my mind would be do a generic parsing on the output looking for symbol names (/\w+\.\w+\/\w+/, \w+ here is just to generalize the symbol parsing) on the stack output. I could try to do that by parsing the errors at REPL level maybe, I'm not sure if that's really possible, but if I ran this wrapper at my user namespace level I think would be easier to detect which namespaces are local. Makes sense?

@cursive-ide cursive-ide added this to the 0.1.55 milestone Apr 27, 2015
@cursive-ide
Copy link
Owner

This is fixed in the next build, using code folding. Stack traces are prettified to their Clojure meanings, and trace elements from outside the project are folded by default.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants