groovy-notifications mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Adam L. Davis (JIRA)" <j...@apache.org>
Subject [jira] [Updated] (GROOVY-9023) In Groovy console, add a script binding allowing values to associate to code lines
Date Fri, 08 Mar 2019 13:46:00 GMT

     [ https://issues.apache.org/jira/browse/GROOVY-9023?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
]

Adam L. Davis updated GROOVY-9023:
----------------------------------
    Description: 
# Add internal method to groovy console for determining line of code in script from method
call (I've got a way to do this but perhaps someone could find a better way):
 try \{throw new Exception()}
 catch (Exception e) \{ StackTraceUtils.sanitize(e) return e.stackTrace[0] }

2. Add script binding (named _c maybe) to script which has a method or methods that add a
value to a list associated with current code line and variable name (propertyMissing?).

Allowing following syntax:

x = 1
 for (i in 1..10) _c.x = x++
 x

3. Output the values from _c into console's output. For example, following above:

x = 1

{{x = 2 3 4 5 6 7 8 9 10 11}}

x = 11
 4. Output lines up with code line that produced it (or at least near it).

5. Also, once _c is used, the font-sizes and scrollbars for the code and output need to be
synchronized (so they line up)

  was:
# Add internal method to groovy console for determining line of code in script from method
call (I've got a way to do this but perhaps someone could find a better way):
 try \{throw new Exception()}
catch (Exception e)
{ StackTraceUtils.sanitize(e) return e.stackTrace[0] }

2. Add script binding (named _c maybe) to script which has a method or methods that add a
value to a list associated with current code line and variable name (propertyMissing?).

Allowing following syntax:

x = 1
 for (i in 1..10) _c.x = x++
 x

3. Output the values from _c into console's output. For example, following above:

x = 1

{{x = 2 3 4 5 6 7 8 9 10 11}}

x = 11
 4. Output lines up with code line that produced it (or at least near it).


> In Groovy console, add a script binding allowing values to associate to code lines
> ----------------------------------------------------------------------------------
>
>                 Key: GROOVY-9023
>                 URL: https://issues.apache.org/jira/browse/GROOVY-9023
>             Project: Groovy
>          Issue Type: Improvement
>          Components: Groovy Console
>    Affects Versions: 3.0.0-alpha-4
>            Reporter: Adam L. Davis
>            Priority: Minor
>
> # Add internal method to groovy console for determining line of code in script from method
call (I've got a way to do this but perhaps someone could find a better way):
>  try \{throw new Exception()}
>  catch (Exception e) \{ StackTraceUtils.sanitize(e) return e.stackTrace[0] }
> 2. Add script binding (named _c maybe) to script which has a method or methods that add
a value to a list associated with current code line and variable name (propertyMissing?).
> Allowing following syntax:
> x = 1
>  for (i in 1..10) _c.x = x++
>  x
> 3. Output the values from _c into console's output. For example, following above:
> x = 1
> {{x = 2 3 4 5 6 7 8 9 10 11}}
> x = 11
>  4. Output lines up with code line that produced it (or at least near it).
> 5. Also, once _c is used, the font-sizes and scrollbars for the code and output need
to be synchronized (so they line up)



--
This message was sent by Atlassian JIRA
(v7.6.3#76005)

Mime
View raw message