scala - Have intellij automatically format code and add types to variables/returns/parameters -
i have code everywhere
val somename = 10 var someothername = "hello" def add(a, b) = + b
i prefer have types coded in (rather compiler figuring out) in of code. great if intellij had auto-format option add types, above becomes:
val somename: int = 10 var someothername: string = "hello" def add(a: int, b: int): int = + b
does tool exist?
quoting comment yadu krishnan:
do want add in existing code ? if required in cases, can manually using key combination "alt + enter" after method/variable name. ask suggestion add method/variable type.
it should yadu krishnan write answer, if does, please accept response. i'm making 1 become clearer there solution, worked in case @ least
Comments
Post a Comment