Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Typing "end" in a function definition removes indentation #46

Open
vulpivia opened this issue Nov 13, 2021 · 1 comment
Open

Typing "end" in a function definition removes indentation #46

vulpivia opened this issue Nov 13, 2021 · 1 comment
Labels
bug Something isn't working

Comments

@vulpivia
Copy link

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
@pdesaulniers pdesaulniers added the bug Something isn't working label Nov 13, 2021
@pdesaulniers
Copy link
Member

pdesaulniers commented Nov 15, 2021

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants