Cursor’s autocomplete suggests closing tags that have no matching opening tag in the file.
Steps to Reproduce
Open a Vue file that contains no <ComponentName> tag
Type or trigger autocomplete
Cursor suggests </ComponentName> even though <ComponentName> was never opened
Expected Behavior
Autocomplete should only suggest closing tags for tags that have been opened in the current file.
Operating System
MacOS
Current Cursor Version (Menu → About Cursor → Copy)
Version: 2.0.69 (Universal)
Additional Information
Actual Behavior:
Autocomplete suggests closing tags for components that don’t exist in the file, likely due to similar component names elsewhere in the codebase (e.g., BottomSheet vs InfoSheet).
Example:
A file contains:
<template>
<Clickable>
<!-- content → </Clickable></template>
But autocomplete suggests </BottomSheet> which has no opening tag.
I can’t reproduce it today. I created a file in the same project but different folder with the same name as yesterday and added the same structure inside, but it suggested different things (mostly code I wrote 5 minutes ago in another file).
But the autocomplete seems broken in a lot of ways since the latest updates:
It keeps suggesting the same wrong code multiple times even if reject the suggestion by pressing escape.
Actually if I think about it this is kind of like the behavior of most AI-Models when they fantasize about a solution that is wrong and they keep insisting that it’s right even if you prove them wrong.
The autocomplete-preview shows something that is okay and when I accept the suggestion it produces something else, than what was in the preview.
It kind of feels that I’m spending more time cleaning up the mess, that autocomplete produces lately than actually finding solutions for the problems I should solve.