IntellIJ 2020.2 added Indentation-based brace handling for Scala mentioned on the website here whatsnew. How do I disable this feature? I've searched for keywords "indent brace" and "brace handling" and cant see a setting that would disable it under "Code Style -> Scala".
As per IntelliJ Scala Plugin 2020.2: Indentation-based Brace Handling search for
Editor | General | Smart Keys | Scala | Control curly braces based on line indentation
Related
I have been using Ultraedit 16 for Perl editing.
I'm thinking about migrating to Notepad++ and gave it a try.
Here's how Ultraedit does highlighting. The cursor is on the last brace, and the matching first brace is highlighted:
Here's how Notepad++ highlights the same code. Cursor in the same place, but no highlight on the matching first brace.
I've looked through the configuration and searched elsewhere, it seems that the highlighting should be possible, but I'm not finding it.
Found it after more digging - Settings => Style Configurator => Global Styles => Brace Highlight style. I can set a background style there to make the matched brace more visible.
One possible result:
I am looking for plugin for PhpStorm that allows me to surround selected text like it is in Sublime Text.
Example:
//selected text:
foo();
//press the ' char
//result
'foo();'
I totally do not know how such plugin may be named.
It's a built-in functionality. Just ensure that you have this option enabled:
Settings/Preferences | Editor | General | Smart Keys --> Surround selection on typing quote or brace
Currently my eclipse formatter formats a multiline function call like this:
someObject.doSomething(
some().long().chain().of().methods()
);
But what I want is for eclipse to align the closing bracket with the method call:
someObject.doSomething(
some().long().chain().of().methods()
);
I have tried playing around with new line and wrapping rules in the code formatter but haven't been able to achieve this. What would be the solution?
After some time of digging I found a similar question which has an accepted answer but seems not to answer the same question:
Can the Eclipse formatter be configured to indent multiple lines between parenthesis properly?
The author of this question also states:
Edit: I found the settings for "Line Wrapping" -> "Default indentation
for wrapped lines" and "Default indentation for array initializes" and
have set them to "1" instead of "0". That is better for the array
initializers, but still doesn't indent closing parethesis to match the
opening parenthesis the way that I want it to:
The latest proposal on this does not take into account the closing );, but the first expression.
See Eclipse 4.23 (Q1 2022):
Method invocation wrapping indentation
It turns out it's not obvious how to indent a wrapped method invocation when the preceding expression itself is complex enough to also be wrapped into multiple lines.
Should the indentation be added to the existing indentation at the end of the expression, or just reset and assume that only the indentation of expression's first line matters?
Previously only the former behavior was available, now there's a setting to choose the latter.
The checkbox called Indent from the base expression's first line is located in the Line Wrapping > Wrapping settings > Function calls section, right under the Qualified invocations setting.
Basically, Intellij is making my code extremely hard to read by underlining lots of my code. It kind of makes a chess board on the left of my screen as well! =>
I have looked through the code editor settings but I can't find one under scala which controls these underlines. I am using the twilight theme but I have only just noticed the issue. Any ideas Intellij buffs?
IntelliJ 12:
Settings -> Editor -> Colors & Fonts -> Scala -> Implicit Conversions
Uncheck "Effects -> Underline"
IntellIJ 11 or Before:
Settings -> Code Style -> Scala -> Other -> Other settings -> Highlight methods added via implicit conversion.
However anyway it's usability problem of this feature. Something different should be done to highlight implicit conversion for such places.
The attributes used for different kinds of highlighting are configured under Settings | Editor | Colors & Fonts.
In Idea 12, it can be disabled at Settings | Editor | Colors&Fonts | Scala | Implicit conversion. I just unchecked Effects but it's also possible to choose something else than Underscore.
Hope that helps.
To disable underlining in JSP/HTML I usually click the little man in a hat in the bottom right corner and set highlighting levels to None:
I think it should be the same with Scala
In the last time I often initialize arrays in this form :
int[] test = new int[]{1,2,3};
When I type '[', NetBeans immediately put the closing brace.
The question is - which is the macro to do the same job with curly braces ?
Select from menu Tools > Options, select Editor in toolbar, go for Code Completion tab.
You will see that Insert Closing Brackets Automatically is already automatically checked by default.
There was a guy, who asked an analogical question a while ago. There was no helpful answer. I guess that means that we should look for that in future versions.
I looked for solution too, for NetBeans 8.5 check answer, https://stackoverflow.com/a/38338967/7162006, in same window is option: Completition Selectors For Java add: {, autocomplete by hiting enter in editor. (classically)
This macro work to me:
Shortcut: Shift + {
Macro code: "}" caret-backward