-
-
Notifications
You must be signed in to change notification settings - Fork 286
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
!script file name and path #344
Comments
I don't have any knowledge of GoogleScriptEngine, and it isn't obvious how it helps from a quick Google search. Please feel free to submit a PR or provide more information. Thanks! |
Thanks for quick reaction, Simon.
Alas, I forgot how I did it like 5 years ago.
Without name of file consequent stack trace (and IDE debugging) can not show file name (and open it in IDE, handle breakpoints), because runtime has no idea about original file name, and even if file was external (
Let us start by passing if(input is external)
engine.eval(new FileReader(scriptFile), bindings); // when input is external file; when
else
engine.eval(script.toString(), bindings); // as is This will give proper file name to IDE and backtrace, hopefully enabling breakpoints and make life of script developers a tad bit happier? |
I've pushed some changes (see ff37cc2) ... but they only seem to work for Ruby unfortunately. If you have any further ideas, please let me know. |
wow, that was fast, Simon. thanks for your effort. testing... will consider a bit deeper this weekend |
For Googlers: take structurizr java, remove signing part from
Check out https://github.com/structurizr/lite, change structurizrVersion to 3.1.0,
Simon, thanks a lot: I'm super happy now, breakpoints and stack filtering work now: Maybe some stack trace sanitation would help, reading.... |
While IntelliJ IDEA manages to filter stack fine. Currently message has no line number where bad things in script happened:
Neither do log files:
|
I guess, most interesting lines with .groovy file line on them got hidden under ".... N more" cuts. Not sure how to handle that properly. Not sure how to do that in properly, since you don't really know about Groovy implementation details under the ScriptEngine's hood. |
Maybe just simple call would work, since we know that GroovyScriptEngine is on your class path. |
Just call this one methods around exception to cleanup stack trace. Hopefully this would reach all targets...
|
Description
Currently scripts have no file name in debug info, so when I'm trying to debug them I get no breakpoints and no stepping around.
Priority
I have no budget and there's no rush, please add this feature for free
More information
Workaround: breakpoint in some lib method, like System.println and inspect whatever passed in there:
(This is much faster than reading tons of manuals/sources sometimes, for some people)
Yet, it would be easier still if that debug info would've been provided.
I guess, it's pretty simple option of GoogleScriptEngine, which costs next to nothing runtime.
Maybe you'd turn it on by default (or provide some way to enable it)?
The text was updated successfully, but these errors were encountered: