Closed genius257 closed 6 months ago
The behavior of goto declaration feature within a function scope is tricky. Global matching still is not perfect, and I am unsure if the current implementation is correct. I will mark this as completed for now, expecting an issue specificlly for global variable lookup behavior can be discussed, at a later date if need be.
Variable lookup within a function does not work as expected.
Originally posted by @Danp2 in https://github.com/genius257/vscode-autoit/issues/24#issuecomment-1483173951
Example:
The issue with the
$MB_HELP
declaration is caused partially by the parser: https://github.com/genius257/autoit3-pegjs/issues/33#issue-1640268416The remaining declaration resolve problem is caused by the Local/Global/Auto scope of a variable not being taken into account, within a function.
As matching variable declarations are found within the function (before the lookup origin), the scope of the declaration must be updated.