I know this is a broad topic, but I want to suggest the discussion about it.
As large amount of people, I love to make video games and Unity is providing one of the best experiences I had so far. I really love VSCode and the fact that it's solid, fast and still under development with the help of the community. It is one of the most pleasent coding experiences that I ever had.
The last editor I used was Visual Studio with ReSharper, a nice, very strong and fully-featured experience. Both tools are great, but they have _too_ much to offer. It's by far more than ever needed to create simple games, which make the coding kinda "laggy". "I'm programming games, thus my tools should run at 4K@60fps!" hahaha. That's why I changed to VSCode: to have a smoothier coding experience.
Although VSCode is going well in the smoothness department, there is some rough edges to be polished (that's part of the beauty).
So, my questions are:
My intention here is to suggest some features to VSCode team and the related extensions makers, create pull requests to improve them and create more extensions if necessary.
For me, these are the things I remember now:
Debug attaching is hit and miss.
Sometimes code changes are not 'seen' by Unity. ( Reload Window seems to help )
Yes, you are right. Sometimes, VSCode just have some weird errors in code like "this class is defined elsewhere" but it's not! And they go away only when you restart VSCode. Usually this happens when I rename a class and its file.
About the debug. I almost gave up on it 馃槖 . Sometimes (specially when the project is opened for days) I try to debug and it doesn't step to the next line. And it freezes Unity. Until you restart both. Most of my debug are made by Debug.Log like in ye olde times.
News!
Camel humps are now part of the Visual Studio Code: https://code.visualstudio.com/updates/v1_25#_subword-support but it's not working like expected yet: https://github.com/Microsoft/vscode/issues?utf8=%E2%9C%93&q=is%3Aissue+is%3Aopen+subword.
@kleber-swf Regarding the "this class is defined elsewhere": This seems to be OmniSharp keeping old code around in memory. Use the command "Restart OmniSharp" from the Ctrl+Shift+P Menu as an alternative to restarting/reloading.
Side note: this regularly happens to me when switching branches in git...
Thanks @founderio. I agree. It's some cache stuff since I usually execute the command "Reload Window" and the errors disappear. Although it's still annoying 馃槃
It's just me or now every time we create a new class we have to restart VSCode to make the new class see the others?
I have the same issue it is very annoying. @kleber-swf
For the renaming issue, I'm thinking of creating an extension that when you rename a MonoBehaviour, it automatically renames the file and the .meta file to the new name. What do you guys think? Or, is there an extension that do that?
@kleber-swf That sounds nice. Additionally, if you rename or move things (folders, etc) in vs Code's file explorer, it auto renames/moves the .meta file.
So, I'm researching and studying about making VSCode extensions in my spare time to create one to address the renaming issue. Well for now it seems a bunch of stuff to study ahahah!
I'm still not sure about how to proceed, so if you guys have any experience to share it will be very appreciated. As soon as I figure out what will be the base code I'll create the repository where everyone can contribute.
The features (at least at the beginning) would be:
For the first feature, I'm using this approach: Rename Symbols. It works, but only when Omnisharp isn't active. So I'm thinking that for this type of extension we will need to create a language server, which is waaaaaay more difficult. If that's the case, I'm thinking of create a branch from Omnisharp itself and tweak it were we need (I'm making some experiments with this approach right now).
What you guys think? Any of you have experience with language servers?
I would suggest to start with moving files/folders in vscode first, it's very annoying to find out the reference links are all dead just because I forget to move the .meta with the .cs
The rename part could come later.
Hello @kleber-swf! Do you have any news about renaming/moving unity3d files?
@imurashka I found this extension in the market: https://marketplace.visualstudio.com/items?itemName=PTD.vscode-unitymeta
Sounds like it is what you're looking for. I haven't tried it yet though and hope you'll try it and leave here your feedback. I'm using Rider for a while and just checking if VSCode is already good enough to give it a try. So looking forward to your reply 馃槈
housekeeping ... this issue looks more like an issue for the C# extension or one of the many Unity extensions.
Most helpful comment
For me, these are the things I remember now: