Skip to content
This repository was archived by the owner on Nov 21, 2025. It is now read-only.

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