Android Studio/Intellij hard Wrap (Flutter?) - flutter

I dont understand how do I change this new line "line" and change the point where the IDE starts a new line when I press STRG+ALT+ENTER. I also tried "Code style -> General -> Hardwrap" but it dosent change anything!
I saw it depends on the Programming langurage I use.... Now I have really no idea how to change this

It can be configured in Settings | Editor | Code Style | Dart > Line length.

Related

How to disable a tip line in VS code with Rust program?

In the screenshot shown here:
VS code automatically added a tip line showing as "1 implementation" in the Rust code between line 14 and line 15.
My question is: how can I disable this gray tip line? and what is the official name for such tip lines inserted?
Assuming you're using rust-analyzer, in File | Settings | search for Rust Analyzer > Lens: Implementations and uncheck the box then restart VS Code.
The corresponding (boolean) JSON value is rust-analyzer.lens.implementations.
You can still find implementations by right clicking on the type anyway, so there's no real loss in setting it to false.

VS Code adds spaces between content when pasting

When I copy this, for example:
<AdmobComponent/>
It pastes as:
< AdmobComponent / >
Does anyone have any suggestions? I don't even know where to start to fix this.
From within the IDE:
Go to File | Preferences | Settings and then click Text Editor | Formatting.
The top option should be FormatOnPaste, make sure this is unchecked.
If you are using the Prettier extension, then this is a known issue.
For anyone having a similar problem in Visual Studio 2019 it can be fixed as follows:
Go to Tools | Options | Text Editor | {language}
Now depending on the Language the options that need to be changed could be in a few different places or missing. But for C# and JavaScript go to Code Style | Formatting
Once there there are a few options. If "Automatically format on paste" is unticked it will completely remove any reformatting on paste.
Or for a more limited impact go into the "Spacing" section and change "Set spacing for operators" to "Ignore spaces around binary operators". By doing this some automatic reformatting is lost but I think it's worth it not to have all those spaces inserted into stuff like Kebab case variables.

Is there any way to get such type of line wrapping in Eclipse?

Eclipse sure provides a lot of ways to customize code formatting, but I'm missing the one I'm used to. It is "when line exceeds maximum length, recursively wrap and indent each argument and put the closing parenthesis on a new line without additional indentation". Like this:
Horse samuel = new Horse(
9.1051,
Color.RED,
new Music(1),
new Music(
"frying pan",
Taste.SWEET,
Russian.HELICOPTER
),
State.ARIZONA
);
However it is not implemented in standard Eclipse formatting tools. Can I achieve this through some plugins? There is a 1.5 year old bug in Eclipse bug tracker, but it is unlikely to get any attention any time soon: https://bugs.eclipse.org/bugs/show_bug.cgi?id=370540
I think you are going to have to create a custom profile formatter in eclipse to get it to do this. Window -> Prefrences -> Java -> Code Style -> Formatter
Under the Line Wrapping tab is the option for line width = Maximum line width. I think thats as good as it gets without that bug fix.
Also, use the Line Wrapping policy = Wrap all elements, every element on a new line.
Thats as close as I could get it to do what you are asking.

How can I get Intellij to stop underlining my scala code?

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

How to disable auto formatting upon save in Eclipse?

Eclipse keeps auto formatting upon save, for example: it is insisting the following code should be in a single line once I save, despite breaking it up the way I want to.
#Transactional(rollbackFor = DataAccessException.class, readOnly = false, timeout = 30, propagation = Propagation.SUPPORTS, isolation = Isolation.DEFAULT)
Window > Preferences > Java > Editor > Save Actions.
Can also be configured at the project level. Project > Properties > Java Editor > Save Actions.
Absolutely maddening improvement. For if statements do the following:
Window | Preferences | Java | Code Style | Formatter | Control statements tab
Select Keep simple if on one line.
You might also try the Line wrapping tab
This is a Late answer, But just for novice to understand it clearly I have a snapshot of the setting.
Please follow the path on left.
And change highlighted setting.
If you wish to keep the auto-formatter, but don't want this behavior, you can also configure it in the fomatter :
right click on the project -> properties -> java code style -> formatter
(If you don't have a project specific formatter the global configuration can be accessed this way : Window -> Preference -> Java -> Code Style -> Formatter).
Edit... the active profile, open the Line Wrapping tab, and there check the Never join already wrapped lines option.
This way you can wrap lines wherever you want and eclipse won't remove your line breaks (which is a must if you wish to have readable lambda expressions), but keep the formatter active.
This option is there at least since eclipse Luna
Here is a screenshot where this option is :
Just wanted to add a tip. If you want to avoid the line wrapping you can simply increase the "Maximum line width" value to something enormous. As long as that is sufficiently high eclipse won't do any wrapping.
Preferences > Java > Code Style > Formatter > Edit > Line Wrapping > Maximum line width