I have just downloaded unity and saw that now it supports Visual studio code, I downloaded it and made it the default editor.
After trying to edit a script, it prompted
You can use the unity integration plugin:
https://code.visualstudio.com/Docs/runtimes/unity
Follow the instructions to get set up. It seems a lot of things to do but I think that's the best one.
If you still hit the issue even by using that plugin then follow this issue at their github page.