I installed VSCode as the only text editor and whenever I tried to open a file, it opened a new empty window. I realized that the "code.desktop" file has an argument called "--unity-launch" and it didn't make sense to be there. Since I removed it, my problem has been resolved.