Jump to content

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


Recommended Posts

  • Developers
Posted (edited)

Forget that last question: It seems you changed your Date format which now contains DOTs in stead of - or /

I will make a change to support that too.

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)

Try this version in your common.lua:

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..'"')
    if not curfiledate:match(".*(%d+)[-/.](%d+)[-/.](%d+)%s+(%d+):(%d+).*") then
        curfiledate = "??-??-????"
    else
        curfiledate = curfiledate:gsub(".*(%d+)[-/.](%d+)[-/.](%d+)%s+(%d+):(%d+).*","%3%2%1 %4%5")
    end
    curfiledate = curfiledate:gsub(".*(%d+)[-/](%d+)[-/](%d+)%s+(%d+):(%d+).*","%3%2%1 %4%5")
    return ScriptName:match("%w*%.[lL][uU][aA]"), curfiledate
end

Added some checking so it doesn't return the long string on issues.

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

Will check ASAP

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)
  On 3/8/2023 at 2:20 PM, Jos said:

Try this version in your common.lua:

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..'"')
    if not curfiledate:match(".*(%d+)[-/.](%d+)[-/.](%d+)%s+(%d+):(%d+).*") then
        curfiledate = "??-??-????"
    else
        curfiledate = curfiledate:gsub(".*(%d+)[-/.](%d+)[-/.](%d+)%s+(%d+):(%d+).*","%3%2%1 %4%5")
    end
    curfiledate = curfiledate:gsub(".*(%d+)[-/](%d+)[-/](%d+)%s+(%d+):(%d+).*","%3%2%1 %4%5")
    return ScriptName:match("%w*%.[lL][uU][aA]"), curfiledate
end

Added some checking so it doesn't return the long string on issues.

Expand  

It looks like this did the trick - fixed.

  Quote

>>> AutoItDynamicIncludes switched off for unsaved file.
+ 23:59:07 _WD_GetSession => Add include:<wd_core.au3>
> Added 1 include(s) at top of the script. (v2023038 1404)

Expand  

btw.
What exactly means information in the brackets.

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 10:52 PM, mLipok said:

What exactly means information in the brackets.

Expand  

Should pretty obvious :)    2023038 1404 => 2023/03/8 14:04 => Filedate of the current script.
This is for me a simple way to know which file version is used when issues are reported.

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

Thanks for testing .... I have updated the current Beta Zip with these changes:

  • fix for date retrieval script file
  • Added a little logic to find a variable either on the first line that matches the below in either the master or any Include file:
    • "global.*$XYZ" or "Local.*$XYZ"... so NO Multiline support for this!
    • "$XYZ\s*="

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)

Thanks.
Just downloaded.

Using... testing.... ;)

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)

you know what, a month ago I switched from
my old DELL with INTEL i7 3gen with SSD disk 
to
brand new
DELL with INTEL i5 12gen with SSD NVME disk 

and you know what,

Now I stoped to complaining about speed with new SciTE4AutoIt3

:)

EDIT:
I also finally swithced to new 27'' LED monitor (previously I had 1x24'' and 1x22'', now I have 1x24'' and 1x27'')
And work becames easier.

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

  • Jos changed the title to BETA: SciTE v5x & lua Dynamic_include and "Smart" AutoComplete for Vars/UDFs/Abbrevs
  • Developers
Posted (edited)

 

After a long period of development& alpha testing with a few other members, I moved this thread into the General form and am sharing this Beta with all that want to play with it. See the first page for a detailed description of this project and a link where to get this version:

 

These are the latest updates to the zip file:

  Quote
  • 2023-03-10 13:00
    • Merged SciTE Release 5.3.4 with the SciTE4AutoIt3 sources
    • Added option to jump to the definition of a Variable when Ctrl+J is used with the caret placed with a variable name.
    • Many other small changes... see this thread for details
    • Move the zip into the Beta directory making it for more people available.
    • Move this thread to AutoIt Technical discussions,  so others can participate in testing when they want.
Expand  

@mLipok, I will remove all the links you made to the Alpha as that version is now removed!

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.
  :)

  • Jos locked, unlocked and pinned this topic
Posted (edited)
  On 3/10/2023 at 12:15 PM, Jos said:

@mLipok, I will remove all the links you made to the Alpha as that version is now removed!

Expand  

Thanks.

I just end my review for this thread and removed some additional content, and some other reports to be removed.

 

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 This sounds really great! But it's not entirely working on my system yet.

Following the instructions, I've downloaded the SciTE_changes_Dynamic_Includes.zip file from https://www.autoitscript.com/autoit3/scite/download/beta_SciTE4AutoIt3/SciTE5-with-DynamicFunctions/ and (after making a backup of my C:\Program Files (x86)\AutoIt3\SciTE folder) I copied (with path) all of the files from within the zip to the original SciTE folder, overwriting any existing files.

I'm quite thrilled to see functions within my own script now automatically having the CallTip prompting, so I'm sure the beta is installed.

However, now when I start to type one of the standard UDF's (such as _ArrayDisplay or _WinAPI_...), it doesn't show that function in the autocomplete list. It's not until I get the full function name typed manually and press ( that it will then display the parameter info. Before that it's like the autocomplete list has never heard of any of the standard UDF's. (And I'm not getting any automatic #include's inserted into my script either.)

Also, when I try to type (for example) the line #include <MsgBoxConstants.au3>, the include file name doesn't appear in the autocomplete list.

Prior to installing the beta, all of the standard includes and UDF's were listed in the autocomplete list. The standard UDF include files are installed in the normal place where the AutoIt installer puts them (C:\Program Files (x86)\AutoIt3\Include).

