Skip to content

Change currentIndent to protected#1620

Merged
Perryvw merged 1 commit into
TypeScriptToLua:masterfrom
iced-wav:patch-1
Feb 16, 2025
Merged

Change currentIndent to protected#1620
Perryvw merged 1 commit into
TypeScriptToLua:masterfrom
iced-wav:patch-1

Conversation

@iced-wav

Copy link
Copy Markdown
Contributor

Allows overriding pushIndent / popIndent to change indention style in plugins. It's useful for projects that auto-formats processed files (it seems MapleStory Worlds does this).

import * as tstl from "typescript-to-lua";

export class Printer extends tstl.LuaPrinter {
    pushIndent() {
        this.currentIndent += `\t`;
    }

    popIndent() {
        this.currentIndent = this.currentIndent.slice(1);
    }
}

Allows overriding `pushIndent` / `popIndent` to change indention style in plugins
@Perryvw Perryvw merged commit 6fb39b6 into TypeScriptToLua:master Feb 16, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants