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

[Bug]: Incorrect Formatting for Hierarchical Fields #43405

Open
ThisaruGuruge opened this issue Sep 20, 2024 · 0 comments
Open

[Bug]: Incorrect Formatting for Hierarchical Fields #43405

ThisaruGuruge opened this issue Sep 20, 2024 · 0 comments
Labels
Area/Formatting Team/CompilerFETools Semantic API, Formatter, Shell Team/DevTools Ballerina Developer Tooling ( CLI, Test FW, Package Management, OpenAPI, APIDocs ) Type/Bug

Comments

@ThisaruGuruge
Copy link
Member

ThisaruGuruge commented Sep 20, 2024

Description

Check the following code:

import ballerina/graphql;

configurable ClientConfig clientConfig = ?;

final graphql:Client myClient = check initClient(
    clientConfig.url,
    auth = {
    tokenUrl: clientConfig.tokenUrl,
    clientId: clientConfig.id,
    clientSecret: clientConfig.secret
}
);

isolated function initClient(string url, *graphql:ClientConfiguration configs) returns error? {
    // ...
}

When you format this using the formatter, the above formatting is applied. But ideally, the auth configs should have been indented another level, like below:

final graphql:Client myClient = check initClient(
    clientConfig.url,
    auth = {
	    tokenUrl: clientConfig.tokenUrl,
	    clientId: clientConfig.id,
	    clientSecret: clientConfig.secret
	}
);

Affected Version(s)

2201.8.8

@ballerina-bot ballerina-bot added needTriage The issue has to be inspected and labeled manually userCategory/Compilation labels Sep 20, 2024
@ThisaruGuruge ThisaruGuruge added Team/CompilerFETools Semantic API, Formatter, Shell Team/DevTools Ballerina Developer Tooling ( CLI, Test FW, Package Management, OpenAPI, APIDocs ) and removed needTriage The issue has to be inspected and labeled manually userCategory/Compilation labels Sep 20, 2024
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