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

Triggering code completion with a commit character (/ in HTML) immediately accepts the first suggestion #184

Open
DanTup opened this issue Mar 20, 2024 · 1 comment
Assignees

Comments

@DanTup
Copy link

DanTup commented Mar 20, 2024

Given the following HTML (which is missing a / in the closing script tag):

<html>
	<head>
		<script><script>
	</head>
	<body></body>
</html>

Trying to insert a / in the closing script tag triggers completion and then immediately accepts the first item (presumably because / is both a trigger character and a commit character):

html.mov

This feels like odd behaviour. Normally when you use a commit character the item that will be accepted was visible, but here a single character both triggered and accepted code completion.

I feel like probably a commit character should be ignored if it was also the trigger, or if that doesn't seem like good functionality, perhaps the HTML support should better handle the case where you're already inside a tag and pressing /.

@jrieken jrieken assigned aeschli and unassigned jrieken Mar 22, 2024
@aeschli
Copy link
Contributor

aeschli commented Mar 25, 2024

It's the autoClose feature that adds the closing tag here. I should tune it so it also looks what's after the /

let node: Node | undefined = htmlDocument.findNodeBefore(offset);

@aeschli aeschli transferred this issue from microsoft/vscode Mar 25, 2024
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

No branches or pull requests

3 participants