Jump to content

BETA: SciTE v5x & lua Dynamic_include and "Smart" AutoComplete for Vars/UDFs/Abbrevs


Recommended Posts

Posted

Today when I was working on wd_helper.au3 I got: 

  Quote

! Loop maxed out on 50!!!

Expand  

what this mean ?

Signature beginning:
Please remember: "AutoIt"..... *  Wondering who uses AutoIt and what it can be used for ? * Forum Rules *
ADO.au3 UDF * POP3.au3 UDF * XML.au3 UDF * IE on Windows 11 * How to ask ChatGPT for AutoIt Codefor other useful stuff click the following button:

  Reveal hidden contents

Signature last update: 2023-04-24

  • Developers
Posted

It's a safety I build in not expecting to ever happen, but ensure there won't be some sort of endless loop.
Do you know how to replicate it? Guess you were working on a Variable at the time this happens....   remember which one?

SciTE4AutoIt3 Full installer Download page   - Beta files       Read before posting     How to post scriptsource   Forum etiquette  Forum Rules 
 
Live for the present,
Dream of the future,
Learn from the past.
  :)

Posted (edited)
  On 2/28/2023 at 6:09 PM, Jos said:

Do you know how to replicate it?

Expand  

I hope so.

I did screenshot.

I can try to make test tomorrow.

Edited by mLipok

Signature beginning:
Please remember: "AutoIt"..... *  Wondering who uses AutoIt and what it can be used for ? * Forum Rules *
ADO.au3 UDF * POP3.au3 UDF * XML.au3 UDF * IE on Windows 11 * How to ask ChatGPT for AutoIt Codefor other useful stuff click the following button:

  Reveal hidden contents

Signature last update: 2023-04-24

Posted

I just sent to you email: AutoItPortable_for_JOS__testing_LUA.zip - part 6 - ....

Let me know if you need some more details.

Signature beginning:
Please remember: "AutoIt"..... *  Wondering who uses AutoIt and what it can be used for ? * Forum Rules *
ADO.au3 UDF * POP3.au3 UDF * XML.au3 UDF * IE on Windows 11 * How to ask ChatGPT for AutoIt Codefor other useful stuff click the following button:

  Reveal hidden contents

Signature last update: 2023-04-24

  • Developers
Posted (edited)

Thanks for the debug script: It is as I expected, a safeguard I had build-in, which I expected to be large enough but it isn't. :) 

When a $variable is checked for auto-include-addition, the script first checks whether it is defined in the current script by checking all whether a "$Variable" is part of a "Glocal/Local/Dim" statement or a line "$Variable=" is found. The assumption was that it normally would find no more than 50 occurrences of a variable in a particular script, but that isn't the case it this pretty large script. It is used 73 times so hence the warning message. I have left the check for max 50 in there for speed purposes and assume that when there is no definition for the $Variable in the first 50 occurrences, it likely isn't defined in this current script and bale the check. Changed it to only write an warning into the Log file form now on:

-10:54:57 ->AddMissingIncludes ->checkVarAlreadyDefined - Warning: Found 50+ occurences of variable $_WD_ERROR_Success, while checking for locally defined. Skip this check and assume not locally defined.

Change available in the Latest Beta version.

Jos 

Edited by Jos

SciTE4AutoIt3 Full installer Download page   - Beta files       Read before posting     How to post scriptsource   Forum etiquette  Forum Rules 
 
Live for the present,
Dream of the future,
Learn from the past.
  :)

Posted (edited)

 using: And it looks like the issue is fixed.
Thanks.

Edited by Jos

Signature beginning:
Please remember: "AutoIt"..... *  Wondering who uses AutoIt and what it can be used for ? * Forum Rules *
ADO.au3 UDF * POP3.au3 UDF * XML.au3 UDF * IE on Windows 11 * How to ask ChatGPT for AutoIt Codefor other useful stuff click the following button:

  Reveal hidden contents

Signature last update: 2023-04-24

Posted (edited)

@Jos I attach testing script for this following issue.

 

Just open attached wd_demo.au3 and go to the last line.
And I hope you will see duplicated entries of _WD_GetSession like in the following screenshot

image.png.7fb3207c4a8ecd0c0a7be01d4101561d.png

 

Example Part 7.zipFetching info...

Edited by mLipok

Signature beginning:
Please remember: "AutoIt"..... *  Wondering who uses AutoIt and what it can be used for ? * Forum Rules *
ADO.au3 UDF * POP3.au3 UDF * XML.au3 UDF * IE on Windows 11 * How to ask ChatGPT for AutoIt Codefor other useful stuff click the following button:

  Reveal hidden contents

Signature last update: 2023-04-24

Posted (edited)

@Jos

I have a new feature request proposal.

I was trying to use CTRL+j to jump into 

image.png.ca3b0ad6cf95543605a1bde767fc6ea7.png

 

EDIT:

can you add feature which will jump to desired include file which contains declaration of this value ?

Could you be so nice and add feature which will jump to desired include file which contains declaration of focused/selected value ?
Of course if this is possible and if you find some spare time....

Edited by mLipok

Signature beginning:
Please remember: "AutoIt"..... *  Wondering who uses AutoIt and what it can be used for ? * Forum Rules *
ADO.au3 UDF * POP3.au3 UDF * XML.au3 UDF * IE on Windows 11 * How to ask ChatGPT for AutoIt Codefor other useful stuff click the following button:

  Reveal hidden contents

Signature last update: 2023-04-24

  • Developers
Posted (edited)
  On 3/8/2023 at 9:51 AM, mLipok said:

And I hope you will see duplicated entries of _WD_GetSession like in the following screenshot

Expand  

I get that indeed and will look at it why this happens but i am pretty sure it is related to this error in au3check:

+>13:02:41 Starting AutoIt3Wrapper (22.611.2153.16) from:SciTE.exe (5.3.1.0)  Keyboard:00020409  OS:WIN_10/2009  CPU:X64 OS:X64  Environment(Language:0413)  CodePage:0  utf8.auto.check:4
+>         SciTEDir => C:\Program Files (x86)\AutoIt3\SciTE   UserDir => C:\Users\jvdza\AppData\Local\AutoIt v3\SciTE\AutoIt3Wrapper   SCITE_USERHOME => C:\Users\jvdza\AppData\Local\AutoIt v3\SciTE 
!->Includefile "z:\!!!_SVN_AU3\UDF_Forum\Other_Members\wd_helper.au3" not found.
!->Includefile "z:\!!!_SVN_AU3\UDF_Forum\Other_Members\wd_capabilities.au3" not found.

You get a clean au3check run?

Edited by Jos

SciTE4AutoIt3 Full installer Download page   - Beta files       Read before posting     How to post scriptsource   Forum etiquette  Forum Rules 
 
Live for the present,
Dream of the future,
Learn from the past.
  :)

  • Developers
Posted (edited)
  On 3/8/2023 at 10:40 AM, mLipok said:

Could you be so nice and add feature which will jump to desired include file which contains declaration of focused/selected value ?
Of course if this is possible and if you find some spare time....

Expand  

Will have a loo when I have some time for a new challenge. ;) 

Edited by Jos

SciTE4AutoIt3 Full installer Download page   - Beta files       Read before posting     How to post scriptsource   Forum etiquette  Forum Rules 
 
Live for the present,
Dream of the future,
Learn from the past.
  :)

Posted
  On 3/8/2023 at 12:03 PM, Jos said:

You get a clean au3check run?

Expand  

afters some fixes ... yes.

Check my new attached zip

 

Example Part 7.zipFetching info...

Signature beginning:
Please remember: "AutoIt"..... *  Wondering who uses AutoIt and what it can be used for ? * Forum Rules *
ADO.au3 UDF * POP3.au3 UDF * XML.au3 UDF * IE on Windows 11 * How to ask ChatGPT for AutoIt Codefor other useful stuff click the following button:

  Reveal hidden contents

Signature last update: 2023-04-24

  • Developers
Posted

Think I found the reason why this happens in your case and believe it is fixed in the current Beta zip file.
Also try the Goto Func change (Ctrl+J)  which now checks for Variable or Other string and will try to find the first "$variable =" definition in the current file or included files.
Will later update the name of Ctrl+J to Jump2Definition or something.

Jos

SciTE4AutoIt3 Full installer Download page   - Beta files       Read before posting     How to post scriptsource   Forum etiquette  Forum Rules 
 
Live for the present,
Dream of the future,
Learn from the past.
  :)

Posted (edited)

 using: 

And it looks like issue:

image.png

is fixed.


Thanks.

 

but I get such results:

  Quote

>>> AutoItDynamicIncludes switched off for unsaved file.
+ 14:12:39 _WD_GetSession => Add include:<wd_core.au3>
> Added 1 include(s) at top of the script. (v Volume in drive C is OS
 Volume Serial Number is 9850-8576

 Directory of C:\AutoItPortable\App\SciTEv5\Lua

08.03.2023  14:12           110ÿ294 AutoItDynamicIncludes.lua
               1 File(s)        110ÿ294 bytes
               0 Dir(s)  129ÿ234ÿ165ÿ760 bytes free
)
 

Expand  

 

 

EDIT: is this log intentionall ?

Edited by Jos

Signature beginning:
Please remember: "AutoIt"..... *  Wondering who uses AutoIt and what it can be used for ? * Forum Rules *
ADO.au3 UDF * POP3.au3 UDF * XML.au3 UDF * IE on Windows 11 * How to ask ChatGPT for AutoIt Codefor other useful stuff click the following button:

  Reveal hidden contents

Signature last update: 2023-04-24

Posted
  On 3/8/2023 at 1:10 PM, Jos said:

Also try the Goto Func change (Ctrl+J)  which now checks for Variable or Other string and will try to find the first "$variable =" definition in the current file or included files.

Expand  

testing CTRL+J while being focused on variable in line 1255 

image.png.da08393383602028816ae0e4a6ecc026.png

 

