You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I noticed that using array comprehension syntax inside of a function seems to confuse the IDE's ability to correctly fold code.
As a minimal example, consider the following working example:
When you click the downward-facing arrow on the left, the function is collapsed correctly:
Now let's try it with the following code:
Clicking the arrow does this:
This looks innocent enough until you realize that in a non-minimal example, all of the code underneath the function tempfunc would be folded into the body of tempfunc, including code which does not even belong in the body of tempfunc's definition.
This effectively makes it impossible to both use array comprehension syntax and still have the code-folding work properly on screen. The code itself executes properly, of course, but the array comprehension seems to confuse the IDE into incorrectly swallowing up every line of code underneath.
I suspect the reason has something to do with the fact that in a normal for loop, it begins with for and ends with end, but in array comprehension syntax, it begins with a for, but there is no end, and so the IDE searches for the next available instance of end, which typically belongs to an unrelated body of code, or (in the case of the minimal example above) does not exist. I haven't tested this on other platforms (I'm using Julia Studio 0.4.4 on Mac OS X 10.6), but it shouldn't be hard to test on other systems.
Other than this and some syntax-coloring issues I've been having, the software has been pretty fantastic.
The text was updated successfully, but these errors were encountered:
I noticed that using array comprehension syntax inside of a function seems to confuse the IDE's ability to correctly fold code.
As a minimal example, consider the following working example:
When you click the downward-facing arrow on the left, the function is collapsed correctly:
Now let's try it with the following code:
Clicking the arrow does this:
This looks innocent enough until you realize that in a non-minimal example, all of the code underneath the function
tempfunc
would be folded into the body oftempfunc
, including code which does not even belong in the body oftempfunc
's definition.This effectively makes it impossible to both use array comprehension syntax and still have the code-folding work properly on screen. The code itself executes properly, of course, but the array comprehension seems to confuse the IDE into incorrectly swallowing up every line of code underneath.
I suspect the reason has something to do with the fact that in a normal for loop, it begins with
for
and ends withend
, but in array comprehension syntax, it begins with afor
, but there is noend
, and so the IDE searches for the next available instance ofend
, which typically belongs to an unrelated body of code, or (in the case of the minimal example above) does not exist. I haven't tested this on other platforms (I'm using Julia Studio 0.4.4 on Mac OS X 10.6), but it shouldn't be hard to test on other systems.Other than this and some syntax-coloring issues I've been having, the software has been pretty fantastic.
The text was updated successfully, but these errors were encountered: