Skip to content

Folding function calls folds closing parenthesis #40242

@cherryblossom000

Description

@cherryblossom000

TypeScript Version: 4.0.1-rc, 4.0.2, 4.1.0-dev.20200825

Search Terms:
fold call function parenthesis bracket

Code

declare const f: (_: unknown) => void
f({
  a: 3
})
f(
  3
)

Expected behavior:

The function calls should fold like this:

f({ // ...
})
f( // ...
)

This was the behaviour for the first function call in 4.0.0 because of the object literal:
screenshot of folding behaviour in TS 4.0.0

Actual behavior:

The function calls fold like this, including the last line with the closing parenthesis:

f({ // ...
f( // ...

screenshot of folding behaviour in TS 4.0.1 onwards

Playground Link: I couldn't reproduce this in the playground, so I'm not sure if this is an issue with VSCode.

Related Issues: may have been caused by #39109 which fixes #38597 (it was the only relevant issue I found that was fixed for 4.0.1 and this bug doesn't occur in 4.0.0)

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions