That was one of the bigger reasons why I lost interest in the Go language.
Having a block that does not fit on the screen is almost surely code smell in Julia. Instead of expecting the language or an external tool to protect you from this, you should break up your code into smaller functions.
As I said, this is useful mostly for modules and types. You canât break anything up there.
My understanding is that the original proposal (and most of the discussion) was for all blocks.
That said, module ... end
is regularly broken up to pieces, using include
. Composite types longer than a screen are, again, code smell, and are fortunately rare.
Correct, but I also mentioned this point all the way up
That is not always a solution for some nested modules.
This is definitely not true. I agree it shouldnât happen for all types but anything with more than one or two inner constructor can easily be long and that is not a problem at all.
And again, I donât think changing (adding to) the keywords is the right solution here, comment is enough, Iâm replying again just because people keep saying that long block shouldnât exist.
Is this true with Atom+Juno? I donât see them but maybe I need an extra package?
Yes. Itâs in Settings > Editor > Show Indent Guide.
Iâd also recommend the indent-guide-improved package because it clearly indicates at what level of indentation the cursor is at:
IMHO itâs a bit ugly by default but you can add the following to your styles.less
.indent-guide-improved {
background-color: @syntax-text-color !important;
opacity: 0.2;
&.indent-guide-stack {
opacity: 0.5;
&.indent-guide-active {
opacity: 0.9;
}
}
}
Thatâs pretty cool. Somewhat amusingly, the indent guide failed to work inside my styles.less
because you use two spaces as tabs:
Is there a way to automatically fix 2 â 4 tab length? Atom Beautify apparently does not support Julia.
indent-dective works quite well since I fixed it in the last release.
Maybe Iâm missing something, but doesnât indent-detective just discover what the correct indentation is in a file? Does it also re-indent copy-pasted code to the correct indentation?
Yeah I just noticed I didnât answer your actual question. You can force the indent to 4 spaces (either by using indent-detctive or some other way) and the use the Editor: Auto Indent
command. Note that that might mess up any non-standard indents though.
Yess. It works