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

When sorting imports during formatting comments belong to the import doesn't move #21953

Closed
NipunaMarcus opened this issue Mar 18, 2020 · 1 comment
Assignees
Labels

Comments

@NipunaMarcus
Copy link
Contributor

Description:
When sorting imports during formatting comments belong to the import doesn't move.

Steps to reproduce:

  • Format the following code
// This example imports a module. You can only refer to the public symbols of
// an imported module.
import ballerina/math;

// Declare an explicit alias.
import ballerina/io as console;

public function main() {

    // Refer symbols of another module.
    // `math:PI` is a qualified identifier. Note the usage of the module alias.
    float piValue = math:PI;

    // Use the explicit alias `console` to invoke a function defined in the `ballerina/io` module.
    console:println(piValue);
}
  • see the imports have sorted but the comments were not moved with the import
// This example imports a module. You can only refer to the public symbols of
// an imported module.
import ballerina/io as console;

// Declare an explicit alias.
import ballerina/math;

public function main() {

    // Refer symbols of another module.
    // `math:PI` is a qualified identifier. Note the usage of the module alias.
    float piValue = math:PI;

    // Use the explicit alias `console` to invoke a function defined in the `ballerina/io` module.
    console:println(piValue);
}

Affected Versions:
1.2.0

@IrushiL
Copy link
Contributor

IrushiL commented Jul 29, 2021

This issue is no longer applicable since the reordering of imports is not supported in the new Swan Lake formatter.

However, we have a new feature issue #26617 for the organization of imports. We should ensure this bug is not resurfaced during the new implementation.

Closing this issue since it is not applicable with the current implementation.

@IrushiL IrushiL closed this as completed Jul 29, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants