All Questions
Tagged with code-formatting android-studio
49
questions
1
vote
1
answer
739
views
Android Studio formats Dart code differently than the dart format tool
Android Studio settings in Editor -> Code Style -> Dart state that:
Code is formatted using the dart format tool included with the Dart SDK. See FAQ.
But in some cases, it seems to be behave ...
1
vote
2
answers
908
views
Format Kotlin with minimal indent for code blocks in constructor parameters, like Foo({ bar })
When formatting this code block (from the Kotest documentation), Jetbrains Intellij or Android Studio adds a lot of unnecessary white space.
Original code:
class MyTests : FreeSpec({
"String....
0
votes
1
answer
210
views
How do I prevent the Reformat Code action for Markdown files from putting a full stop on a line of its own?
I find that the "Reformat Code" action in IntelliJ (and, by extension, Android Studio) will put a full stop on a new line in Markdown files if the full stop is the character at the "...
1
vote
0
answers
72
views
How to disallow android studio from auto formatting the whole file when a piece of code is generated and added
EDIT -Andoird studio by default even formats the whole AndroidManifest file while adding the activity that I create using the template.
I am working on an android app project with multiple people in ...
1
vote
1
answer
913
views
Is there a way to auto format all changed files in Android Studio?
I don't want to auto-format the whole project and get blame in files I have not edited in this PR.
Can I apply linting on only the modified files without manually having to find and select them?
If ...
1
vote
0
answers
889
views
flutter code formatting in vscode like in Android studio
In Android Studio when you have Column of widgets it is very convenient to collapse the code like :
But in VSCode you cannot see the if there is a coma in the end, and even add it in collapsed mode.
...
2
votes
1
answer
34
views
Is there any plugin for Intellij (Android Studio) where Entity Code is formatted as Properties and Getters and Setters separately?
Is there any plugin for Intellij (Android Studio) where Entity Code is formatted as Properties and Getters and Setters separately?
Input:
public class Employee {
private String name;
...
5
votes
3
answers
5k
views
difference between Reformat Code / Reformat Code with dartfmt
In Android studio, when I open a dart file, I see two options to format the code, so my question is
What is the difference between Reformat Code / Reformat Code with dartfmt
33
votes
5
answers
9k
views
How to increase the width of the code line in Android studio?
I am using Android studio to develop a flutter app, when I click reformat code with dart format it breaks in unpleasing format.
Even though there is lot of space it breaks the line, how can i ...
9
votes
1
answer
473
views
How to save dart file in file system with android studio generated comments?
I like how Android Studio and Visual Studio , generate the comments for each closing brackets, but when I open the same file in notepad++ or any other text editor, I don't see those comments. Is there ...
1
vote
0
answers
45
views
android-studio : formatting dialog inserts unknown character
I am using Android Studio on Windows 10. While formatting code, by pressing:
ctrl + shift + alt + L
It inserts some unknown character into code, along with showing formatting dialog as:
I tried to ...
0
votes
0
answers
32
views
Android Studio Code Format adds empty Strings
I have this line in a Java file in Android Studio:
MyClass.staticX(myMethod(), String.format("Hello I am a demo text. A: %s, Here comes AA: %s.", OtherCoolClass.longMethodNameWithVeryMuchMeaningYo(...
0
votes
1
answer
205
views
Android Studio doesn't align my code by attributes
When I'm working in Android Studio and I want to make, for example, a new button. I type button and Android Studio gives me the correct line for inserting a button. When I press enter, Android Studio ...
1
vote
2
answers
4k
views
How to remove tabs on multiple rows at once
This is not a programming question but an inconvenience in the android-studio editor.
If you have an unwanted tab before all your lines, how can you remove them all at once? Now I have to manually go ...
5
votes
1
answer
2k
views
Android Studio wrong auto indent for dart
I am a newbie to Flutter and I am happy to try this great technology.
And I am going to try to follow this example https://medium.com/flutterpub/flutter-auth-with-google-f3c3aa0d0ccc to do a Google ...