I keep forgetting about this task, which would probably only take half an hour, so I'm starting this ticket to keep track of shortcomings in the Jython editor.
- completions for imports works well, but the documentation popup would also be nice. "from org.das2.util.filesystem import FileSystemU<c>" This is particularly useful, because I know the completion can be done without executing any code, and provides a nice way to get at the javadocs.</c>
Item 1 is done.
"2". the completion for FileSystemUtil is the no-argument constructor FileSystemUtil(), when I intend to use FileSystemUtil.<c>. I should put in a private no-arg constructor to indicate that this is a helper class of static methods, and in this case make sure the constructor is not a completion.</c>
Last edit: Jeremy Faden 2016-10-07
"3". In this code, you should be able to do completions within the paint method, because it knows "g" is a Graphics object.
Last edit: Jeremy Faden 2017-04-11
(item4) Package completions:
from org.autoplot.pngwalk import <c> and
from org.autoplot.p<c> </c></c>
should work so you can peek around package.
Last edit: Jeremy Faden 2018-02-22
I use the package completions all the time to get documentation, when completions within the code don't work.
I reworked how some of the completions were done (old code was still parsing jython by hand), and this has broken some of the completions. This would be another nice January study...
Also, with the new custom Renderers in Jython, it would be all the more helpful to get completions on "g" "xaxis" and "yaxis" of "def render( self, g, xaxis, yaxis, monitor )"
Last edit: Jeremy Faden 2017-12-22
Also I need to study why /home/jbf/ct/autoplot/script/2017/20171221/snowFlake.jy shows where "from math import cos" is needed because the default cos always returns dataset.
(2019-02-18: this is not needed.)
Last edit: Jeremy Faden 2019-02-18
shows DataSourceUtil() when it is a bunch of static methods. This should not have the parentheses.
Also, Netbeans Jython completions look very nice, and these should be reviewed as well.
Also, Masafumi and I were working on a script and it was clear that completions were loading data in the background.
(item5). I find now that often I can't get completions down in the code so I pop up to the top to get compltions. This should never happen, and I'm pretty sure the old completions model would refactor to a code which would always work, while the new syntax-based refactoring leaves things in that shouldn't be.
(item6). "ds= plot( ripples(10),<c> " gives completions on ripples, not plot.
(item7). "ds= plot( ds,⎵<c>" gives different completions than "ds= plot( ds,<c>" (⎵ is space)</c></c></c>
Last edit: Jeremy Faden 2018-02-22
For the posting from 2018-01-25, DataSourceUtil had a public constructor. If classes do not have a public constructor, then no parenthesis are shown.
It would be nice if the completion for this would add the dot automatically and show all static methods.
(Whoops, see 2016-10-07 above, where I realized this.)
Last edit: Jeremy Faden 2018-02-22
This demos item 5, I think:
Here's a second demo of item 5:
I think item 5 is working now. The problem was the simplify script wasn't removing lines like "tot=nn[0]+nn[1]" where it didn't have nn resolved.
DatumRangeUtil wasn't accepted automatically:
Also, I forgot the keyboard shortcut ctrl-shift-F12.
The problem is that parseTimeRange was throwing an exception, because tr was not a time range. I've improved the error feedback.
Last edit: Jeremy Faden 2018-02-24
I should note too that by now I'm sure that this all needs to be rewritten. What should happen is a the jython initialization code should also be parsed (or run) to form all the symbols there, and then a table of fast functions (e.g. fltarr can always be run within a few millisecond, as opposed to fftPower which needs many seconds to run--look for progress bars in the APIs) is used to see which lines can be left in the code.
(item8) you can't get documentation on the second line after continuation:
(item9) When optional argument anchorType "canvas" misspelled the error message was confusing. Optional arguments to the plot command (and annotation) need to be updated.
Last edit: Jeremy Faden 2018-02-28
Regarding (item9) , I made it so that for the plot documentation, the "see also" link is detected and added to the completion popup.
Regarding (item9),
d= annotation( blah='s' )
gives a fine error.
a= annotation( anchorType='canvaz' )
could be improved to show the enumerated values.
Ivar, is it one of these two cases you observed?
(item10) This shows where in one place it gets the documentation (C1) and in another (C2) it doesn't:
(Item 11) This should work but doesn't:
What string concentation would allow for completions, this should be done.
Last edit: Jeremy Faden 2019-02-11
(Item 12) Multiline with indents is not treated properly. When I try to run the following script, it fails at line 12 with a syntax error.
This may be the same as (item 8).
Last edit: Jeremy Faden 2019-12-19
Regarding (item 12), Actions->Developer->"Show Simplified Script" shows how the addToSearchPath looses its third line.
item12 is only inclusive now when the last line is a continuation (starting with whitespace).
See https://github.com/autoplot/dev/tree/master/bugs/sf/1687
Item 8 remains (completion on third line).