interfaced / brightscript-intellij-plugin

BrightScript language support plugin for IntelliJ platform.
http://brightscript.tools
5 stars 12 forks source link

Troubles with code tabulations #14

Open aleksandrAndrosov opened 5 years ago

aleksandrAndrosov commented 5 years ago

When you write a function, if, for etc and you finish it with end statement, no formatting of code inside of this construction happens

aleksandrAndrosov commented 5 years ago

also, maybe auto complete would be cool

reeFridge commented 5 years ago

Yeah, thanks for the report. I am trying to decide what behavior would be better

  1. End statement auto injects after complete "head" statement (Function foo(), Sub foo() etc.)
    function foo() | end function
  2. End statement auto injects to the next line after user typed \n (e.g. new line) and caret move into statement's body
    function foo()
    ->|
    end function 

@aleksandrAndrosov What you think about this solutions?

Also autocomplete included in our road-map but with lower priority

aleksandrAndrosov commented 5 years ago

As for me, second behaviour is more attractive.

There is also another part of issue "When you write a function, if, for etc and you finish it with end statement, no formatting of code inside of this construction happens" I mean, if you were writing lots of code inside of function and it wasn't formatted, in javascript you can delete the ending "}" of function and then return it and all of the code inside turns formatted with tabulations, spaces or whatever.