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
Go To Definition functionality #24
Comments
So this one is a bug, but it is tricky. When you want to find the declaration for There is also the question of where global defined variables within functions or conditionals fall into this declaration hierarchy. I would argue my solution makes sense in a development environment, but when testing behavior in PHP (A language where no keyword is needed to declare a variable) with the |
Hi @genius257, Sven (SOLVE-SMART) here. In my opinion
this would be the way to go and how I would expect it. Like you already mentioned, other extensions do exactly this. Let's see what Dan is thinking of 🤝 . Best regards |
I believe the default should be to locate the first declaration occurrence outside of a function. Maybe you could offer a way to toggle between these two "styles" of GTD. |
What should happen in a scenario like the following? Global $x
$x = 'test1'
myFunc1('test2')
MyFunc2()
Func MyFunc1($x)
ConsoleWrite($x & @CRLF)
EndFunc
Func MyFunc2()
Local $x
$x = 'test3'
EndFunc Both functions create a local instance of |
I personally would expect, the search for the |
So I'm thinking using the actual AutoIt3 runtime behavior for varaibles in scopes (functions) and how most if not all other language intellisense does it for global. The following list behavior will stop and return if match is found. Within a function:
Outside of a function:
In step 1 of If no scope is defined for variable declarations within functions, Local scope is assumed. Always assuming Local scope, is specific for declaration lookup, and other providers, like future check all references would update this scope to Global if a declaration of said variable with Global was found anywhere in the code. Let me know if it makes sense :) I just realized that i currently aren't processing Assign, Eval, Execute and IsDeclared. I plan on making issues for each. They will be low priority for now, just a heads up... |
Should now be fixed with version 1.2.4 😄 |
@genius257 Unfortunately, the latest update appears to have broken the GTD functionality for functions. |
I'm sorry to hear 😞 |
Fixed by 254eb03 |
Running some basic tests, I've encountered one small issue with the GTD functionality. Here's a code sample --
With the above, everything is good except that I am unable to find a reference for
$_WD_Debug
, which is a global variable declared in wd_core.au3. Taking a deeper dive, it seems that most of the global variables from include files are not being recognized.The text was updated successfully, but these errors were encountered: