Skip to content

Space before comma adds space before and after and Space after comma does not have any effect inside method call parentheses #355

@ant-druha

Description

@ant-druha

Originally reported at https://youtrack.jetbrains.com/issue/IJPL-181167

Please see the attached screenshots showing the issue.
The problem occurs with this code snippet:

class Testing {
    [TestClass]Deserialize([string]$json) {
        $jsonObj = [Testing]::New()
        return [JsonSerializer]::Deserialize[TestClass]($json,$jsonObj.GetOptions())
    }
}

The problem does not happen after removing the method call inside the parentheses:

class Testing {
    [TestClass]Deserialize([string]$json) {
        $jsonObj = [Testing]::New()
        return [JsonSerializer]::Deserialize[TestClass]($json, $jsonObj)
    }
}
Spaces around both sides of comma
❌ Before comma enabled
Image

| ✅ Before & after comma enabled |
Image

Spaces around neither side of comma
❌ After comma enabled
Image

| ✅ Neither option enabled |
Image

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't workingformattingFor issues related to howe code gets (re-)formatted by the plugin.help wantedExtra attention is needed

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions