1

Quite simply, I have some files I need to delete from my Java Maven project in Visual Studio Code. I can delete them either from VS Code or the file system (windows 10), but they later re-appear back in the project and filesystem.

I currently don't have any kind of source control associated with the project. I'm new to coding with Java and Maven in VS Code, not new to VS Code generally and I've never had this happen in any of my .Net, Ruby on Rails or Javascript projects.

All of the files in question are xml files. In one case, I accidentally created the file using a filename without a dot before the file extension and after correcting by renaming, the mis-spelled file came back! - See hillClimber2SolverConfigxml in the image below.

enter image description here

Jimbo
  • 1,685
  • 3
  • 12
  • 15
  • 1
    Can you take screenshot of these files / folders. It is maybe `*.class` (compiled files) or build artifact. – Vy Do Oct 03 '20 at 10:12
  • They're all .xml config files. – Jimbo Oct 03 '20 at 10:58
  • Updated with image. BTW, these were all created by right clicking the folder in the project and selecting "new file". – Jimbo Oct 03 '20 at 11:04
  • Are these .xml files created by you manually or maven extension? after you rename the configxml by adding a dot, do you mean there's a config.xml and configxml occured at the same time or only a configxml? Is there any differences after cleaning java worksapce then recreating a project? – Molly Wang-MSFT Oct 08 '20 at 08:20
  • They're created by me manually. Usually by copying, pasting and editing. I start with just a configxml file. When I add the missing dot, I just have a config.xml file initially, but after some time the original configxml file comes back and I have two, one .xml and one configxml. I haven't tried clearing the workspace yet. Will let you know. – Jimbo Oct 08 '20 at 14:05
  • 1
    There may be something wrong with your environment, it's recommend to delete and reinstall maven for java, or java extension pack. – Molly Wang-MSFT Oct 09 '20 at 08:46

1 Answers1

1

I had the same problem. When using global search VS Code would always find something in deleted files. What I did is reopened my project:

Menu -> File -> Close Folder

and then

Menu -> File -> Open Folder

Now I don't have the search problem.

klm123
  • 12,105
  • 14
  • 57
  • 95