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

Formatter over indents when slash (new line continuation) is nested #3

Open
maciejmatczak opened this issue Jan 18, 2021 · 2 comments

Comments

@maciejmatczak
Copy link

Hi there! The auto save format that just appeared in my .tcl files is like an additional gift from last Christmas ;). Thanks!

To the issue:

proc myProc {a b} {
    ns::setSomething \
        [differentNs::verLongCommandHenceMultilined \
            "very long input argument"]
}

For me this is a well formatted TCL code, not sure if I introduce some not needed characters. I am dealing with long named, nested invocation and sometimes try to rescue readability with new line continuation.

Formatter is not able to understand it and it results as:

proc myProc {a b} {
    ns::setSomething \
        [differentNs::verLongCommandHenceMultilined \
            "very long input argument"]
    }

Last bracket over indented. Seems related to nested square brackets eval and line continuation also there, as this:

proc myProc {a b} {
    ns::setSomething \
        [differentNs::verLongCommandHenceMultilined "very long input argument"]
}

... works fine. If you could initially guide me, do you have some tests coverage for formatting? I should be able to work on some PR if something would be already existing. Other than that, I have 0 experience in creating VSCode plugins.

@maciejmatczak
Copy link
Author

let continuation = false;
is a boolean. So we do not support any nesting there, right?

For that we would need to have continuation to have levels like indentation, am I right?

@maciejmatczak maciejmatczak changed the title Formatter over indents when slash (new line continuation) is used Formatter over indents when slash (new line continuation) is nested Jan 19, 2021
@bitwisecook
Copy link
Owner

@maciejmatczak yes, I'd be happy to receive pull requests for this

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

No branches or pull requests

2 participants