Jump to content

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


Recommended Posts

Posted (edited)
  On 4/13/2023 at 9:03 AM, Jos said:

That is the case already when you have the local cache enabled, but lets agree that 30 seconds is simply wrong and should never happen, not even one time at save!
All my tests so far have shown that there is nothing to gain to enable the cache for local files. 

Expand  

As I understand you are talking about caching locally caltips/AutoComplete features which is used while typing the function name, variable name, abbreviations.
But when I hit ENTER key then all includes are checked recursivly, and if I'm right it is done dynamically as used include tree is not stored in any cache.
Let me know if I'm wrong.

  On 4/13/2023 at 9:03 AM, Jos said:

There has to something wrong in the logic of the LUA scripts for your well known big ass setup that I haven't encountered yet, so hope your last zip will also show the problem to me and I am able to squash that bug. :) 

Expand  

I hope so.
Thus I keep waiting for you diagnosis.

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 just hit new issue.
After typing

MsgBox($MB_TOPMOST, @ScriptLineNumber)

image.png.7471c4c6c048ed6c69cc19031fcaf241.png

and when I press ENTER key, all subsequent lines change colors.

image.png.6f982eab321f8f4f3c3d24c86fe6fa8b.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)

Also I start wondering if it is possible to differentiating the LUA action related to pressing the ENTER key

in case when currsor is on line that has been changed

image.png.d1d707ccd3f31545a89c239ab4515f44.png

from case when the cursor is on a line that has not been changed

image.png.9f4949ef5725206781f4e5f3b6c3eab2.png

 

I mean only pressing ENTER key on changed line, should fire recursive include check.

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

Another feature request is to not fire recursive check when currsor is at the beginning of the line:

image.png.080b7ebe2b93a3c346227eeba31257aa.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 4/14/2023 at 12:02 PM, mLipok said:

and when I press ENTER key, all subsequent lines change colors.

Expand  

Will have a look at that.

 

  On 4/14/2023 at 12:26 PM, mLipok said:

from case when the cursor is on a line that has not been changed

Expand  

Don't think I want to make things even more complex than they are, but have no issue to make the "Check for includes for the whole line" optional with a Directive/Propery.

  On 4/14/2023 at 12:32 PM, mLipok said:

Another feature request is to not fire recursive check when currsor is at the beginning of the line:

Expand  

Same answer as the previous one: Seems you have issues with the Enter doing the Check for includes. Why exacly? Time it takes on your setup as you know it is only 0.2secs for me so am not too worried making the logic even more complex than it is already.

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 4/14/2023 at 11:48 PM, Danp2 said:

Small typo in AutoHScroll.lua -- Witdh >> Width 😃

Expand  

Thanks :) 

  On 4/14/2023 at 11:48 PM, Danp2 said:

Also get the following in the console when launching Scite,

Expand  

Sounds like you trying to run the scripts on an older version of SciTE in stead of v5.2.5?

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

  • 2 months later...
  • Developers
Posted (edited)

Could you remove the cache files in C:\Users\U\AppData\Local\AutoIt v3\SciTE\ as it seems they are not correct, so they will be rebuild?

Also don't see any autocomplete debug info in the log. Did you enable it?

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

  • 1 month later...
Posted (edited)

I found that the issue is the localization of the Windows date, specifically setting the regional formate "Date (short)" to include the current month as a string

causes

Common:GetScriptName_DateTime()

in Common.lua to fail, because the regex is unable to extract the date from curfiledate, which contains this string in my case:

Datentr„ger in Laufwerk C: ist Win10 M.2
 Volumeseriennummer: B455-4E47

 Verzeichnis von C:\Program Files (x86)\AutoIt3\SciTE\Lua

09. Apr. 2023  15:01           111.448 AutoItDynamicIncludes.lua
               1 Datei(en),        111.448 Bytes
               0 Verzeichnis(se), 37.802.168.320 Bytes frei

EDIT: Actually, upon further investigation, all uses of the dir command cause such issues, the match expressions which parse the output into the ifdate, iftime, ifsize, includefile variables in AutoitDynamicIncludes.lua would need some tweaking to allow for more date formats. I think they are just compared as strings so doing that wouldn't be an issue.

Currently they contain this for me:

ifdate=08.
iftime=Mrz.
ifsize=2022
includefile=19:42             1.748 APIConstants.au3

which is why I think includefile never gets read

Edited by paw
  • Developers
Posted (edited)

