Skip to content

MissingImports is not respecting .editorconfig #68632

@ufcpp

Description

@ufcpp

Version Used:
Version 17.7.0 Preview 2.0

Steps to Reproduce:

  1. Add end_of_line = lf to .editorconfig
[*.cs]
end_of_line = lf
  1. Paste the following to Program.cs
var s = new StringBuilder();
s.Append($"{123}");
  1. Paste the following to Program.cs
Console.WriteLine(Regex.Match("", "").Success);

var buffer = (stackalloc byte[32]);
Utf8Formatter.TryFormat(123, buffer, out var bytesWritten);

Expected Behavior:

All newlines are LF.

Actual Behavior:

image

image

image

image

Perhaps the reason for this is that CSharpAddMissingImportsFeatureService does not use IndentBlockFormattingRule.WithOptions(SyntaxFormattingOptions).

https://github.com/dotnet/roslyn/blob/main/src/Features/CSharp/Portable/AddImport/CSharpAddMissingImportsFeatureService.cs#L31

Metadata

Metadata

Assignees

Type

No type

Projects

No projects

Relationships

None yet

Development

No branches or pull requests

Issue actions