microsoft / microsoft/TypeScript
Folding function calls folds closing parenthesis
Nobody has claimed this yet.
- Dominant language
- Go
- Stars
- 111k
- Forks
- 14.3k
- Avg merge
- 2d 4h
- Merged PRs (30d)
- 132
Description
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:

Actual behavior:
The function calls fold like this, including the last line with the closing parenthesis:
f({ // ...
f( // ...

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)
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Reproduce the folding behavior with the TypeScript versions listed and compare 4.0.0 with 4.0.1 onward in VS Code. Read related issues #39109 and #38597 first; the fix is complete when multiline function calls fold while leaving their closing parentheses visible, with regression coverage for both examples.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- typescript, vscode
- Domain
- tooling
- Issue type
- Bug
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 45/100