Skip to content

Commit f13b365

Browse files
committed
2.6.0
1 parent 50d016b commit f13b365

File tree

9 files changed

+939
-95
lines changed

9 files changed

+939
-95
lines changed

CHANGELOG.md

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,23 @@
44

55
- Create command that shows clang and clangd version in terminal
66

7+
## [2.6.0] 2024-11-18
8+
### Added
9+
- Unreal Source support
10+
- The command below will run when you create a clangd project with this extension
11+
- Command "Create Unreal Source support"
12+
- Creates .clangd file in Unreal source directory
13+
- Auto creates compile commands file and entries when visiting Unreal Source files
14+
- Calculated based on Unreal Source rsp files created by Unreal when creating a VSCode Unreal project
15+
- compile_commands.json is created in Unreal Source directory (/.vscode/unreal-clangd)
16+
- UE 5.5 support
17+
- Added in .clangd Diagnostic->UnusedIncludes = None for clang/clangd 18.1.0
18+
- Mac fix setting: "unreal-clangd.creation.MacFileLanguage" (idea from user szabot0412)
19+
- Can switch file language from C++ to Objective C++ (default is C++ for now)
20+
- Ignore errors for Non Full Source Unreal Engine *.cpp files
21+
### Fixed
22+
- npm audit fix
23+
724
## [2.5.1] 2024-07-22
825
### Added from user 94Bo
926
- Linux and Mac users will use RunUBT.sh instead of calling UBT directly if available

README.md