Does it work when you change the regex from:

irec:match('^%s-([^%s]*)%s+([^%s+]*%s?[aApP]?[mM]?)%s+([^%s]*)%s+(.*%.au3)')

to 

irec:match('^%s-(.-)%s*(%d%d:%d%d*%s?[aApP]?[mM]?)%s+([^%s]*)%s+(.*%.au3)')

on the 3 places it exists?

 

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

  • 5 weeks later...
Posted (edited)

Hi Jos!

I want to first say, thank you very much for this very handy addition! I look forward to this added functionality for sure!

Now for the bad news — I have attempted to try this beta, but have ran into some display problems.  Is there known limitations for Windows 7?

I have downloaded the following files, from https://www.autoitscript.com/autoit3/scite/download/beta_SciTE4AutoIt3/SciTE5-with-DynamicFunctions/

SciTE4AutoIt3.exe;
SciTE_changes_Dynamic_Includes_LUA.zip;
SciTEx86.zip

I uninstalled everything, Autoit and Scite, deleted the AutoIt folder in ProgramFiles 86, and in the Local folder. Reinstalled Autoit 3.3.16.1, and installed the SciTE4AutoIt3.exe file, then replaced the files in ProgramFiles 86\Autoit\Scite\Lua with the files in SciTE_changes_Dynamic_Includes_LUA.zip, and also replaced the files in ProgramFiles 86\Autoit\Scite with the ones in SciTEx86.zip. (I also tried x64)

Upon opening Scite I get 3(?) CMD windows popup then disappear on start up and also at each Tab switch (not a problem, but noticed another user reporting the issue on Page 2)

But upon opening a pre-existing script, I get a display error where a certain line is displayed for the entire viewpane. If I move my cursor to the spot with clicking or down arrow etc, that particular line displays correctly.

As I scroll, the displayed line changes.

If I move the cursor to the last line, this is what an empty script looks like: (Note the entire viewpane turns yellow.

[snip]

If I type a function there,

[snip]

Here is the script using Scite Ver. 4.4.6

[snip]

Same Script, Scite, 5.3.5

[snip]

I Have a Windows 7 64bit, 4GB Ram (Max possible), Intel Pentium E5800 3.2.0GHz, Intel G41, E2041 Express chipset which has been known to have display issues for certain graphic applications, but I wouldn't think for Autoit?? In looking at the error log with all debug options active, I see no errors during this problem??

Let me know if you need more info.

Donny

EDIT*

Just a further note. I found that when the lines are shown as duplicated, the line that is one below the last visible line is the one displayed, or the last visible numbered line, which ever comes first. For Example, in pictures 1 & 2, the line shown duplicated would be located on line 33.

Edited by donnyh13

LibreOffice UDF  ; Scite4AutoIt Spell-Checker Using LibreOffice

  Reveal hidden contents

 

Posted (edited)

Just an update, though perhaps not a very useful one, but I downloaded Scite executable, 5.3.7 from

https://www.scintilla.org/SciTEDownload.html

and ran the Scite program, and just typed a few lines, ...I don't seem to have any of these display issues on there? Not sure if that helps any or not, as I know the one that comes with AutoIt3 is a customized version.

EDIT*

I have further tested, perhaps this is useless to say, but... I reverted to Scite 4.4.6 installation, and copied over the files: SciTE.exe, Scintilla.dll, Lexilla.dll,  from the Scite 5.3.5 installation. The problem still persists. I also tried copying Scintilla.dll, Lexilla.dll, from the plain Scite installation from Neil, and the problem persists. It seems what ever is changed in Scite.exe (Autoit Version??) between 4.4.6 and 5.3.5 is to blame.

Edit:

Fixed via this thread:

 

Edited by donnyh13

LibreOffice UDF  ; Scite4AutoIt Spell-Checker Using LibreOffice

  Reveal hidden contents

 

Posted (edited)

Hi Jos, I ran across an error message, and I'm not sure if it's a problem or no? Perhaps not.

If I type the following in a saved script (It wont do it when the script has never been saved to a destination, of course.)

Local $sPageStyle

IsString($sPageStyle)

After I press the ")" in IsString, I get this message,

  Quote

\AutoIt3\SciTE\Lua\AutoItAutoComplete.lua:724: invalid pattern capture

Expand  

Isn't that the wrong bracket to be triggering AutoComplete?

Also, as is MLipok, I have noticed after inserting a function, the lines below turn to a different colour, even pressing enter below certain ones, perhaps Standard UDFs (ArrayDisplay) even does it, and pressing backspace above the function fixes it. Also while this is occurring, if I insert a variable anywhere in the coloured text, when I press enter to accept the auto complete suggestion the variable is inserted and appended with a "(". If I switch tabs the colour goes back to normal.

Here is the error log after I switch to the script and press enter one line below _ArrayDisplay

[snip]

Edited by donnyh13

LibreOffice UDF  ; Scite4AutoIt Spell-Checker Using LibreOffice

  Reveal hidden contents

 

Posted (edited)

Hi Jos, sorry for another post, but I have a feature request, if it's possible. When I have included a file that is in another location, say such as:

#include "C:\Autoit Scripts\LibreOfficeWriter.au3"

When I use a function out of this UDF the UDF file is still dynamically included -- incorrectly -- like this:

#include <LibreOfficeWriter.au3>

 Is it possible to check "Path" includes also for the required file, before dynamically adding the include? Unless I'm doing something wrong? I have recursive.check set to yes.

Thanks,

Donny

Edited by donnyh13

LibreOffice UDF  ; Scite4AutoIt Spell-Checker Using LibreOffice

  Reveal hidden contents

 

  • Developers
Posted
  On 9/14/2023 at 10:32 PM, donnyh13 said:

After I press the ")" in IsString, I get this message, \AutoIt3\SciTE\Lua\AutoItAutoComplete.lua:724: invalid pattern capture

Expand  

I get that too so will have a look why.   tnx for reporting. 

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 9/15/2023 at 12:24 AM, donnyh13 said:

#include "C:\Autoit Scripts\LibreOfficeWriter.au3"

When I use a function out of this UDF the UDF file is still dynamically included -- incorrectly -- like this:

#include <LibreOfficeWriter.au3>     

Expand  

Not sure I understand the total case here: That include in not available in the standard defined include paths? 
It would be helpful to provide the log with debugging enabled so I can exactly see what is happening in these kind of cases. 

  On 9/15/2023 at 12:24 AM, donnyh13 said:

Is it possible to check "Path" includes also for the required file, before dynamically adding the include?

Expand  

Not sure what you mean exactly here.....   the \include subdirectory is considered already a a standard place to look for includes.
Please elaborate. :) 

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 9/15/2023 at 12:51 PM, Jos said:

Not sure I understand the total case here: That include in not available in the standard defined include paths? 
It would be helpful to provide the log with debugging enabled so I can exactly see what is happening in these kind of cases. 

Not sure what you mean exactly here.....   the \include subdirectory is considered already a a standard place to look for includes.
Please elaborate. :) 

Expand  

Okay, sorry.

What I'm meaning is, I have a User Created UDF, it is located in "C:\Autoit Scripts\Autoit\Libre Writer UDF files\LibreOfficeWriter.au3", I have another script open where I am using some of these functions out of my UDF (LibreOfficeWriter.au3), At the top of my script I already have this line:

#include "C:\Autoit Scripts\Autoit\Libre Writer UDF files\LibreOfficeWriter.au3"

However when I insert a function out of my UDF, say _LOWriter_DocCreateTextCursor, and press enter, Scite attempts to include the necessary Includes for the function, instead of recognizing I already included that UDF, Scite automatically inserts this line:

#include <LibreOfficeWriter.au3>

Which is not necessary, nor correct as the UDF is not in the includes directory.

My request is, can Scite check all include types that I have already inserted in my script, both standard include folder type #Include <> and the relative path type  #Include " "  before it automatically inserts an include? Otherwise I have to keep deleting the include it adds, as it is not correct and causes an error when running the script

  Quote

(!->Includefile <LibreOfficeWriter.au3> not found.)

Expand  

 I will include the error log.

  On 9/15/2023 at 12:44 PM, Jos said:

I get that too so will have a look why.   tnx for reporting.

Expand  

Welcome, I noticed one more thing, when declaring or using an array, or perhaps a map too, after typing the name and pressing "[" I get the following error after each "$aArray[".

Local $aArray[1] = [1]

Isint($aArray[0])
  Quote

\AutoIt3\SciTE\Lua\AutoItAutoComplete.lua:733: malformed pattern (missing ']')

Expand  
Edited by donnyh13

LibreOffice UDF  ; Scite4AutoIt Spell-Checker Using LibreOffice

  Reveal hidden contents

 

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