loganch / AutoIt-VSCode

AutoIt Extension for Visual Studio Code
https://marketplace.visualstudio.com/items?itemName=Damien.autoit
MIT License
74 stars 25 forks source link

GoTo definition failing #204

Closed ghost closed 10 months ago

ghost commented 10 months ago

I have the problem, that is not possible to goto definition if in one of the user included files a standard file has been included. If the line#include <Array.au3> in Dummy_1.au3 is commented out, GoTo is working.

Main

#Region Includes
    #include "IncludeTest\Dummy_1.au3"
    #include "IncludeTest\Dummy_2.au3"
#EndRegion Includes

#Region Main
    _Main()

    Func _Main()
        Local $fcDummyFunc = _DummyFunc
    EndFunc   ;==>_Main
#EndRegion Main

Dummy_1.au3

#include-once

#Region Include
    #include <Array.au3>
#EndRegion Include

Dummy_2.au3

#NoTrayIcon
#include-once

#Region 
    Func _Dummy2()
    EndFunc
#EndRegion
Danp2 commented 10 months ago

I've noticed this as well. Using git bisect, I've been able to determine that the problem was introduced in https://github.com/loganch/AutoIt-VSCode/commit/be5c32223375d41dacd94088dc086b4fbed535e8.

Danp2 commented 10 months ago

@MrChiliCheese Your posted code doesn't appear to be correct. Is _DummyFunc supposed to be _Dummy2?

Also, are you testing with the version from the Marketplace or one you built yourself? I ask this because I'm seeing some behavior that I can't understand. When I use the v1.0.12 from the Marketplace, the GoTo Definition works for me. If I build myself or run within VSCode from the same commit, it fails to lookup the target.

@loganch Any ideas? I reset my PC a while back, so maybe I am missing a library, have the wrong Node version or something like that. 🤷‍♂️

ghost commented 10 months ago

@Danp2 , yes my mistake. I tried to reduce the script causing scripts as much as possible and forgot to rename the functions. I am using the one from the marketplace, but I can also try to to clean installation in a VM and check the behaviour.