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

csharp_space_between_method_call_parameter_list_parentheses is not respected when formatting code #33231

Closed
yaakov-h opened this issue Feb 8, 2019 · 3 comments
Assignees
Labels
Resolution-Duplicate The described behavior is tracked in another issue

Comments

@yaakov-h
Copy link
Member

yaakov-h commented Feb 8, 2019

Version Used:
Visual Studio Community v15.9.6

Steps to Reproduce:

  1. Clone https://github.com/yaakov-h/SteamKit/tree/editorconfig (the editorconfig branch of the repo)
  2. Open SteamKit2/SteamKit2.sln
  3. Open a file such as CMClient.cs that has spaces between parameter lists and their surrounding parentheses
  4. Press Ctrl+K Ctrl+D to reformat the document.

Expected Behavior:

The spaces between the parameter lists and their surrounding parentheses are preserved, e.g.:

Debug.Assert( connection == null );

Actual Behavior:

The spaces between the parameter lists and their surrounding parentheses are removed, e.g.:

Debug.Assert(connection == null);

Additional Notes:

The same also happens to csharp_space_between_method_declaration_parameter_list_parentheses.

@sharwell
Copy link
Member

sharwell commented Feb 8, 2019

true:error is not a valid value for this setting. It only allows the values true and false, and when an unrecognized other value is found it defaults to the default value false. Marking this as a duplicate of #19055 (show a warning for editorconfig with invalid values, since those values are ignored).

@sharwell sharwell closed this as completed Feb 8, 2019
@sharwell sharwell added the Resolution-Duplicate The described behavior is tracked in another issue label Feb 8, 2019
@sharwell sharwell self-assigned this Feb 8, 2019
@yaakov-h
Copy link
Member Author

yaakov-h commented Feb 8, 2019

The documentation could probably do with an update then, to explain that severities do not apply to all rules.

@sharwell
Copy link
Member

sharwell commented Feb 8, 2019

They do currently specify this: https://docs.microsoft.com/en-us/visualstudio/ide/editorconfig-code-style-settings-reference?view=vs-2017#formatting-conventions

However, it's pretty obvious that users would have a hard time finding this and it's certainly not intuitive. The analyzer to provide a warning when things aren't right would be a big help all around.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Resolution-Duplicate The described behavior is tracked in another issue
Projects
None yet
Development

No branches or pull requests

2 participants