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

Add option to extension's settings: "Preserve indentation on empty line" #192

Merged

Conversation

kyklish
Copy link
Contributor

@kyklish kyklish commented Jul 22, 2022

Changes proposed in this pull request:

  • preserve indentation on empty line
foo() {
    bar()
[4 spaces]
    return
}

Notifying @mark-wiemer

@kyklish
Copy link
Contributor Author

kyklish commented Jul 22, 2022

This PR depends on #164 PR, I need new functions from that PR to write unit test for this PR. Waiting for #164 review.

@kyklish kyklish changed the title Add option to extension's settings: "Formatter: Preserve indentation on empty line" Add option to extension's settings: "Preserve indentation on empty line" Jul 24, 2022
@kyklish
Copy link
Contributor Author

kyklish commented Jul 24, 2022

If I cherrypick commit from another branch, will it make merge conflict for this branch (when another branch already merged to main)?

@mark-wiemer
Copy link
Collaborator

If I cherrypick commit from another branch, will it make merge conflict for this branch (when another branch already merged to main)?

Probably not, but I'm not sure. I'd assume it would minimize the chance of merge conflicts. Merge conflicts are caused by differences between the incoming branch (kyklish:option-preserve-indent-on-empty-line) and the base branch (main) changing the same parts of a file in different ways since the last commit common to both branches. If you cherry-pick from main and preserve the changes in that cherry-pick as-is, they shouldn't introduce merge changes, no. Because the changes in that commit will change the same parts of the files in the same way, so there's no difference that needs to be reconciled.

So I'd recommend using cherry-pick whenever possible :)

…-on-empty-line

# Conflicts:
#	package.json
#	src/common/codeUtil.ts
#	src/common/global.ts
#	src/providers/formattingProvider.ts
@kyklish kyklish marked this pull request as ready for review August 21, 2022 07:48
@mark-wiemer mark-wiemer merged commit d006bcc into mark-wiemer-org:main Aug 29, 2022
@kyklish kyklish deleted the option-preserve-indent-on-empty-line branch August 30, 2022 06:15
@mark-wiemer mark-wiemer mentioned this pull request Oct 2, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants