sourcery-vscode icon indicating copy to clipboard operation
sourcery-vscode copied to clipboard

Extention ignores user configured indentation.

Open MinekPo1 opened this issue 3 years ago • 2 comments

Steps to reproduce:

  1. Set indent to anything different then 4 spaces
  2. Write any code which sorcery suggests a refactoring, which spreads over multiple lines. For example:
def foo():
	a = []
	for i in range(10):
		a.append(f"a very long string to force a newline {i} yes this is very long")
  1. Accept the refactoring.

Expected:

The refactoring uses user configured indentation.

Behavior:

The refactoring always uses four spaces for indentation.

This is especially bad, if the user uses tabs for indentations since unless fixed by the user this will cause an error.

MinekPo1 avatar May 21 '22 11:05 MinekPo1

Hi @MinekPo1,

Thanks a lot for reporting this issue. :+1:

I've tried to reproduce it with multiple examples and it seems it varies whether Sourcery follows the indentation or always adds the 4 spaces. :see_no_evil:

We'll look into it and let you know when there's a fix.

Cheers, Reka

reka avatar May 26 '22 07:05 reka

I've also seen the extension splitting lines on the 70 char mark, which I personally don't mind, but I feel like being able to configure that would be nice!

MinekPo1 avatar May 26 '22 08:05 MinekPo1