vscode-teal icon indicating copy to clipboard operation
vscode-teal copied to clipboard

Typing "end" in a function definition removes indentation

Open vulpivia opened this issue 2 years ago • 1 comments

Example:

GetSet_LoopTimeRange: function(
    isSet: boolean,
    isLoop: boolean,
    start: number,
    end_: number,
    allowautoseek: boolean
): number, number

Here, the end_ parameter has to be reindented manually.

  • Version of Visual Studio Code: 1.61.0
  • Version of the extension: 0.8.3

vulpivia avatar Nov 13 '21 15:11 vulpivia

I see that the built-in Lua support in vscode has the same issue:

local x = {
    end_ = "don't indent me!"
}

For the time being, I don't know how we should fix this.

One solution could be to disable automatic indentation inside certain constructs. I think we would have to bypass vscode's indentation rules feature, and run custom indentation code whenever the user presses the Enter key. Maybe this project could be used as a reference: https://github.com/kaiwood/vscode-endwise

pdesaulniers avatar Nov 15 '21 18:11 pdesaulniers