How to make IDE apply code to the correct project?

Hello there!
I have 2 projects, 1 used with cursor and 1 newly created.
The problem here is when I refer to the cursor logic, then apply it to the code, no matter which source I ask, it applies the code to project 1?
For example, the project I asked is project 2, it recommends creating a main.ts file, but when I click apply, it applies it to project 1?
Is there a way to fix this?