Skip to content

fix: replace the closing symbol for inputs/outputs. #2142

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

Merged
merged 1 commit into from
Feb 12, 2025

Conversation

ivanwonder
Copy link
Contributor

The Angular Language Service does not return InsertReplaceEdit. There is no need to allow the developer to choose how to insert the completion.

For example, `<button (c|) />`.
                      ^^__________Insert edit
                      ^^ ^________Replace edit

If the LS returns the InsertReplaceEdit as shown above, selecting "Insert" by the developer results in (click)=""), and selecting "Replace" results in (click)="".

Now in the vscode, the default editor.suggest.insertMode value for HTML is Replace, for ts is Insert, So this leads to a bug in the ts file.

Fixes #2137

The Angular Language Service does not return `InsertReplaceEdit`.
There is no need to allow the developer to choose how to insert the completion.

For example, `<button (c|) />`.
                      ^^__________Insert edit
                      ^^ ^________Replace edit

If the LS returns the `InsertReplaceEdit` as shown above, selecting "Insert" by the developer
results in `(click)="")`, and selecting "Replace" results in `(click)=""`.

Now in the vscode, the default `editor.suggest.insertMode` value for HTML is `Replace`, for
ts is `Insert`, So this leads to a bug in the ts file.

Fixes angular#2137
@ivanwonder
Copy link
Contributor Author

ivanwonder commented Feb 9, 2025

This also reverts the commit.

PTAL @atscott

more info here #2137 (comment)

Copy link
Collaborator

@atscott atscott left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM with the caveat that this applies to all completions, not just inputs and outputs with their parens/braces. This effectively removes the support for insert mode and uses replace everywhere.

@atscott atscott added target: minor This PR is targeted for the next minor release action: merge Ready to merge labels Feb 12, 2025
@atscott atscott merged commit 02ba623 into angular:main Feb 12, 2025
4 of 5 checks passed
@ivanwonder ivanwonder deleted the remove-insert-replace-edit branch February 14, 2025 01:10
@angular-automatic-lock-bot
Copy link

This issue has been automatically locked due to inactivity.
Please file a new issue if you are encountering a similar or related problem.

Read more about our automatic conversation locking policy.

This action has been performed automatically by a bot.

@angular-automatic-lock-bot angular-automatic-lock-bot bot locked and limited conversation to collaborators Mar 17, 2025
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
action: merge Ready to merge target: minor This PR is targeted for the next minor release
Projects
None yet
Development

Successfully merging this pull request may close these issues.

bug: extra ] gets added on attribute binding completion
2 participants