I’ve been trying to get VS code to function with Unreal Projects for the better part of a day now. The issue I am facing is new and older projects do not throw errors in VS Code when there clearly should be one (ie. leave off a ; or }). I am also not getting autocomplete or code helpers when I do something like GetOwner()->Get....
Here are the VS Code extensions, clang version, and other stuffs: System Stuffs
clang = v18.1.3 (1ubuntu1)
.NET = v8.0.108
VS Code Stuffs
VS Code = v1.92.2
.NET Install Tool = v2.1.1
C/C++ = v1.21.6
C/C++ Extension Pack = v1.3.0
C# = v2.39.29
UE Thing
Editor = //UE5/Release-5.4.3-34507850
I’ve removed VS Code and reinstalled, nuked the .config/Code and .vscode folders, and even tried on another linux machine with a fresh UE and VS Code install; same issue. In the past, it was simple enough to get up and running in a code project from nothing: download the UE zip (not source), extract, run UnrealEditor, select a template, switch to C++, and then click the VS Code download button at the bottom. Installing VS code and running the editor thereafter never gave me issues.
You will get none of the niceties when using VS Code unfortunately.
If you want (accurate) compile errors, you need to compile.
Autocomplete is a complete mess, you can try using the tag parser but that is not context sensitive and will make bad suggestions.
A quick search suggests this may work, seems it hasn’t been updated in a while now though.
If these things are important to you, or you intend to do a lot of C++ in Unreal, you will want to fork out for Rider.
Is this a recent change? I had been using Linux and VS Code with UE for about 2 years and would get all of these features. It was a bit slow, but still. There’s nothing now.
I’ve heard good things about Rider, so I may just shift over to that. Thanks for the suggestion.
No idea how well it used to work myself, I have only been using Unreal for about 4 months now.
Autocomplete did actually “work” for me initially, but was horrendously slow and the results came in batches. It was a good 5 - 10 seconds before I got anything, and after another 5 - 10 some more results would pop in, and so on. Seemed like it was scanning in real time and giving partial results as it crawled up inheritence hierarchies, rather than indexing, except that it clearly wasn’t (very little disk activity or CPU usage while it was happening).
I messed around with things a bit but never got it working well and eventually gave up and enabled the tag parser. I haven’t had to drop down to C++ many times yet so it hasn’t been significant bother; and was planning to just get Rider when it did become a bother.
If you do get it working well, please let me know!
Some progress made here.
My issues started since moving to 5.4.x after taking a break from writing/learning C++; so I’m not sure when this issue was introduced, but it does seem tied to at least how the vscode files are generated in latest. Possibly, I’m not entirely sure as I’m not proficient in this aspect of the editor.
I grabbed 5.3.x from Epic and created a code project from this build. When VS Code opened up, it recommended two extensions:
CodeLLDB
Mono Debug
Upon enabling these two, I get, albeit it is quite slow as you described, errors squiggles and suggestions as I was seeing before. That is, only in 5.3.x. I still can not get 5.4.x to work. RIP