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 doesn't properly work on opening and closing braces #40240

Open
NipunaRanasinghe opened this issue Apr 18, 2023 · 0 comments
Open

Formatter doesn't properly work on opening and closing braces #40240

NipunaRanasinghe opened this issue Apr 18, 2023 · 0 comments
Assignees
Labels
Area/Formatting Team/CompilerFETools Semantic API, Formatter, Shell Team/DevTools Ballerina Developer Tooling ( CLI, Test FW, Package Management, OpenAPI, APIDocs ) Type/Bug

Comments

@NipunaRanasinghe
Copy link
Contributor

NipunaRanasinghe commented Apr 18, 2023

Description

As per the Ballerina style guide, the formatter should only follow OTBS style (https://en.wikipedia.org/wiki/Indentation_style#Variant:_1TBS_(OTBS)) for function braces placement.

But the current implementation does not reformat the other styles to the OTBS format

Steps to Reproduce

keep the function braces as follows and format the code. formatter will keep it as it is, without moving the opening brace to the previous line.
image (3)

Affected Version(s)

No response

OS, DB, other environment details and versions

No response

Related area

-> Formatter

Related issue(s) (optional)

No response

Suggested label(s) (optional)

No response

Suggested assignee(s) (optional)

No response

@NipunaRanasinghe NipunaRanasinghe added Type/Bug Area/Formatting Team/DevTools Ballerina Developer Tooling ( CLI, Test FW, Package Management, OpenAPI, APIDocs ) labels Apr 18, 2023
@ballerina-bot ballerina-bot added the Team/CompilerFETools Semantic API, Formatter, Shell label Apr 18, 2023
@NipunaRanasinghe NipunaRanasinghe changed the title Formatter doesn't work on Formatter doesn't properly work on opening and closing braces Apr 18, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Area/Formatting Team/CompilerFETools Semantic API, Formatter, Shell Team/DevTools Ballerina Developer Tooling ( CLI, Test FW, Package Management, OpenAPI, APIDocs ) Type/Bug
Projects
None yet
Development

No branches or pull requests

3 participants