Jump to content

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


Recommended Posts

  • Developers
Posted
  On 12/24/2023 at 8:39 PM, jaberwacky said:

Sorry, I'm kind of confused by all that needs to be updated, and there's way too much going on this thread for me to keep up.

Expand  

Updated the initial post with a link to the latest updated SciTE4AutoIt3 beta installer and portable zip file. These contain all the current/latest versions so no need for other stuff after the update. Don't forget to make a Backup first to ensure there is an easy rollback in case of issues. :) 

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 start testing speed issue on my DEV ENV with this small changes in:

function AutoItGotoDefinition:GotoDefinition(version)
 

	-- Set up variables we'll be using throughout.
	local current = props['FilePath']
	local found = false
	-- First we check to see if the original file contains the function.
	if self:FindShow_Variable_Func_Definition(func, current, searchvar) then
		found = true
	else
		-- The original file doesn't contain the function.
		local directories = self:GetDirectories(version)
		local includes = self:GetIncludes(current)
		-- Iterate over the list of includes
		for k, v in self:NextInclude(includes) do
print('current = ' .. current)
print('k = ' .. k)

 

I get:

  Quote

current = Z:\AutoItPortable\App\include\Z:\AutoItPortable\App\include\Clipboard.au3
k = Z:\AutoItPortable\App\include\GDIPlus.au3

Expand  

Is this proper result for current value ?

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)

I mean why the path is invalid in the meaning of expected/standard path usage ?
Do you parse them internally ?

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)

So yes ofcourse that is wrong but I don't know yet why and need, as always, a detailed debug log or a replicator script as my crystal ball is still not returned from the workshop. :) 

With my test scripts this isn't happening, so need to understand what is in the source.

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)

Adding this to the LUA code should give a better debuglog:

-- ==============================================
    -- Set up variables we'll be using throughout.
    local current = props['FilePath']
    local found = false
    -- First we check to see if the original file contains the function.
    if self:FindShow_Variable_Func_Definition(func, current, searchvar) then
        found = true
    else
        -- The original file doesn't contain the function.
        local directories = self:GetDirectories(version)
        local includes = self:GetIncludes(current)
        -- Iterate over the list of includes
        for k, v in self:NextInclude(includes) do
            -- If we've already processed a file, we skip it.  This presents a
            -- problem if there are 2 identicaly named files on the search path
            -- and both are in use in the current script.  This is extremely
            -- unlikely, however.
            if not v.Processed then
                v.Processed = true
                -- Define variables to control the for loop direction.
                local start, stop, step
                if v.IsLibrary then
                    start = 1
                    stop = #directories
                    step = 1
                else
                    start = #directories
                    stop = 1
                    step = -1
                end
                -- Loop through the directories in the specified direction.
                for i = start, stop, step do
                    current = directories[i] .. k
                    if self:FileExists(current) then
                        self:DebugPrint('+Scanning: ' .. current)
                        -- Find&show
                        if self:FindShow_Variable_Func_Definition(func, current, searchvar) then
                            found = true
                            break
                        else
                            -- We didn't find the function, get the includes in
                            -- this file and continue searching.
                            includes = self:GetIncludes(current, includes)
                        end
                    else
                        self:DebugPrint('!!! current not exists: directories[i]=' .. directories[i] .. '  k=' .. k .. '  current=' .. current)
                    end
                end
            end
            -- If we found the function, we need to stop looking.
            if found then
                break
            end
        end
    end

    -- The function wasn't found.

 Add directive to your code:

#SciTE4AutoIt3_AutoItGotoDefinition_debug=y

test the goto UDF and have a look at SciTE_LUA_Scripts_Debug.err.

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 12/28/2023 at 12:23 PM, Jos said:

So yes ofcourse that is wrong but I don't know yet why and need, as always, a detailed debug log or a replicator script as my crystal ball is still not returned from the workshop. :) 

With my test scripts this isn't happening, so need to understand what is in the source.

Expand  

email sent 

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

Thanks for the zip file. Please try the uploaded AutoItGotoDefinition.lua to see if that makes any difference.

Add directive to your code:

#SciTE4AutoIt3_AutoItGotoDefinition_debug=y

test the goto UDF and have a look at SciTE_LUA_Scripts_Debug.err for the details and send that to me in case there is still an issue. :) 

 

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

It looks like it is now fixed.
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

Posted (edited)

I notice that  function AutoItGotoDefinition:GotoDefinition(version) checks all UDF files (per each time user wana jump to a function)


I thought it was using previously defined arrays, stored in: .Dyn_UDFs_Z_AutoItPortable_App_include.tbl
 

Additionally, I was surprised that, for example, when looking for a function, the program checks a given UDF name whether it exists in several locations:

  Quote

current = Z:\AutoItPortable\App\include\GDIPlus.au3
current = Z:\!!!_SVN_AU3\PROGRAMY\KK_PDNKW\GDIPlus.au3
current = GDIPlus.au3

Expand  

 

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
  On 12/28/2023 at 10:09 PM, mLipok said:

