loganch / AutoIt-VSCode

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

Include path not detecting correctly #164

Open osmiyaki opened 1 year ago

osmiyaki commented 1 year ago

Hello, in the past i have used this extension wothout issues, but suddenly now in my script i get erros corresponding to include files not being detected, I'm including erros displaying and the user config.

I'm using portable version if vscode 1.74.3, portable Scite 4.4.6 and portable autoit 3.3.14.5

I have tried running vscode as admin and updating, reinstalling scite and autoit, reverting extension version without fixing the error.

Asking for help, please.

`#1: Starting process #1
"E:\Software\AutoIt\AutoIt3.exe" "E:\Software\AutoIt\SciTE\AutoIt3Wrapper\AutoIt3Wrapper.au3" /run /prod /ErrorStdOut /in "e:\Sync\Programacion\AutoIt_Scripts\GUI_SAT\GUI-SAT.au3" [PID 5144]
    +>20:50:25 Starting AutoIt3Wrapper (21.316.1639.1) from:Code.exe (1.73.1.0)  Keyboard:0000080A  OS:WIN_10/2009  CPU:X64 OS:X64  Environment(Language:080A)
    !->Includefile <wd_core.au3> not found.
    !->Includefile <wd_helper.au3> not found.
    !->Includefile <wd_capabilities.au3> not found.
    >Running AU3Check (3.3.14.5)  from:E:\Software\AutoIt  input:e:\Sync\Programacion\AutoIt_Scripts\GUI_SAT\GUI-SAT.au3
    "e:\Sync\Programacion\AutoIt_Scripts\GUI_SAT\GUI-SAT.au3"(5,10) : error: can't open include file <wd_core.au3>.
    #include <wd_core.au3>
    ~~~~~~~~~^
    "e:\Sync\Programacion\AutoIt_Scripts\GUI_SAT\GUI-SAT.au3"(6,10) : error: can't open include file <wd_helper.au3>.
    #include <wd_helper.au3>
    ~~~~~~~~~^
    "e:\Sync\Programacion\AutoIt_Scripts\GUI_SAT\GUI-SAT.au3"(7,10) : error: can't open include file <wd_capabilities.au3>.
    #include <wd_capabilities.au3>
    ~~~~~~~~~^
    "e:\Sync\Programacion\AutoIt_Scripts\GUI_SAT\GUI-SAT.au3"(125,29) : warning: $_WD_DEBUG_Full: possibly used before declaration.
    $_WD_DEBUG = $_WD_DEBUG_Full
    ~~~~~~~~~~~~~~~~~~~~~~~~~~~~^
    "e:\Sync\Programacion\AutoIt_Scripts\GUI_SAT\GUI-SAT.au3"(439,34) : warning: $_WD_ERROR_Success: possibly used before declaration.
        If @error <> $_WD_ERROR_Success Then
        ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^
    "e:\Sync\Programacion\AutoIt_Scripts\GUI_SAT\GUI-SAT.au3"(1162,49) : warning: $_WD_LOCATOR_ByXPath: possibly used before declaration.
        _WD_WaitElement($sSession, $_WD_LOCATOR_ByXPath,
        ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^
    "e:\Sync\Programacion\AutoIt_Scripts\GUI_SAT\GUI-SAT.au3"(1164,36) : warning: $_WD_ERROR_Timeout: possibly used before declaration.
        While (@error = $_WD_ERROR_Timeout)
        ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^
    "e:\Sync\Programacion\AutoIt_Scripts\GUI_SAT\GUI-SAT.au3"(1164,69) : warning: $_WD_ERROR_NoMatch: possibly used before declaration.
        While (@error = $_WD_ERROR_Timeout) Or (@error = $_WD_ERROR_NoMatch)
        ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^
    "e:\Sync\Programacion\AutoIt_Scripts\GUI_SAT\GUI-SAT.au3"(1177,41) : warning: $_WD_ERROR_ElementIssue: possibly used before declaration.
        While (@error = $_WD_ERROR_ElementIssue)
        ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^
    "e:\Sync\Programacion\AutoIt_Scripts\GUI_SAT\GUI-SAT.au3"(125,29) : error: $_WD_DEBUG_Full: undeclared global variable.
    $_WD_DEBUG = $_WD_DEBUG_Full
    ~~~~~~~~~~~~~~~~~~~~~~~~~~~~^
    "e:\Sync\Programacion\AutoIt_Scripts\GUI_SAT\GUI-SAT.au3"(439,34) : error: $_WD_ERROR_Success: undeclared global variable.
        If @error <> $_WD_ERROR_Success Then
        ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^
    "e:\Sync\Programacion\AutoIt_Scripts\GUI_SAT\GUI-SAT.au3"(1162,49) : error: $_WD_LOCATOR_ByXPath: undeclared global variable.
        _WD_WaitElement($sSession, $_WD_LOCATOR_ByXPath,
        ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^
    "e:\Sync\Programacion\AutoIt_Scripts\GUI_SAT\GUI-SAT.au3"(1164,36) : error: $_WD_ERROR_Timeout: undeclared global variable.
        While (@error = $_WD_ERROR_Timeout)
        ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^
    "e:\Sync\Programacion\AutoIt_Scripts\GUI_SAT\GUI-SAT.au3"(1164,69) : error: $_WD_ERROR_NoMatch: undeclared global variable.
        While (@error = $_WD_ERROR_Timeout) Or (@error = $_WD_ERROR_NoMatch)
        ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^
    "e:\Sync\Programacion\AutoIt_Scripts\GUI_SAT\GUI-SAT.au3"(1177,41) : error: $_WD_ERROR_ElementIssue: undeclared global variable.
        While (@error = $_WD_ERROR_ElementIssue)
        ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^
    "e:\Sync\Programacion\AutoIt_Scripts\GUI_SAT\GUI-SAT.au3"(384,33) : error: _WD_DeleteSession(): undefined function.
                        _WD_DeleteSession($sSession)
                        ~~~~~~~~~~~~~~~~~~~~~~~~~~~^
    "e:\Sync\Programacion\AutoIt_Scripts\GUI_SAT\GUI-SAT.au3"(387,18) : error: _WD_Shutdown(): undefined function.
                    _WD_Shutdown()
                    ~~~~~~~~~~~~~^
    "e:\Sync\Programacion\AutoIt_Scripts\GUI_SAT\GUI-SAT.au3"(437,14) : error: _WD_Startup(): undefined function.
        _WD_Startup()
        ~~~~~~~~~~~~^
    "e:\Sync\Programacion\AutoIt_Scripts\GUI_SAT\GUI-SAT.au3"(443,53) : error: _WD_CreateSession(): undefined function.
        $sSession = _WD_CreateSession($sDesiredCapabilities)
        ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^
    "e:\Sync\Programacion\AutoIt_Scripts\GUI_SAT\GUI-SAT.au3"(461,36) : error: _WD_Option(): undefined function.
        _WD_Option('console', ConsoleWrite)
        ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^
    "e:\Sync\Programacion\AutoIt_Scripts\GUI_SAT\GUI-SAT.au3"(462,27) : error: _WD_UpdateDriver(): undefined function.
        _WD_UpdateDriver('Chrome')
        ~~~~~~~~~~~~~~~~~~~~~~~~~^
    "e:\Sync\Programacion\AutoIt_Scripts\GUI_SAT\GUI-SAT.au3"(479,33) : error: _WD_Navigate(): undefined function.
        _WD_Navigate($sSession, $PACSAT)
        ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^
    "e:\Sync\Programacion\AutoIt_Scripts\GUI_SAT\GUI-SAT.au3"(485,43) : error: _WD_Attach(): undefined function.
        _WD_Attach($sSession, "sat.gob.mx", "URL")
        ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^
    "e:\Sync\Programacion\AutoIt_Scripts\GUI_SAT\GUI-SAT.au3"(1162,65) : error: _WD_WaitElement(): undefined function.
        _WD_WaitElement($sSession, $_WD_LOCATOR_ByXPath, $btn, 100, 100)
        ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^
    "e:\Sync\Programacion\AutoIt_Scripts\GUI_SAT\GUI-SAT.au3"(1174,66) : error: _WD_FindElement(): undefined function.
        $sButton = _WD_FindElement($sSession, $_WD_LOCATOR_ByXPath, $btn)
        ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^
    "e:\Sync\Programacion\AutoIt_Scripts\GUI_SAT\GUI-SAT.au3"(1176,48) : error: _WD_ElementAction(): undefined function.
        _WD_ElementAction($sSession, $sButton, 'click')
        ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^
    "e:\Sync\Programacion\AutoIt_Scripts\GUI_SAT\GUI-SAT.au3"(1207,72) : error: _WD_ExecuteScript(): undefined function.
        _WD_ExecuteScript($sSession, "return window.scrollBy(0," & $dist & ")")
        ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^
    e:\Sync\Programacion\AutoIt_Scripts\GUI_SAT\GUI-SAT.au3 - 21 error(s), 6 warning(s)
    !>20:50:25 AU3Check ended.rc:2
    +>20:50:25 AutoIt3Wrapper Finished.
    !>Exit code 2 Time: 0.328`
