Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

CfgFunctions is not parsed properly #83

Open
3FCO opened this issue Dec 24, 2020 · 8 comments · Fixed by #84
Open

CfgFunctions is not parsed properly #83

3FCO opened this issue Dec 24, 2020 · 8 comments · Fixed by #84
Assignees
Labels

Comments

@3FCO
Copy link

3FCO commented Dec 24, 2020

Problem: When SQFLint is indexing the workspace, all my functions show up as Possibly undefined variable.

I have everything setup, as in ArmA 3 Functions

image
image
GOES ON FOR THE WHOLE FUNCTIONS.HPP

image

Am I missing something? Tried switching to older verison, but didn't help either.

Kind regards

@mr-guard
Copy link
Collaborator

I guess the relative path isnt detected properly.
Can you share the folder structure?

@3FCO
Copy link
Author

3FCO commented Dec 24, 2020

Yeah sure. Sorry for late repsonse

image

@SkaceKamen
Copy link
Owner

SkaceKamen commented Dec 24, 2020

I think the tag is not properly parsed. Could you try if ArmaProjektet_fn... exists?

Update: Putting the tag into the Admin class should fix it for now.

@SkaceKamen SkaceKamen added the bug label Dec 24, 2020
@SkaceKamen SkaceKamen self-assigned this Dec 24, 2020
@SkaceKamen SkaceKamen changed the title Possibly undefined variable Tag property of CfgFunctions is not parsed properly Dec 24, 2020
@3FCO
Copy link
Author

3FCO commented Dec 24, 2020

Tried one: ArmaProjektet_fn_initEVH and it's the same problem.
image

image
image

Don't know if I have done something wrong on my part, or just some wrong settings. Sorry for the hassle, but appreciate the quick response

@mr-guard mr-guard reopened this Dec 24, 2020
@mr-guard
Copy link
Collaborator

Sorry for the auto close.

@SkaceKamen Something that came to my mind after approval:
tag = tagClass.body.variables.tag || tagClass.name;
Is this actually a safe access?

@SkaceKamen SkaceKamen changed the title Tag property of CfgFunctions is not parsed properly CfgFunctions is not parsed properly Dec 25, 2020
@SkaceKamen
Copy link
Owner

SkaceKamen commented Dec 25, 2020

Don't know if I have done something wrong on my part, or just some wrong settings. Sorry for the hassle, but appreciate the quick response

@3FCO There seems to also be an issue somewhere else than tag. Keep the tagin the Init class, for now. Support for tag in the ArmaProjekt class will be coming in the next version. Are you using marcos or something advanced in your description.ext? Are there any errors when you open description.ext?

@SkaceKamen Something that came to my mind after approval:
tag = tagClass.body.variables.tag || tagClass.name;
Is this actually a safe access?

It should be, the variables should be always defined. Feel free to test it tho, I'm not currently on my dev machine

@3FCO
Copy link
Author

3FCO commented Dec 25, 2020

@SkaceKamen I removed some simple macros from my cfgRemoteExec, but that didn't seem to help. But if i deleted both the macros AND put the TAG in all my function classes, like you suggested, it works fine.
But it didn't work by only removing the errors from my cfgRemoteExec.

@SkaceKamen
Copy link
Owner

Yea, the issue is probably with the macros, the current parser supports them only partially and behaves unexpectedly when some more complicated macros come into play. The preprocessor needs to be updated to properly parse and expand macros, but that isn't an easy task, unfortunately :(

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants