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

Quickfix to close open tag doesn't deal with attributes #760

Merged
merged 1 commit into from
Jun 5, 2020

Conversation

angelozerr
Copy link
Contributor

Quickfix to close open tag doesn't deal with attributes

Fixes #646

Signed-off-by: azerr [email protected]

@angelozerr angelozerr force-pushed the codeaction-close branch 3 times, most recently from 7bc6501 to 9166feb Compare June 3, 2020 15:52
@angelozerr angelozerr marked this pull request as ready for review June 3, 2020 15:53
@angelozerr
Copy link
Contributor Author

This PR improves code action to close element for:

  • root element
  • element which are not in root element
  • Insert end element after the child elements (the limitation is that it doesn't take care of format settings).

Here a demo:

AutoCloseCodeAction

@fbricon
Copy link
Contributor

fbricon commented Jun 3, 2020

when adding </root> to <root><foo></foo>, it should be inserted using the same indentation as its opening tag

@angelozerr
Copy link
Contributor Author

when adding </root> to <root><foo></foo>, it should be inserted using the same indentation as its opening tag

You mean manage proper formatting, is that?

@angelozerr
Copy link
Contributor Author

when adding to , it should be inserted using the same indentation as its opening tag

I need to fix test, but it should respect the line indentation.

@angelozerr angelozerr force-pushed the codeaction-close branch 2 times, most recently from 5aadbfd to bab7449 Compare June 4, 2020 12:35
@angelozerr
Copy link
Contributor Author

Tests are fixed

@angelozerr
Copy link
Contributor Author

Please don't merge, I have found a usecase which is totally wrong:

<a>
	<b>
		</c>

@angelozerr
Copy link
Contributor Author

angelozerr commented Jun 4, 2020

Please don't merge, I have found a usecase which is totally wrong:

fixed, you should have a replace code action for this usecase.

@angelozerr angelozerr force-pushed the codeaction-close branch 3 times, most recently from 026f521 to e417a51 Compare June 5, 2020 09:13
@angelozerr angelozerr merged commit 5082892 into eclipse-lemminx:master Jun 5, 2020
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.

Quickfix to close open tag doesn't deal with attributes
4 participants