Skip to content

Change currentIndent to protected #1620

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

Merged
merged 1 commit into from
Feb 16, 2025
Merged

Conversation

iced-wav
Copy link
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
5 checks passed
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