Lines changed: 114 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,11 @@
1616
- [General](#about)
1717
- [Benefits](#benefits)
1818
- [Requirements](#requirements)
19+
- [Mac](#mac-xcodellvm)
20+
- [Windows](#windows-llvm)
21+
- [More Windows](#windows-requirements)
22+
- [Ubuntu](#ubuntu-2204-requirements)
23+
- [Arch Linux](#arch-linux-requirements)
1924
- [Older Unreal Versions](#older-unreal-versions)
2025
- [Extension](#extension)
2126
- [Commands](#commands)
@@ -24,6 +29,7 @@
2429
- [Creating a Unreal Clangd Project](#creating-a-unreal-clangd-project)
2530
- [General](#creating-a-unreal-clangd-project)
2631
- [Creating Clang Tidy Cfg at a later date](#creating-a-clang-tidy-cfg-on-a-later-date)
32+
- [Unreal Source support](#unreal-source-support)
2733
- [Info](#info)
2834
- [Logs](#logs)
2935
- [.clangd file](#clangd-file)
@@ -43,6 +49,7 @@
4349
- [Delegate Func Completion](#delegate-function-name-completions)
4450
- [Function parameter completions](#function-parameter-completions)
4551
- [Linux Fixes](#linux-fixes)
52+
- [Mac Fixes](#mac-fixes)
4653
- [Auto Include](#auto-includes)
4754
- [General](#auto-includes)
4855
- [Enabling for headers](#enabling-auto-include-for-header-files)
@@ -170,6 +177,7 @@ This is generally correct, when using non-full source, but your situation could
170177
- Bundle setting causes completions to be wrong (e.g. template functions)
171178
- Bundle setting doesn't work with VSCode's deprecated strikethrough setting
172179
4. This extension deletes/creates a compile_commands.json in the parent Unreal Engine directory and then copies it over to the project.
180+
- Current Native Intellisense options doesn't do it this way
173181
6. clangd intellisense currently uses 'no precompiled headers' mode (`Will work with pch projects!`)
174182
7. Popup dialogs use systems sounds. Most Operating Systems allow you to adjust System(OS) sounds without affecting overall sound volume.
175183
8. Just like Microsoft's C++ extension, with clangd the UPROPERTY type macros don't work with code completion for their parameters.
@@ -197,12 +205,25 @@ This is generally correct, when using non-full source, but your situation could
197205
- This fix is in the .clangd cfg file ([added include directory](#linux-fixes))
198206
- Your version of Linux may or maybe not need this fix
199207

208+
`Nov 2024`: Had trouble installing LLVM 18 for Unreal 5.5 (Ubuntu 22.04)
200209

210+
- Found this to work
211+
- Make sure you don't have an `llvm.sh` file already in the directory you have open. The file you download won't overwrite the file already in your directory. It will name it something else.
212+
- This will install LLVM 18.1.8 (`for Unreal 5.5, make sure to install the correct version for your version of Unreal`)
213+
- Epic recommends 18.1.0
214+
- In a perfect world, patch update versions wouldn't matter
215+
- For me, it does seems to work fine but you could have problems. You can always build from source if you want the specific 18.1.0 version.
216+
217+
`Here's the instructions`:
218+
1. wget https://apt.llvm.org/llvm.sh
219+
2. chmod +x llvm.sh
220+
3. sudo ./llvm.sh 18
201221
```
202222
```
203223
### Mac M1/M2 Note
204224
- This extension has a setting that lets you set the `architecture` UBT flag
205225
- You can try setting this to `arm64`
226+
- You might not need this and is only provided for things to try in case it's not working
206227
- **note:** Do this before creating your project
207228

208229
```
@@ -257,10 +278,11 @@ Windows and Unreal 5.2+(`non Full Source`) have been tested with:
257278

258279
#### General Requirements
259280

260-
- Unreal Engine 5.2+
281+
- Unreal Engine v5.2+
282+
- Unreal project created for VSCode
261283
- Requires specific LLVM/clang/clangd versions!
262-
- https://docs.unrealengine.com/5.3/en-US/hardware-and-software-specifications-for-unreal-engine/
263-
- Make sure to select correct Unreal Engine version (the link goes to UE 5.3)
284+
- https://dev.epicgames.com/documentation/en-us/unreal-engine/hardware-and-software-specifications-for-unreal-engine?application_version=5.5
285+
- Make sure to select correct Unreal Engine version (the link goes to UE 5.5)
264286
- Requirements are only posted after a full release of UE. For Beta/Preview releases you'll have to test clang versions
265287
- VSCode [clangd](https://marketplace.visualstudio.com/items?itemName=llvm-vs-code-extensions.vscode-clangd) extension (Do not let clangd extension auto install LLVM)
266288
- Microsoft C++ [extension](https://marketplace.visualstudio.com/items?itemName=ms-vscode.cpptools) for its `Building/Debugging` capability
@@ -277,17 +299,23 @@ https://docs.unrealengine.com/5.3/en-US/hardware-and-software-specifications-for
277299
- Does XCode come with clang++,clangd,clang-tidy, and clang-format? Use that version
278300
- Else download the clang(LLVM) version specified in the `Linux` section of the above link
279301
- For Unreal 5.3 it would be LLVM 16.0.6
302+
- For Unreal 5.5 it would be LLVM 18.1.0
280303

304+
- `Nov 20224` Add new setting: "unreal-clangd.creation.MacFileLanguage"
305+
- This allows you to change the File Language from C++ to Ojbective C++
306+
- Git user szabot0412 said chaning the language to Objective C++ fixed his red squiggles
307+
- If more people confirm this then I might change Objective C++ to default file language
281308

282309
#### Windows (LLVM)
283310
- Windows users should use the Linux clang(LLVM) version requirement
284311
- Make sure you select the correct Unreal Version for the Docs
285312
- Different Unreal versions require different LLVM versions
286-
- https://docs.unrealengine.com/5.3/en-US/hardware-and-software-specifications-for-unreal-engine/
313+
- https://dev.epicgames.com/documentation/en-us/unreal-engine/hardware-and-software-specifications-for-unreal-engine?application_version=5.5
287314
- Download clang/clangd from https://github.com/llvm/llvm-project/releases/
288-
- Filename will be LLVM-(version)-win64.exe (e.g. for UE 5.3.#, the filename will be LLVM-16.0.6-win64.exe)
289-
- Remember if not using UE 5.3.# the LLVM version will be different
290-
- `note:` With UE 5.3 unfortunately Unreal Build Tool requires updated libraries so needs to see required LLVM builds. This means you must install LLVM in the default directory.
315+
- Filename will be LLVM-(version)-win64.exe (e.g. for UE 5.5.#, the filename will be
316+
LLVM-18.1.0-win64.exe )
317+
- Remember if not using UE 5.5.# the LLVM version will be different
318+
- `note:` For best Unreal compatibility install LLVM in the default directory.
291319

292320
### Other requirements
293321
#### Windows Requirements
@@ -320,27 +348,38 @@ https://docs.unrealengine.com/5.3/en-US/hardware-and-software-specifications-for
320348

321349
* For `Unreal 5.4` you want to enable `v14.38`
322350
- (Pic not shown)
323-
324-
4. If you haven't created your Unreal project yet you can skip steps 5/6
325-
5. For existing Unreal projects, first Refresh your project (this will overwrite your workspace file which we fix in step 6)
326351

327-
- You can **Generate Visual Studio Project files** by right clicking on your project's *.uproject file in your project's parent folder.
328-
329-
- You can also **Refresh Visual Studio Project** inside UE5's Tools menu
352+
* For `Unreal 5.5` you want to enable `v14.38`
353+
- (Pic not shown)
330354

331-
6. You'll have to reinstall the project that this extension creates because `Generating Visual Studio project files` will overwrite your project's VSCode workspace file which has all the clangd project settings
332-
333-
- [Doing a partial install](#reinstall-without-overwrite)
355+
4. If you haven't created your Unreal project yet you can skip step 5
356+
5. For existing Unreal projects, run this extension's commands called: `Update Compile Commands file`
357+
* This command is the same command that also refreshes your project
334358

335359
#### Ubuntu 22.04 Requirements
336360
- dotnet-runtime-6.0
337361
- dotnet-sdk-6.0 (Only needed for seeing UBT logs when updating compile commands)
338362

363+
`Nov 2024`: Had trouble installing LLVM 18 for Unreal 5.5 (Ubuntu 22.04)
364+
365+
- Found this to work
366+
- Make sure you don't have an `llvm.sh` file already in the directory you have open. The file you download won't overwrite the file already in your directory. It will name it something else.
367+
- This will install LLVM 18.1.8 (`for Unreal 5.5, make sure to install the correct version for your version of Unreal`)
368+
- Epic recommends 18.1.0
369+
- In a perfect world, patch update versions wouldn't matter
370+
- For me, it does seems to work fine but you could have problems. You can always build from source if you want the specific 18.1.0 version.
371+
372+
`Here's the instructions`:
373+
1. wget https://apt.llvm.org/llvm.sh
374+
2. chmod +x llvm.sh
375+
3. sudo ./llvm.sh 18
376+
339377
#### Arch Linux Requirements
340378
- dotnet-runtime-6.0
341379
- clang
342380
- dotnet-sdk-6.0 (Only needed for seeing UBT logs when updating compile commands)
343381

382+
344383
```
345384
```
346385

@@ -400,6 +439,7 @@ The other reason was a Unreal design change. 5.0.0 uses compile commands while 5
400439
* `unreal-clangd.creation.completionHelper`: true(default) Needed to make code completion functional. Creates a completionHelper.cpp and adds it to compile_commands.json
401440
* `unreal-clangd.creation.completionHelperMP`: true(default) Also add UnrealNetwork.h(multiplayer) to completionHelper.cpp
402441
* `unreal-clangd.creation.tidy`: false(default) creates a clangd tidy file, during creation command, if true **(see clang tidy section)**
442+
* `unreal-clangd.creation.MacFileLanguage`: Can switch Mac file language support to C++ or Objective C++
403443
#### Editor
404444
* `unreal-clangd.editor.parameterHints`: Automatically pops up param hints windows after function name completion
405445
- disabled:
@@ -558,6 +598,34 @@ If you noticed above, in the Creating a Unreal Clangd Project section, the comma
558598
559599
---
560600
601+
## Unreal Source support
602+
Starting with extension version 2.6.0, it now support Unreal Source files
603+
604+
- `Requirements:` Must have created a VSCode project using Unreal/UBT
605+
- This is because this extension uses the files that were created for your project
606+
607+
- When creating a project it will also create a .clangd file in the Unreal directory(only if there isn't one there)
608+
- It will never overwrite a clangd file in your Unreal directory
609+
- You can also use the command: `Create Unreal Source Support` if you want to only create a Unreal Source support project
610+
- This dynamically creates a compile commands file based on the response files that are created when you created your Unreal project
611+
612+
`Note:` This extension turns off errors for .cpp files `for Non-Full source Unreal Engine Files`
613+
- This is because some .cpp files have special include macros
614+
- The files required for these include statements don't exist in Non-Full source projects
615+
- This shouldn't affect anything
616+
- `This won't affect your project files`. Just Unreal Source files.
617+
- This is feature is found in the .clangd file in the Unreal Engine parent directory so it can easily be removed if you want
618+
619+
#### Example of an erring macro below(I believe there are other include macros that error)
620+
![](https://private-user-images.githubusercontent.com/62588629/386956610-48b676d1-e1cb-4f10-8cd0-50ca4ff13416.png?jwt=eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpc3MiOiJnaXRodWIuY29tIiwiYXVkIjoicmF3LmdpdGh1YnVzZXJjb250ZW50LmNvbSIsImtleSI6ImtleTUiLCJleHAiOjE3MzE4NDY4MDEsIm5iZiI6MTczMTg0NjUwMSwicGF0aCI6Ii82MjU4ODYyOS8zODY5NTY2MTAtNDhiNjc2ZDEtZTFjYi00ZjEwLThjZDAtNTBjYTRmZjEzNDE2LnBuZz9YLUFtei1BbGdvcml0aG09QVdTNC1ITUFDLVNIQTI1NiZYLUFtei1DcmVkZW50aWFsPUFLSUFWQ09EWUxTQTUzUFFLNFpBJTJGMjAyNDExMTclMkZ1cy1lYXN0LTElMkZzMyUyRmF3czRfcmVxdWVzdCZYLUFtei1EYXRlPTIwMjQxMTE3VDEyMjgyMVomWC1BbXotRXhwaXJlcz0zMDAmWC1BbXotU2lnbmF0dXJlPTc4YTE5MDFiOTg5ZGE0MjM0ZmU2YWUwZmI5NjNjYzM5ZWEyNTY0MmFkNjVlMjg0NmNhNWJjMGUyMWEwODIzNTgmWC1BbXotU2lnbmVkSGVhZGVycz1ob3N0In0.AhQMn4Qne-jcUq6xfVeyc1uPgB2VuxjRiXlPMW-Wk84)
621+
622+
```
623+
```
624+
625+
[Top](#table-of-contents)
626+
627+
---
628+
561629
## Info
562630
### Logs
563631
Click the console 'OUTPUT' tab and change the top right drop down to 'unreal clangd':
@@ -803,8 +871,36 @@ Thanks to Mark at [stackoverflow](https://stackoverflow.com/a/76096050/13950944)
803871
```
804872
```
805873
### Linux Fixes
806-
807-
Check the .clangd project file 'Add' section for all the fixes applied.
874+
`Nov 2024`: Had trouble installing LLVM 18 for Unreal 5.5 (Ubuntu 22.04)
875+
876+
- Found this to work
877+
- Make sure you don't have an `llvm.sh` file already in the directory you have open. The file you download won't overwrite the file already in your directory. It will name it something else.
878+
- This will install LLVM 18.1.8 (`for Unreal 5.5, make sure to install the correct version for your version of Unreal`)
879+
- Epic recommends 18.1.0
880+
- In a perfect world, patch update versions wouldn't matter
881+
- For me, it does seems to work fine but you could have problems. You can always build from source if you want the specific 18.1.0 version.
882+
883+
`Here's the instructions`:
884+
1. wget https://apt.llvm.org/llvm.sh
885+
2. chmod +x llvm.sh
886+
3. sudo ./llvm.sh 18
887+
888+
### Mac Fixes
889+
- `Nov 20224` Add new setting: "unreal-clangd.creation.MacFileLanguage"
890+
- This allows you to change the File Language from C++ to Ojbective C++ (`during clangd project creation`)
891+
- Git user szabot0412 said changing the file language to Objective C++ fixed his red squiggles
892+
- If more people confirm this then I might change Objective C++ to default file language for Mac users
893+
894+
#### Manual Mac File Language Fix
895+
- Open up your .clangd files in your project parent directory and Unreal Source parent directory
896+
- Change this line under `Add:`
897+
```
898+
- -xc++
899+
```
900+
Change to this:
901+
```
902+
- -xobjective-c++
903+
```
808904
809905
```
810906
```

package-lock.json

Lines changed: 16 additions & 16 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

Lines changed: 16 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
"name": "unreal-clangd",
33
"displayName": "Unreal Clangd",
44
"description": "clangd helper for UE 5.2+",
5-
"version": "2.5.1",
5+
"version": "2.6.0",
66
"engines": {
77
"vscode": "^1.77.3"
88
},
@@ -65,6 +65,11 @@
6565
"command": "unreal-clangd.addToCompletionHelper",
6666
"title": "Add headers to completionHelper.cpp",
6767
"category": "unreal clangd"
68+
},
69+
{
70+
"command": "unreal-clangd.createUnrealSourceClangdProject",
71+
"title": "Create Unreal Source support",
72+
"category": "unreal clangd"
6873
}
6974
],
7075
"configuration": [
@@ -158,6 +163,16 @@
158163
"markdownDescription": "This setting doesn't need to be set manually. It will be set during creation process.",
159164
"scope": "resource"
160165
},
166+
"unreal-clangd.creation.MacFileLanguage": {
167+
"type": "string",
168+
"default": "c++",
169+
"enum": [
170+
"c++",
171+
"objective-c++"
172+
],
173+
"markdownDescription": "How files are treated on Mac(Apple). The setting is set in your .clangd file on creation of a project.",
174+
"scope": "resource"
175+
},
161176
"unreal-clangd.creation.tidy": {
162177
"type": "boolean",
163178
"default": false,

0 commit comments

Comments
 (0)