To make sure there was no issue with the user settings interfering with the default settings, I then also removed the 'C:\Users\username\AppData\Local\AutoIt v3\SciTE\SciTEUser.properties' file. No change.

The first post of this thread and and the new docs sound like it's supposed to automatically get the info for the standard UDF's, but it's apparently not. So am I missing a step somewhere?

Edited by TimRude
Posted

the above post plus:

- Found potential duplicate filename issue for File Include: include\ 971 APIComConstants.au3
-                                  which is also located at:  D:\Utilities\AutoIt3BetaSciTE\include\
- Found potential duplicate filename issue for File Include: include\ 1,748 APIConstants.au3
-                                  which is also located at:  D:\Utilities\AutoIt3BetaSciTE\include\

        ... a lot of the same ...
        
- Found potential duplicate filename issue for File Include: include\ 41,845 WinAPITheme.au3
-                                  which is also located at:  D:\Utilities\AutoIt3BetaSciTE\include\
- Found potential duplicate filename issue for File Include: include\ 6,259 WinAPIvkeysConstants.au3
-                                  which is also located at:  D:\Utilities\AutoIt3BetaSciTE\include\
! Skipped 4 possible Include files because we reached the dynamic.max.includes limit of 150
+-> (v2023093 0857) Get_FileINFO time:0.21 lCache:false IncludeFiles:154 UDFs:0    ConstVars:0    Source:D:\Utilities\AutoIt3BetaSciTE\TestThis.au3

... hope this debug/post is useful to you. Thanks for working on this. Looks very handy to have :)

Follow the link to my code contribution ( and other things too ).
FAQ - Please Read Before Posting.
autoit_scripter_blue_userbar.png

  • Developers
Posted (edited)

 

  On 3/12/2023 at 9:46 PM, TimRude said:

However, now when I start to type one of the standard UDF's (such as _ArrayDisplay or _WinAPI_...), it doesn't show that function in the autocomplete list. It's not until I get the full function name typed manually and press ( that it will then display the parameter info. Before that it's like the autocomplete list has never heard of any of the standard UDF's. (And I'm not getting any automatic #include's inserted into my script either.)

Expand  

Just so I understand: You aren't typing an new Func here, but are using an existing Func name which is from a saved file? So when a func is added to the current file, it ill only be available after you saved the current file.

  On 3/12/2023 at 9:46 PM, TimRude said:

But it's not entirely working on my system yet.

Expand  

When something isn't working as expected then please do these steps and share the logfile as only I can see what is happening:

  1. Open SciTEUser config and add this section:
    • ## ================================================
      ## Separate settings for debugging these Lua files
      ## ================================================
      #> Enable debugging for these lua scripts:
      debug.autoitdynamicincludes=n
      debug.autoitautocomplete=n
      debug.autoitgotodefinition=n
      debug.autoitindentfix=n
      debug.autoittools=n
      #> when debug.tofile is defined, log records will be send to the log in stead of OutputPane:
      debug.tofile=$(SciteUserHome)\SciTE_LUA_Scripts_Debug.err
  2. Change debug.autoitdynamicincludes=y
  3. Perform the task
  4. Zip $(SciteUserHome)\SciTE_LUA_Scripts_Debug.err and PM/Email it to me.

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.
  :)

  • Developers
Posted
  On 3/13/2023 at 12:02 AM, argumentum said:

the above post plus:

Expand  

Not sure what you would expect to do with duplicate include filenames? How would this function need to determine which one is value?

 

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

the root is "D:\Utilities\AutoIt3BetaSciTE", the "\Include" subfolder is the only one hence could not have duplicates, so it may be reading more than once from the same folder or maybe from elsewhere. Do know that is a portable setup and not the only AutoIt in the PC nor the prevalent, meaning that the registry keys will point to the other installed AutoIt ( with it's own SciTE ). Since SciTE always worked based on a folder structure, I have multiple versions of AutoIt w/SciTE without a problem. But maybe there's a way around my un-standard setup.

Follow the link to my code contribution ( and other things too ).
FAQ - Please Read Before Posting.
autoit_scripter_blue_userbar.png

  • Developers
Posted (edited)

Ha ok...   so you say that these 2 directories are the same in this case?:

  Quote



- Found potential duplicate filename issue for File Include: include\ 971 APIComConstants.au3
-                                  which is also located at:  D:\Utilities\AutoIt3BetaSciTE\include\
Expand  

Could you do me a favor and generate the log $(SciteUserHome)\SciTE_LUA_Scripts_Debug.err and PM/Email a zipped version it to me? (As described a few posts back)

 

ps:

  On 3/13/2023 at 1:45 PM, argumentum said:

Do know that is a portable setup and not the only AutoIt in the PC nor the prevalent, meaning that the registry keys will point to the other installed AutoIt ( with it's own SciTE ).

Expand  

There shouldn't be any registry definitions when you run portable as those will always be used by AutoIt3 & utilities when existing.

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)

I think I found a bug with syntax coloring:

image.png.290127d7f7e79bb2618e2be1091cae38.png

I think both test String  should be treated as comments.

#cs
test String
#CE

#comments-start
test String
#comments-end

 

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
  On 3/14/2023 at 1:26 PM, mLipok said:

I think both test String  should be treated as comments.

Expand  

correct...   this seems to be a regression from the last applied fix for something else. Should be fixed in the latest beta zip.

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

Looks like the issue is fixed now.
Thanks.

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

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...