Skip to content

boocs/unreal-clangd

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

25 Commits
 
 
 
 

Repository files navigation

Unreal 5.2+ Clangd extension for VSCode (Intellisense+)

New update Nov 30, 2024

Extension v2.6.1: For Unreal 5.2 and newer releases

  • Changed Mac fix default setting

Also from older release:

  • Has Unreal Source file support (finally!) see here
  • UE 5.5 support (note: now uses clang/clangd v18.1.0)
  • Potential Mac fix
  • See Changelog for more info

Important Info

This extension now uses UBT to Refresh your project to update Intellisense files(compile commands). So this runs when you run the 'Update Compile Commands' command. Since this refreshes your project, your code-workspace will be refreshed removing your clangd settings and others! but...

This extension will automatically backup and restore your clangd settings when you run the Update Compile Commands command.

Note: I've added a setting that allows you to add additional settings to be backed up. See change log for more info: https://github.com/boocs/unreal-clangd/blob/v2/CHANGELOG.md#250-2024-05-05

Table of Contents

Info

  • Provides fast Code Completion, Formatting, and other cool features!

  • Has a command to create a clangd project for you

  • Fixes some clangd/Unreal quirks

  • Has a uninstall command

    Note: Windows users can use clang/clangd for Intellisense and still build with Microsoft's compiler

Top


Other Recommended Extensions

Top


Quick Start Guide (UE 5.2+)

This is generally correct, when using non-full source, but your situation could be different.

  1. Read the Requirements section of the full Documentation
    • Different Unreal Engine versions require different LLVM versions(Unreal 5.3/5.4 requires LLVM 16.0.6)

  1. Install the vsix file from this github

  • Click the extensions icon
  • Click the ellipsis (3 dots)
  • Choose Install from VSIX...

  1. Ignore any VSCode warning messages (should go away after creating a project)

  1. Linux: In the next step(project creation), File Dialogues will spawn behind VSCode(known bug)

  1. Run extension command "Create Unreal clangd project" on your Unreal project
    • Example:

      image


  1. Use the Editor suffix and Development config when Building/Running
    • Build

      image


    • Run/Debug

      image


  1. Use DebugGame when you have to Debug something
    • Debugging

      image


  1. Run extension command 'Update Compile Commands' to fix fake red squiggles that may rarely happen.

    image

Top


Documentation

Unreal 5.2+

Note: Make sure to read requirements! Different Unreal version usually require different clang/clangd and XCode versions

Windows Users: The requirements sections has easy instructions on how to install different Build Tools 2022 versions. These are required because other versions may cause fake red error squiggles.

Top


Upgrading Older Projects

This version had some changes!


Mac support

This hasn't been proven to work yet(let me know!).

There a new setting to try if you haven't been successful in getting clangd to work.

unreal-clangd.creation.MacFileLanguage

You can change the clangd Mac file language to C++ or Objective C++ (thanks to user szabot0412)

  • This setting is set in your .clangd files during project creation
  • in the Add: section it's the line that shows - -xc++ or - -xobjective-c++

Top