I notice that  function AutoItGotoDefinition:GotoDefinition(version) checks all UDF files (per each time user wana jump to a function)

I thought it was using previously defined arrays, stored in: .Dyn_UDFs_Z_AutoItPortable_App_include.tbl

Expand  

Have you considered making this function use these previously defined arrays?

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

Or even easier (hope so)
Why function AutoItGotoDefinition:GotoDefinition(version) does not use predefined paths stored in: au3.file.dynamic.calltips.api ?

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

GotoDefinition has nothing to do with defined UDF's in possible include files, but rather requires the udf already being included in one of the nested included files.
 

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

Well ...  I suddenly remembered we had this sort of discussion before earlier this year and I did make some changed to try and use the Dynamic tables when activated.
...so had a look at the code and it indeed is in there but there were still some quirks in it to make it fail. 
Try the latest uploaded version of  AutoItGotoDefinition.lua to see if that makes any difference.

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

Thanks.
I will take a look ASAP

At night I was investigating and I did some change, as I notice that many times current == k so I was curiouse if I can omnit to check again the same file

for i = start, stop, step do
    if (current == k) then 
        goto continue123
    elseif self:FileExists(k) then
        current = k
    else
        current = directories[i] .. k
    end
    if self:FileExists(current) then
        self:DebugPrint('+Scanning: ' .. current)
        -- Find&show
        if self:FindShow_Variable_Func_Definition(func, current, searchvar) then
            found = true
            break
        else
            -- We didn't find the function, get the includes in
            -- this file and continue searching.
            includes = self:GetIncludes(current, includes)
        end
    else
        self:DebugPrint('-Skip Dir not exist: directories[i]=' .. directories[i] .. '  k=' .. k)
    end
    ::continue123::
end

 

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

Your current version did the trick .. now is super fast ...
but not at start which seems normal considering that the dynamic file table files have yet to be created

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)

I did some test

  • closed:        SciTE.exe
  • delete:        au3.file.dynamic.* 
  • delete:        .Dyn_*_include.tbl
  • run:             SciTE.exe (which create au3.file.dynamic.calltips.api)
  • copy:           au3.file.dynamic.calltips.api > au3.file.dynamic.calltips — kopia.api
  • save:           opened script (which probably update au3.file.dynamic.calltips.api)
  • jump:          to some function (which probably update au3.file.dynamic.calltips.api)
  • compare:   au3.file.dynamic.calltips.api <> au3.file.dynamic.calltips — kopia.api

I notice that:

  Quote

AccVars_Init () FileUDF (requires: #include 'z:\!!!_SVN_AU3\UDF_Forum\Other_Members\UIA_AccVars.au3')

Expand  

changed to:

  Quote

AccVars_Init () ..FileUDF-r (requires: #include 'z:\!!!_SVN_AU3\UDF_Forum\Other_Members\UIA_AccVars.au3')

Expand  

 

and:

  Quote

DemoActions () ..FileUDF-a (requires: #include 'Z:\!!!_SVN_AU3\UDF_Forum\Other_Members\Official_AutoIt_Forum\WebDriver\wd_demo.au3')

Expand  

changed to:
 

  Quote

DummyFunction () ..FileUDF-r (requires: #include 'z:\!!!_SVN_AU3\UDF_Forum\Other_Members\_GUIRegisterMsgEx.au3')

Expand  

 

my question is:
Why they differs with: FileUDF / FileUDF-a / FileUDF-r ?

Also:
FileUDF-a and FileUDF-r  has additionall dots in comparition to FileUDF

FileUDF / ..FileUDF-a / ..FileUDF-r

image.thumb.png.cc52a4f46083ee8ba2c85dd6834216c2.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 (edited)
  On 12/29/2023 at 10:57 AM, mLipok said:

I did some test

  • closed:        SciTE.exe
  • delete:        au3.file.dynamic.* 
  • delete:        .Dyn_*_include.tbl
  • run:             SciTE.exe (which create au3.file.dynamic.calltips.api)
  • copy:           au3.file.dynamic.calltips.api > au3.file.dynamic.calltips — kopia.api
  • save:           opened script (which probably update au3.file.dynamic.calltips.api)
  • jump:          to some function (which probably update au3.file.dynamic.calltips.api)
  • compare:   au3.file.dynamic.calltips.api <> au3.file.dynamic.calltips — kopia.api

I notice that:

Expand  

First jump to some function was slow I think probably because au3.file.dynamic.calltips.api was updated which took more extra time.

Question:
Why opening SciTE and saving the document did not immediately create a complete au3.file.dynamic.calltips.api  file ?

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)
  On 12/29/2023 at 10:12 AM, Jos said:

I did make some changed to try and use the Dynamic tables when activated.

Expand  

I want to be sure, so please confirm:
Is it related to .SciTE_Dynamic_fileUDFs.tbl located in scirpt dir ?

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

Nope... I made several changes to make it work properly, but there where logic issues. Not sure whether it will now also find udfs which Arent really included yet, which is something i do not really want, so will test that.

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