After call scalai-pretty-imports
following import will be concat to compact form. Sorted by alphabet.
There is an additional behavior when class names compared with rest of the file and comment them.
Custom: scalai-ignore-import-list
- to keep some special imports in any case.
Benefits: Removes only duplicates
Before:
import com.office.domain.Person
import com.office.domain.Invoce
import com.office.maintenance.InvoceCalculator
import com.office.maintenance.UserAggregator
import com.office.UselessService
class Main {
def main(args: Array[String]) = ???
}
After:
import com.office.UselessService
import com.office.domain.{Invoce, Person}
import com.office.maintenance.{InvoceCalculator, UserAggregator}
class Main {
def main(args: Array[String]) = ???
}
Before:
import com.office.domain.Person
import com.office.domain.Invoce
import com.office.maintenance.InvoceCalculator
import com.office.maintenance.UserAggregator
import com.office.UselessService
class Main {
def main(args: Array[String]) = {
val person = new Person("vasya", "petrovic", age = 21)
UserAggregator.registerUser(person)
}
}
After:
import com.office.UselessService
import com.office.domain.Person
//import com.office.domain.Invoce
import com.office.maintenance.UserAggregator
//import com.office.maintenance.InvoceCalculator
class Main {
def main(args: Array[String]) = {
val person = new Person("vasya", "petrovic", age = 21)
UserAggregator.registerUser(person)
UselessService.putAsUseless(person)
}
}
scalai-sep-args
Before:
def main( v: String, a: Seq[(String, Any)], b: Map[Any, _]) = ???
case class Person( v: String, a: Seq[(String, Any)], b: Map[Any, _])
After:
def main(
v: String,
a: Seq[(String, Any)],
b: Map[Any, _]
) = ???
case class Person(
v: String,
a: Seq[(String, Any)],
b: Map[Any, _]
)
Customize:
- scalai-function-args-indention
Transform .org to jira markdown
Call function jira-from-org-kill
in .org file and get converted data in clipboard.
Just one function to minimize json jsoni-minimalize
in whole buffer
Before:
{
"string": "some value",
"array": [
"hi there",
"hi there again"
],
"object": {
"key1": "value",
"key2": 999
},
"int": 100,
"boolean": true,
"booleanFalse": false
}
After:
{"string":"some value","array":["hi there","hi there again"],"object":{"key1":"value","key2":999},"int":100,"boolean":true,"booleanFalse":false}
In general there are common function to edit files.
text-util-from-camel-case-range
- TransforCamelCaseRange to snake_case_range
A few function which help me works with .http files
Demo: