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

`Debug to console` doesn't work correctly on multiline commands #111

Closed Danp2 closed 2 years ago

Danp2 commented 2 years ago

Original code

    Global $isCallback =  _WinHttpSetStatusCallback( $hWS, _
        $WINHTTP_STATUS_CALLBACK, _
        $WINHTTP_CALLBACK_FLAG_ALL_NOTIFICATIONS);

Expected result

    Global $isCallback =  _WinHttpSetStatusCallback( $hWS, _
        $WINHTTP_STATUS_CALLBACK, _
        $WINHTTP_CALLBACK_FLAG_ALL_NOTIFICATIONS);
    ;### Debug CONSOLE ↓↓↓
    ConsoleWrite('@@ Debug(' & @ScriptLineNumber & ') : $isCallback = ' & $isCallback & @CRLF & '>Error code: ' & @error & @CRLF)

Actual result

    Global $isCallback =  _WinHttpSetStatusCallback( $hWS, _
    ;### Debug CONSOLE ↓↓↓
    ConsoleWrite('@@ Debug(' & @ScriptLineNumber & ') : $isCallback = ' & $isCallback & @CRLF & '>Error code: ' & @error & @CRLF)
        $WINHTTP_STATUS_CALLBACK, _
        $WINHTTP_CALLBACK_FLAG_ALL_NOTIFICATIONS);
Danp2 commented 2 years ago

Also doesn't work correctly when positioned on last line of document --

Original code

Local $test

Expected result

Local $test
;### Debug CONSOLE ↓↓↓
ConsoleWrite('@@ Debug(' & @ScriptLineNumber & ') : $test = ' & $test & @CRLF & '>Error code: ' & @error & @CRLF)

Actual result

local $test;### Debug CONSOLE ↓↓↓
ConsoleWrite('@@ Debug(' & @ScriptLineNumber & ') : $test = ' & $test & @CRLF & '>Error code: ' & @error & @CRLF)
Danp2 commented 2 years ago

@loganch Any feedback on this and the associated PR? TIA