Signature beginning:
Please remember: "AutoIt"..... *  Wondering who uses AutoIt and what it can be used for ? * Forum Rules *
ADO.au3 UDF * POP3.au3 UDF * XML.au3 UDF * IE on Windows 11 * How to ask ChatGPT for AutoIt Codefor other useful stuff click the following button:

  Reveal hidden contents

Signature last update: 2023-04-24

  • Developers
Posted
  On 3/8/2023 at 1:15 PM, mLipok said:

EDIT: is this log intentionall ?

Expand  

which part? you mean this:

(v Volume in drive C is OS
 Volume Serial Number is 9850-8576

 Directory of C:\AutoItPortable\App\SciTEv5\Lua

08.03.2023  14:12           110ÿ294 AutoItDynamicIncludes.lua
               1 File(s)        110ÿ294 bytes
               0 Dir(s)  129ÿ234ÿ165ÿ760 bytes free
)

Don't think that should be there....  so what did you do this time to screw it up? ;) 

SciTE4AutoIt3 Full installer Download page   - Beta files       Read before posting     How to post scriptsource   Forum etiquette  Forum Rules 
 
Live for the present,
Dream of the future,
Learn from the past.
  :)

  • Developers
Posted (edited)
  On 3/8/2023 at 1:19 PM, mLipok said:

testing CTRL+J while being focused on variable in line 1255 

Expand  

That is correct because I told you it works differently:

  Quote

Also try the Goto Func change (Ctrl+J)  which now checks for Variable or Other string and will try to find the first "$variable =" definition in the current file or included files.

Expand  

.. as that to me tells you something about the variable. My assumption is that one wants to know which value it is set to in general. 
I understand that Global $XYZ defines the variable but really doesn't tell you what its content is supposed to be.
It obviously also doesn't take scope into account like a Local $XYZ defines in multiple places in the same script.  Not planning to make this something complex like VSC and cover all possibilities. 

Edited by Jos

SciTE4AutoIt3 Full installer Download page   - Beta files       Read before posting     How to post scriptsource   Forum etiquette  Forum Rules 
 
Live for the present,
Dream of the future,
Learn from the past.
  :)

Posted (edited)
  On 3/8/2023 at 1:23 PM, Jos said:

Don't think that should be there....  so what did you do this time to screw it up? ;) 

Expand  

Nothing bad, truly.
I was just testing if this following issue still exist or was fixed.

image.png

When I hit ENTER it put all this log to the SciTE console and also script was suplemented by adding this:

#Region ; *** Dynamically added Include files ***
#include <wd_core.au3>                                       ; added:03/08/23 14:12:39
#EndRegion ; *** Dynamically added Include files ***

at the top of the script.

 

EDIT:

image.png.f041ae2f8c971ea3bb30089aeeb3bd32.png

 

Edited by mLipok

Signature beginning:
Please remember: "AutoIt"..... *  Wondering who uses AutoIt and what it can be used for ? * Forum Rules *
ADO.au3 UDF * POP3.au3 UDF * XML.au3 UDF * IE on Windows 11 * How to ask ChatGPT for AutoIt Codefor other useful stuff click the following button:

  Reveal hidden contents

Signature last update: 2023-04-24

Posted

Should I send you via email  a link to ZIP with my complete testing ENV ?

Signature beginning:
Please remember: "AutoIt"..... *  Wondering who uses AutoIt and what it can be used for ? * Forum Rules *
ADO.au3 UDF * POP3.au3 UDF * XML.au3 UDF * IE on Windows 11 * How to ask ChatGPT for AutoIt Codefor other useful stuff click the following button:

  Reveal hidden contents

Signature last update: 2023-04-24

  • Developers
Posted (edited)

This must be an issue in the function Common:GetScriptName_DateTime() in common.lua...   
Please add that print(curfiledate) line in your version and perform the task again, then save the result from the Console into a file so I have the returned (exact) string and can play with the regex on the next line which seems to fail suddenly in your case:

--------------------------------------------------------------------------------
-- Get Calling Script Name and Filedate
--------------------------------------------------------------------------------
function Common:GetScriptName_DateTime()
    local curfilename = function()
      local str = debug.getinfo(2, "S").source:sub(2)
      return str:match("^.*/(.*).lua$") or str
    end
    ScriptName = curfilename()
    if debug.getinfo(2) and debug.getinfo(2).source then
        ScriptName = (debug.getinfo(2).source:match("^@-([^@]*)$") or debug.getinfo(2)) or ScriptName
    end
    curfiledate=self:perform_oscommand('dir "'..ScriptName..'"')
    print(curfiledate)
    curfiledate = curfiledate:gsub(".*(%d+)[-/](%d+)[-/](%d+)%s+(%d+):(%d+).*","%3%2%1 %4%5")
    return ScriptName:match("%w*%.[lL][uU][aA]"), curfiledate
end

 

Edited by Jos

SciTE4AutoIt3 Full installer Download page   - Beta files       Read before posting     How to post scriptsource   Forum etiquette  Forum Rules 
 
Live for the present,
Dream of the future,
Learn from the past.
  :)

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...