I'm studying Kotlin with JetPack Compose and there are a lot of methods with multi-line parameters block, as you can see on screen. But here is the problem: you can't fold this block, but you can fold curly braces blocks.
Example of foldable and non-foldable code blocks
Here is code fragment. icon = {...} can be folded, but Icon(...) can not
icon = {
Icon(
imageVector = Icons.Default.Edit,
contentDescription = "Edit note",tint = Color.Black
)
}
So is there a way to fold multi-line parameters block with or without extra plugins?
I'm using:
Android Studio Electric Eel | 2022.1.1
Build #AI-221.6008.13.2211.9477386, built on January 11, 2023
macOS 12.5
I tried to use "FoldingPlus" plugin, but looks like it doesn't work with my AS version
Also tried to install "Advanced Java Folding", but it didn't work for this version either
Related
For example I have this kotlin code in editor:
...
val field == MySocket.ParamVer
...
Then when I type another dot after MySocket (result is "MySocket..ParamVer") Android Studio dont't show list of fields and methods of the class MySocket as I expected.
I have to firstly type space after MySocket (result in "MySocket .ParamVer") and after then type dot letter (result in "MySocket. .ParamVer") - only then Android Studio show list of fields and methods.
But when I am editing java source codes, when I press dot (in "MySocket.ParamVer" after word "MySocket") then list of fields and methods is immediatelly showed.
Exist any settings in Android Studio which enables the same behavior for editing kotlin source codes which is for java source codes? Or is it problem Kotlin plugin? Or where can I report this problem?
I think the setting you want to add is in : File -> Settings -> Editor -> General -> Code Completion -> "Insert selected suggestion by pressing space, dot, or other context-dependent keys" If this isn't the behavior you want you'll need to clarify a bit more what you need
Edit: Ctrl + Space will open the auto-completion menu
Whenever I try to move file to another package, Android Studio reformats file's code structure to a different state.
For example such part of code:
doSomething(makeSomeParameters(value1, value))
becomes:
doSomething(
makeSomeParamaters(
value1,
value2
)
)
Notice that this line was not exceeding 100 columns constraint.
I use code style from official Kotlin style guide.
To configure the IntelliJ formatter according to this style guide,
please install Kotlin plugin version 1.2.20 or newer, go to Settings |
Editor | Code Style | Kotlin, click on "Set from…" link in the upper
right corner, and select "Predefined style / Kotlin style guide" from
the menu.
When you attempt to move a file to another package and Android Studio shows this dialog:
Uncheck the Update package directive check box; Android Studio will not reformat the code in the file.
Is there any way to turn this (Android studio 2)
into this (Sublime text 3)
As you can see, the color of "public" is the same as variable data types, if, false, return, etc, than in the second picture.
Is there any way to change/fix this? In the android studio settings -> Editor -> Java/Language defaults I only see the "keyword" color, why is everything a "keyword"?
Thank you for your feedback.
General concensus over the last several years has been to write a plugin to separate keywords from keywords. Certainly issues on Jetbrain's own YouTrack suggests that path: https://youtrack.jetbrains.com/
I write C#, UnrealScript and C++. I do C++ and C# in Visual Studio 2012, while I do UnrealScript in Sublime 2 with UnrealScript IDE plugin
In Sublime 2 there is a cool effect that shows the line connection between the open and close braces as shown in the image:
( Note: I'm not talking about the underlining of the braces - VS already has that feature. I'm referring to the dotted lines )
I can't find a way to have this in Visual Studio, the closest so far is Show White Space which while is OK, I don't like it that much. Is there a way I can have this feature? Plugin or otherwise?
Try installing a free version of DevExpress Plugin for Visual Studio. Its got all those designes....
Is there any way to get line ending glyphs in Visual Studio 2012?
The following screen shot (from notepad++) show what I want (the CR LF part):
You might want to check out this extension: End of The Line by Rolf W. Rasmussen. The current binary version displays CR and LF identifiers at the end of the line all the time, but the source version ties it into VS's "View Whitespace" menu option.
It's for Visual Studio 2013, but it's open source and should be fairly straightforward to recompile as a VS2012 compatible plugin
(You might need to change the references - the VSSDK packages on nuget can be really useful here. You'd need VSSDK.CoreUtility and VSSDK.Text. In fact, that might be worth a PR regardless...)
Nope, Visual Studio has no feature to show End of Line Markers. (Reference)
But it gives the ability to show Whitespace with (Ctrl + E + S) which is adressed here.
If any incosistencies are included, VS should suggest to fix the document automatically.
But if you need to do actions other than that, I recommend using notepad++ as described by Hanselman here
If you think Visual Studio should include this feature, you better vote for this request
Edit:
By the way, VS shows glyphs for wrapped words by enabling through:
Tools -> Options -> Text Editor -> All Languages -> Show visual glyphs for word wrap
Like: