Author |
Topic |
|
h.teixeira
New Member
United Kingdom
3 Posts |
Posted - Mar 22 2023 : 10:06:47 AM
|
Hello. Last week I updated my visual studio 2019 enterprise to the most recent version. I'm not entirely sure which version I was on before, but I imagine it was one of the most recent ones anyways.
At some point last week I noticed the visual assist extension was not allowing me to use "Add Include", which is truthfully one of the features I use the most. Specifically, I use it by copying a file's path, pasting the path, right click -> Quick Actions and Refactorings (VA) -> Add Include, which formats it to what I need it to be. This option is just greyed out now.
I have repaired my visual studio, uninstalled and reinstalled visual assist with the most recent version, rolled back to previous visual studio 2019 enterprise versions, but none of this helped. This specific functionality remains broken.
Strangely, no other engineer on my team has had this issue. Does anyone know how to fix this?
Thank you |
|
feline
Whole Tomato Software
United Kingdom
19031 Posts |
Posted - Mar 22 2023 : 11:24:31 AM
|
I have never considered, or heard of, using Add Include like this. The way it is expected to be used is to use the type, for example:
AActor foo; FTimeManager bar;
then place the caret into the type name, and now you can trigger Add Include on the type.
Given the full path in your screen shot, and the names, I am assuming you are using Unreal Engine, is this correct?
If so, VA's Unreal Engine support assumes that Unreal Engine has been installed under the directory "C:\Program Files\", and if it hasn't not everything works as well as it should.
This could be a factor in why Add Include isn't working that well for you. I have just tried this here, with the above two types, using VS2022, VA 2476 and Unreal Engine 4.27, and Add Include is suggesting the header file for the type correctly.
If you are interested in applying the work around for the Unreal Engine location can you please create a junction point link to point at the installed engine. So:
Create the directory "C:\Program Files\Epic Games\"
Open a command prompt inside this directory, running as administrator, and run the command:
mklink /J UE_4.27 "C:\Pioneer\"
Where the second path is the directory where you have installed / placed Unreal Engine. This will create a directory link inside the Windows file system, so while Unreal Engine will appear to exist inside this Program Files sub-directory, is still where it was originally installed.
Now to update your project to use the new path, open the Unreal Engine editor via this junction point, so if you are running UE 4 run:
C:\Program Files\Epic Games\UE_4.27\Engine\Binaries\Win64\UE4Editor.exe
open your project, and use:
File menu -> Refresh Visual Studio Project
or if you are running UE 5 run:
C:\Program Files\Epic Games\UE_5.0\Engine\Binaries\Win64\UnrealEditor.exe
open your project, and use:
Tools menu -> Refresh Visual Studio Project
this will update the project to use the "C:\Program Files\" path of the junction point for the location of Unreal Engine, which is what Visual Assist is expecting.
At this point VA's support for Unreal Engine, assuming you have enabled this under:
VA Options -> Game Development
should work better, including things like showing UE symbols in italic, if this is enabled. |
zen is the art of being at one with the two'ness |
|
|
Thormor
Starting Member
1 Posts |
Posted - Mar 22 2023 : 1:21:29 PM
|
I have the exact same issue with UE 5.1 and VS2022
The project I am on has its own custom UE engine, we do not download it from the Epic launcher but it's part of the solution-project as it's build by ourselves (like most big companies do).
|
Edited by - Thormor on Mar 22 2023 1:24:39 PM |
|
|
feline
Whole Tomato Software
United Kingdom
19031 Posts |
Posted - Mar 23 2023 : 07:19:04 AM
|
You are not the first person I have worked with who has done this with UE. Does UE still have a similar folder structure, even though it is part of your solution project? Is it contained in a "UE5" project that is part of the main solution?
I am wondering how different your version of UE is, or if it is close enough that VA should still pick it up and handle it as UE code.
VA certainly doesn't expect or require that the code came from the Epic launcher, we are quite happy with the code downloaded and compiled from github, or another source control system. |
zen is the art of being at one with the two'ness |
|
|
h.teixeira
New Member
United Kingdom
3 Posts |
Posted - Mar 23 2023 : 08:40:39 AM
|
I am using Unreal Engine yes (in this case 4.27) We too use our custom version of the engine, part of the same solution project. In terms of folder structure, it's the exact same as normal UE. I don't think this would be the issue, because "Add Include" used as I described it has always worked for me, and I've been using it consistently for the past 2 years across 2 different project. The project I was previously on was in disk D:/, and the engine was more heavily modified, and it still always worked. Also, this is meant to work with my own project's files, and it doesn't anymore. Even if I were to move the directory of my Unreal Engine, my own classes would still reside somewhere else, and they would need to be picked up by Visual Assist regardless of their directory.
I can still use "Add Include" in the way @feline has described. It is picking up the symbols and pasting it as an include directory at the top of the file, but this is not in the format I need it to be. For example, if I want to include "UObject", @feline's way of using Add Include will insert '#include "Object.h"' at the top. The way I use(d) Add Include would give me '#include <Runtime/CoreUObject/Public/UObject/Object.h>', which is exactly what I want, conforming to the standards we always adhere to. By copying the file path and using Add Include, it would also know to differentiate internal and external includes. For example, in this case I am working on a class from a new module we've created, imagine the module is called EdenAudio. When adding includes for external classes, such as UObject which is from the engine itself, it would do so using angular brackets: #include <Runtime/CoreUObject/Public/UObject/Object.h>. Adding includes from the same module, internal classes, this would automatically format with double quotation marks: #include "Runtime/EdenAudio/Public/Music/MyMusicClass.h" This is how I want Add Include to paste the includes.
Using "Add Include" by hovering the class name will truncate the include directory as much as it can, which is not very useful as I need to write the full version manually afterwards. It also does not differentiate between external and internal includes, it will always use quotation marks.
|
|
|
h.teixeira
New Member
United Kingdom
3 Posts |
Posted - Mar 23 2023 : 10:16:15 AM
|
Actually let me correct what I said. "Add Include" on class names doesn't always use quotation marks for the include, I'm not sure how it differs between using angular brackets and quotation marks. Either way, it does not format it as I need it to Sorry about the confusion! |
|
|
feline
Whole Tomato Software
United Kingdom
19031 Posts |
Posted - Mar 23 2023 : 12:07:18 PM
|
Using Add Include on a file path, I have just tried a simple test case, under Windows 10, with Visual Studio 2019, and three different versions of VA, 2389, 2420 and the current release, 2476. These were selected at random, but were released over a couple of years, so this is a fairly wide spread.
Add Include is never offered to me, in any of these versions. I am placing the keyboard caret into the file name at the end of the path, and it is a full path, starting with C: and using \, just like in the screen shot. So if this used to work for you I am not sure how or why, but I would be interested in trying your VA and IDE settings, if possible, to see if I can reproduce this with a couple of different versions of VA.
If this is possible, can you please export your VA and IDE settings and send them to me:
VA Options -> Performance -> Export Settings IDE tools menu -> Import and Export Settings -> Export selected environment settings
Please send me the files via email:
[email protected]
including this thread ID or URL in the description, so we can match it up.
For using Add Include on a type, there are a couple of settings that may well help here:
VA Options -> Code Generation -> Add Include style:
VA Options -> Code Generation -> Add Include path:
both of which offer pull down lists of different options, which will help you to customize how Add Include formats the inserted include.
Unreal Engine is an interesting edge case, in that you are using #include <> which normally means "something from my external library directory list", but UE is part of your solution, not an external library.
Part of VA's special handling for UE is to treat it as an external library, even though it is part of your solution, so if VA is picking up UE correctly I expect Add Include to use #include <> lines for UE header files. |
zen is the art of being at one with the two'ness |
|
|
|
Topic |
|
|
|