`{
    "autoit.includePaths": [
        "E:\\Software\\AutoIt\\UDF\\WebDriver",
        "E:\\Software\\AutoIt\\UDF\\Json",
        "E:\\Software\\AutoIt\\UDF\\WebSocket",
        "E:\\Software\\AutoIt\\UDF\\HtmlTable2Array",
        "E:\\Software\\AutoIt\\UDF\\WinHttp",
        "E:\\Software\\AutoIt\\Include\\"
    ],
    "autoit.multiOutput": false,
    "autoit.aiPath": "E:\\Software\\AutoIt\\AutoIt3.exe",
}`
osmiyaki commented 1 year ago

Update:

After adding the include paths via SciteConfig.au3 file found in Scite folder, errors stop showings in VSCode, it this normal behavior?

I know SciteConfig creates a registry key with the paths and also modifies SciTEUser.properties file.

Danp2 commented 1 year ago

You bring up a valid point. It looks like AutoIt3Wrapper.au3 retrieves the Includes directories from HKCU\Software\AutoIt v3\Autoit. Seems like we should keep this in sync with the value of autoit.includePaths.

Thoughts @loganch?

vanowm commented 1 year ago

Personally I'm skeptical about modifying registry from within an extension...

GrandStrateguerre commented 1 year ago

@osmiyaki try only one E:\Software\AutoIt\UDF\ instead of delaring all : should works.

vanowm commented 1 year ago

There is a situation when an include path was added to the autoit.includePaths list and then user used relative path in #include directive, the editor doesn't show any errors, however during run script it fails due to include file not found. So maybe writing to the registry would be needed after all...