Please check out this video: https://youtu.be/qcmTZT1qzTQ
The same code behaves different between Cursor and VSCode in terms of folding. Cursor is folding wrong.
Here’s a snippet you can use to reproduce
export function Copilot() {
// Stores the full current collateral object
const [collateralCurrent, setCollateralCurrent] = useState<CopilotCollateral | null>(null);
/*
The data of the collateral to fetch,
some APIs like the chat messages contains these basic collateral data that we
can use to fetch the full collateral object
*/
const [collateralToFetch, setCollateralToFetch] = useState<{ id: string; title: string } | null>(null);
const collateralUpdateRaceGuard = useRef(createRaceCheck());
const collateralCurrentVersionForUpdateRef = useLiveRef(
collateralCurrent
? {
id: collateralCurrent.id,
version: collateralCurrent.version,
}
: null,
[collateralCurrent],
);
const updateTimeoutRef = useRef<ReturnType<typeof setTimeout>>();
const getSelectedChatQuery = useApiCopilotGetChat({
enabled: !!selectedChatId && selectedChatId !== COPILOT_NEW_CHAT_ID,
input: {
userId: userInfo.userId,
accCN: userInfo.accCN,
threadId: selectedChatId!,
},
});
const [collateralIsLoadingManual, setCollateralIsLoading] = useState(false);
}
Note: While trying to reproduce myself i found that deleting the whole file content and then restoring it was fixing the issue