primitive icon indicating copy to clipboard operation
primitive copied to clipboard

Unable to properly read Unreal Engine solutions in Primitive

Open sctjkc01 opened this issue 3 years ago • 1 comments

Summary

Unreal projects parse to a degree in Primitive, however, the various UE Macros seem to trip the parser up. It gets stuck thinking that the specifiers like UFUNCTION() or UPROPERTY() are int-returning calls when in actuality they're parsed by the Unreal Header Tool to provide a mechanism approximating reflection, and because said specifiers don't have a semicolon the parser completely mangles the rest of the code.

Platform (Vive, Rift, Windows MR, GearVR): Vive & Index Loaded project: A large codebase in UE4

What steps are needed to reproduce the issue?

  1. Create a UE4 project.
  2. Within the project, create a C++ class, which contains the following method:
public:
    UFUNCTION()
    void TestMethod() {
        UE_LOG(LogTemp, Verbose, TEXT("I'm an example!"));
    }
  1. Open the project in Primitive.
  2. Observe the mangling of the class's TestMethod definition.

sctjkc01 avatar Jul 10 '21 07:07 sctjkc01

Thank you for pointing this out. We hadn't thought to test this case.

We use ANTLR to parse C++ code in the Primitive executable. We have a separate tool that uses Clang to parse C++ code that is currently only available for licensed users. We'll have to look at both tools to see if it's easy to handle this case.

atonalfreerider avatar Jul 11 '21 13:07 atonalfreerider