Open rowbawts opened 4 years ago
I went looking for a solution for this and came across this; https://forum.unity.com/threads/cant-get-vscode-to-work-properly-with-unity.538224/#post-3549644
I tried building com.unity.UnityHub with /app/bin/vscode-editor
changed to /app/bin/code
to see if this would work, but no matter what I do it seems that it's always /app/bin/vscode-editor
. I could be doing something wrong, I'm going to continue prodding.
Edit
I deleted my prefs and set my editor to code
and it does seem like Unity is actually building my csproj
file in the project root now. I just can't figure out how to propagate my changes into the actually Unity editor sandbox (no matter what I do Unity editor filesystem has /app/bin/vscode-editor
rather than /app/bin/code
)
You can see just by changing my editor I was given extra options in Unity;
Edit 2
This doesn't seem to fully fix the issue as VSCode installs some extra extensions on first run but fails to run dotnet --info
, but definitely a step closer. Perhaps @refi64 could chime in since the changes to at least this half of the issue seem pretty easily resolvable?
Edit 3 It also seems like as of https://github.com/flathub/com.visualstudio.code/pull/144 VSCode needs an environment variable to enable SDK extensions. Unfortunately this doesn't seem to work for me for dotnet//19.08, even though I have it installed. May need to open an issue with them. Strangely it works fine for golang...
I updated my environment var using flatpak override --user --env=FLATPAK_ENABLE_SDK_EXT=* com.visualstudio.code
to automatically load all SDK extensions.
So for Mono you need org.freedesktop.Sdk.Extension.mono6//20.08
, but org.freedesktop.Sdk.Extension.dotnet
is out of date.
I created https://github.com/flathub/org.freedesktop.Sdk.Extension.dotnet/pull/12 to update dotnet
to 20.08, and it seems to work on my system (but Omnisharp/Intellisense has further issues, sadly)
Please try the latest published version. I renamed the default editor path and updated everything to target runtime 20.08.
@refi64 Thanks, that fixes Unity generating .csproj/.sln
files, sadly Omnisharp is still broken (and https://github.com/flathub/org.freedesktop.Sdk.Extension.dotnet/pull/12 is still required for dotnet)
Not really a solution JetBrains Rider works out of the box. Might be useful to some people.
When I open a script in VSCode with both extensions installed (mono5/dotnet). I don't get any code completion is this supposed to be a functioning part of the editor?
Edit: I've made a matching issue in the VSCode Flatpak repo just in case it falls on them, will close the incorrectly placed one once I know who it falls on. And will close the other once resolved or deemed unfix-able.
Edit 2: I've narrowed it down to because there's no sln/csproj files being created. And I see the script in the Unity VSCode package that's supposed to do it but nothing is happening.