Search Unity

Unity VSCode Intellisense doesn't work as intended in PopOS

Discussion in 'Linux' started by ozsimsek, Jul 8, 2021.

  1. ozsimsek

    ozsimsek

    Joined:
    Aug 29, 2020
    Posts:
    8
    Hello everyone, I'm new to Linux but not too new to Unity.
    Now first of all I've installed Unity successfully as a flatpak, then the Editor ver 2021.1.13f1.
    After that, to install Vscode I had two options: flatpak, or .deb. I chose flatpak first:
    I installed latest .NET sdk from here: https://docs.microsoft.com/en-us/dotnet/core/install/linux-ubuntu#2104-
    I've set External Tools options to VSCode in Unity - Edit. It says "dotnet and mono6 sdk extensions should be installed.".
    I install them as suggested from here: https://stackoverflow.com/questions...io-code-to-develop-unity3d-projects-in-ubuntu
    After that I manage to open vscode after that I install C# extension, it gives me a long list of Omnisharp log-on Errors like:
    Code (CSharp):
    1. System.TypeInitializationException: The type initializer for 'System.ComponentModel.TypeDescriptor' threw an exception. ---> System.TypeInitializationException: The type initializer for 'Sys' threw an exception. ---> System.DllNotFoundException: /home/oz/.var/app/com.visualstudio.code/data/vscode/extensions/ms-dotnettools.csharp-1.23.12/.omnisharp/1.37.10/lib/../lib/libmono-native.so assembly:<unknown assembly> type:<unknown type> member:(null)
    2.   at (wrapper managed-to-native) Interop+Sys.LChflagsCanSetHiddenFlag()
    3.   at Interop+Sys..cctor () [0x00000] in <9f0df102fe6e4cfea29d2e46f585d8a5>:0
    4.    --- End of inner exception stack trace ---
    5.   at Interop.GetRandomBytes (System.Byte* buffer, System.Int32 length) [0x00000] in <9f0df102fe6e4cfea29d2e46f585d8a5>:0
    6.   at System.Guid.NewGuid () [0x00000] in <9f0df102fe6e4cfea29d2e46f585d8a5>:0
    7.   at System.ComponentModel.TypeDescriptor..cctor () [0x00034] in <3d97dda773a54430b892e1d794e5d921>:0
    8.    --- End of inner exception stack trace ---
    9.   at OmniSharp.Internal.CommandOptionExtensions.GetValueOrDefault[T] (McMaster.Extensions.CommandLineUtils.CommandOption opt, T defaultValue) [0x00008] in <39cbe7ee594a4dc5b2e18a2ea23cb5a2>:0
    10.   at OmniSharp.Stdio.StdioCommandLineApplication.get_Encoding () [0x00000] in <2dbb2d70fbda48ce82bfb14b78e8b811>:0
    11.   at OmniSharp.Stdio.Driver.Program+<>c__DisplayClass0_1.<Main>b__1 () [0x00000] in <914d82d16a72470d901165a7e73cfeca>:0
    12.   at OmniSharp.CommandLineApplication+<>c__DisplayClass11_0.<OnExecute>b__0 () [0x0000b] in <39cbe7ee594a4dc5b2e18a2ea23cb5a2>:0
    13.   at McMaster.Extensions.CommandLineUtils.CommandLineApplication.Execute (System.String[] args) [0x00039] in <344a1e8cd6594b17b1e01f8df6ae8827>:0
    14.   at OmniSharp.CommandLineApplication.Execute (System.String[] args) [0x00081] in <39cbe7ee594a4dc5b2e18a2ea23cb5a2>:0
    15.   at OmniSharp.Stdio.Driver.Program+<>c__DisplayClass0_0.<Main>b__0 () [0x00028] in <914d82d16a72470d901165a7e73cfeca>:0
    16.   at OmniSharp.HostHelpers.Start (System.Func`1[TResult] action) [0x0001c] in <39cbe7ee594a4dc5b2e18a2ea23cb5a2>:0
    17. [ERROR] Error: OmniSharp server load timed out. Use the 'omnisharp.projectLoadTimeout' setting to override the default delay (one minute).
    Anyways, I open a script from Unity and Intellisense doesnt work. I mean there is autocompletion but for example as I write "transform", its shows me the transform below but not with the symbols, also when I put a dot/period at the end of it, it doesn't suggest any other things like a normal Intellisense would do. I found what this feature means from here (if you go here and Ctrl+F > "inferred", it explains very well what I mean): https://code.visualstudio.com/docs/editor/intellisense

    So I tried everything I can find from internet but at last I wanna give .deb a try.

    Now I will try .deb:
    After that I've set External Tools options to VSCode in Unity - Edit. Immediately I get a prompt: "Vscode required - Do you want to install it?" Now alright, I searched it up on Internet and I found people telling that I should "Browse" from External Tools and choose the "code" file from ~/usr/bin/ . I browsed "code" from there...guess what? There is no code. I do "whereis code" from Terminal it says it's in the ~/usr/bin/ so I check from the file manager, it's in there but FOR SOME REASON there is NO "code" when I search from the browse from External Tools.
    Okay... I choose "Open by file extension", from there I manage to open it. It suggests me to install c# extension, I install it. Everything seems alright but intellisense doesnt work?

    Please help me this seems impossible to me.
     
    Last edited: Jul 8, 2021