EliotVU / UnrealScript-Language-Service

Bringing a work-in-progress intelliSense to ye olde UnrealScript :)
MIT License
49 stars 10 forks source link

[Bug]: Parser not detecting functions that exist in the same file. #191

Open Tedster59 opened 3 months ago

Tedster59 commented 3 months ago

Describe the bug

After sticking with version 0.6.3 or so for a while, I was trying 7.1 and now 8.1, and I'm seeing that the parser is failing to find function references that exist in the same file. I'm not sure if there's an issue with the project I'm working on being too large or if there is some other issue, such as too many custom macros, or the fact XCOM 2 uses a custom version of UE3 that is more like a UE3.5

Using VSCode 1.91.1 and extension version 0.8.1 right now.

Screenshots

For example, it's not detecting this function, as well as several that are called as part of this event. image

Ctrl F for it, the function is definitely here.

image

EliotVU commented 3 months ago

Yes, usually caused by in-lined macros that the extension is not aware of.

Tedster59 commented 3 months ago

Hmm, what's the best way to make it aware of the custom macros? They are defined in an extra_globals.uci file that is in a folder that is part of the vscode workspace. I've also noticed it sometimes failing to find class definitions that it would before.

Tedster59 commented 3 months ago

Also potentially related, in the same file, it will find the class definition, but then fail to find it farther down the file. found, go to definition works, etc.

This class is mentioned 57 times in the file per ctrl-f search, and the first five are correctly identified. image

6 and afterwards are not located and go to definition does nothing.

image

Some functions are not underlined red, but Go To Definition doesn't work on them. image

image

File being used in these examples is: https://github.com/long-war-2/lwotc/blob/beta/LongWarOfTheChosen/Src/LW_Overhaul/Classes/X2DownloadableContentInfo_LongWarOfTheChosen.uc