Jump to content

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


Recommended Posts

Posted (edited)

Hi Jos, I was wondering if you would have any objections to making a minor modification to AutoItAutoComplete.lua, line 667 (roughly) (Also not sure if the other locations need it too or not) from this:

-- Show Calltips for functions
            if editor.StyleAt[editor.CurrentPos - 2] == SCE_AU3_FUNCTION
                or (editor.StyleAt[editor.CurrentPos - 2] >= SCE_AU3_UDF and editor.StyleAt[editor.CurrentPos - 2] <= SCE_AU3_FILEUDF) then
                    scite.MenuCommand(IDM_SHOWCALLTIP) -- Show ToolTip for Functions
            end

To This:

-- Show Calltips for functions
            if editor.StyleAt[editor.CurrentPos - 2] == SCE_AU3_FUNCTION
                or (editor.StyleAt[editor.CurrentPos - 2] >= SCE_AU3_UDF and editor.StyleAt[editor.CurrentPos - 2] <= SCE_AU3_FILEUDF) then
                    if editor:CallTipActive() then editor:CallTipCancel() end
                    scite.MenuCommand(IDM_SHOWCALLTIP) -- Show ToolTip for Functions
            end

I have been trying to figure out an annoying problem I was running into, namely the following was occurring, only after calling a function in another function's first param,

[snip]

With my modification, it seems to be fixed,

[snip]

Thank you.

Edited by donnyh13

LibreOffice UDF  ; Scite4AutoIt Spell-Checker Using LibreOffice

  Reveal hidden contents

 

  • Developers
Posted

So you are pressing Ctrl+Shift+Space to activate the Show Calltip manually while typing StringInstr in that example as normally it would show the AutoComplete dropdown and show the proper Calltip op completion?

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)

Sorry I see my first post wasn't written clearly.

If I understand what you are asking, both examples I had just finished an auto-complete selection using enter for StringInStr to activate the Call tip. The lower example of course is with my proposed change. The upper one is the original version.

Edited by donnyh13

LibreOffice UDF  ; Scite4AutoIt Spell-Checker Using LibreOffice

  Reveal hidden contents

 

  • Developers
Posted
  On 12/31/2023 at 12:17 PM, donnyh13 said:

If I understand what you are asking

Expand  

What I guess I am saying is that I do not see the issue you report, so try to first figure out what steps to take to get this "wrong" calltip.
The only way I was able to get it to go wrong is to force the calltip of ConsoleWrite before typing the ( after the StringInstr.  

So: Which what do I need to do to see your reported 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 (edited)
  On 12/31/2023 at 1:01 PM, Jos said:

what do I need to do to see your reported issue?

Expand  

Okay, sorry about the misunderstanding.

So how I keep running into the problem is: (to re-use my previous example)

  • I type consolew, press enter to accept the auto complete for that function.
  • Autocomplete inserts ConsoleWrite( and call tip is activated for ConsoleWrite (and remains active)
  • Now I type StringInS and press enter for that AutoComplete
  • AutoComplete Fills in StringInStr( Call tip flashes but remains the same CallTip for ConsoleWrite instead of StringinStr.

In case it makes a difference, for user settings I have:

dynamic.include.always.update.local.file=y

autocomplete.au3.on.enter=   (Blank)

autocomplete.multi=1

proper.case=1

autocomplete.au3.ignorecase=1

autocomplete.au3.min.length=2

Edited by donnyh13

LibreOffice UDF  ; Scite4AutoIt Spell-Checker Using LibreOffice

  Reveal hidden contents

 

Posted (edited)

..... Maybe I'll try reinstalling everything...

Edited by donnyh13

LibreOffice UDF  ; Scite4AutoIt Spell-Checker Using LibreOffice

  Reveal hidden contents

 

Posted

Okay. Clean Install, Works correctly... Ill see what seems to have caused it.

LibreOffice UDF  ; Scite4AutoIt Spell-Checker Using LibreOffice

  Reveal hidden contents

 

Posted (edited)

Okay. I seem to have missed an update for AutoItAutoComplete somewhere. The file I had was the problem?? Sorry about that.

Edited by donnyh13

LibreOffice UDF  ; Scite4AutoIt Spell-Checker Using LibreOffice

  Reveal hidden contents

 

Posted (edited)

Hi Jos, I see AutoComplete for Includes seems to be missing (and removing) the beginning Quotation mark.

[snip]

Edit, actually it seems to be how it is stored in the Tables?

Edited by donnyh13

LibreOffice UDF  ; Scite4AutoIt Spell-Checker Using LibreOffice

  Reveal hidden contents

 

  • Developers
Posted (edited)
  On 12/31/2023 at 11:36 PM, donnyh13 said:

Edit, actually it seems to be how it is stored in the Tables?

Expand  

Correct, as the start , ' or < is there already is this what is being inserted.....   but I see that < is still working but ' & " is causing issues. 
Will have a look later..

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

Could you change line 594 in AutoItAutoComplete.lua to :

editor.WordChars = swordchars .. '-'

and try again?  Not sure anymore why I also added '"> in there as well, but that obviously is the culprit. 

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 1/1/2024 at 11:55 AM, Jos said:

that obviously is the culprit

Expand  

That fixed it. Thanks Jos!

LibreOffice UDF  ; Scite4AutoIt Spell-Checker Using LibreOffice

  Reveal hidden contents

 

Posted

Hi Jos,

I have a largish feature request. I’m not sure if it’s only something I am seeing a need of or not, but thought I would throw it out here and see what you thought. In developing the LibreOffice UDF, I frequently need to use internal Functions that are, of course, in a separate file, and frequently not used already in the present file. Would it be possible to add something like you did for the Dynamic Includes where I could manually include internal functions from a separate file?

Something like: #SciTE4AutoIt3_Dynamic_Include_Internal_Func_Path=;C:\folder\etc.au3

I am mainly looking for it to be included in the AutoComplete, and have CallTips available for it also.

Not sure if there would be much need for that feature or not?

LibreOffice UDF  ; Scite4AutoIt Spell-Checker Using LibreOffice

  Reveal hidden contents

 

  • Developers
Posted

Not sure I understand what you are looking for: 
Are you looking for the functionality to copy the function over into the script you are working on or simply for your own standard includes ( which are currently supportedd already in AutoIt3) ?

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 1/3/2024 at 4:30 PM, Jos said:

Not sure I understand what you are looking for: 

Expand  

Sorry, I'll try again. 

Right now your Dynamic Include script searches my current script, opens any includes that I have at the top, and records all functions in those files to a table, so that they are both available in the AutoComplete suggestions and have a CallTip when used.

However currently, and understandably, your script skips any functions that are for Internal use only ("__Func"). What I am hoping for was a way to add the internal functions found in a specific file also to the AutoComplete Table etc., so I don't have to switch, in my case, to my Internal functions au3 file, copy the function name and parameter layout, switch back to my current script I am working on, and paste it there so I can use that internal function in another script. i.e.

UDF_Func.au3

#include "Internal_Funcs.au3"

Func _Func_For_User($vSomeParam)



EndFunc

 

Internal_Funcs.au3

#include-once

Func _MyPublic_Func()

EndFunc

Func __MyInternal_Func($vParam)

EndFunc

I am working on the file "UDF_Func.au3", I want to use the function _MyPublic_Func(), I start typing, the AutoComplete pops down and lists that function.

But what if I want to use the function __MyInternal_Func() ? I have to switch to "Internal_Funcs.au3" and copy the name and syntax myself if I've never used it in "UDF_Func.au3" before.

What I want is to be able to specify that I want both public and internal functions in "Internal_Funcs.au3" to be included in the AutoComplete, etc., table(s), and CallTip api file.

LibreOffice UDF  ; Scite4AutoIt Spell-Checker Using LibreOffice

  Reveal hidden contents

 

  • Developers
Posted

Ah ok, so you like to use any __* func from any possible include file listed, while the whole idea of using the __* naming for it to be used only in the specific file itself? 🙂 

Why not simply rename it so it will appear? 
 

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 1/3/2024 at 5:24 PM, Jos said:

Why not simply rename it so it will appear?

Expand  

I could... but in my case, the internal funcs are internal to the UDF, and not meant for users using the UDF. But the UDF has multiple subdivisions, such as Table, ParStyle, etc that use the same "Internal" functions such as "IntIsBetween". Which the user has no use for.

Edit*

But I do see your point. Thank you.

Edited by donnyh13

LibreOffice UDF  ; Scite4AutoIt Spell-Checker Using LibreOffice

  Reveal hidden contents

 

Posted
  On 1/3/2024 at 5:24 PM, Jos said:

any possible include file listed

Expand  

Not exactly any include, just a specific one, because otherwise, the AutoComplete list would get over populated.

LibreOffice UDF  ; Scite4AutoIt Spell-Checker Using LibreOffice

  Reveal hidden contents

 

Posted (edited)

I can see that this would be handy.

@donnyh13 is talking about:
https://github.com/mlipok/Au3LibreOffice/blob/main/LibreOfficeCalc_Internal.au3

I would like to add something like this:

  Quote

#SciTE4AutoIt3_Dynamic_Include_AutoComplete_Internal=y      ;dynamic.include.autocomplete.internal=n/y

Expand  

or even better something like:

  Quote

#SciTE4AutoIt3_AutoItAutocomplete_Internal=__LOCalc_*

Expand  

to all files below:

  Quote

LibreOfficeWriter_Table.au3
LibreOfficeWriter_Shapes.au3
LibreOfficeWriter_Par.au3
LibreOfficeWriter_Page.au3
LibreOfficeWriter_Num.au3
LibreOfficeWriter_Internal.au3
LibreOfficeWriter_Images.au3
LibreOfficeWriter_Helper.au3
LibreOfficeWriter_Frame.au3
LibreOfficeWriter_Font.au3
LibreOfficeWriter_FootEndNotes.au3
LibreOfficeWriter_Field.au3
LibreOfficeWriter_Doc.au3
LibreOfficeWriter_DirectFormating.au3
LibreOfficeWriter_Cursor.au3
LibreOfficeWriter_Char.au3
LibreOfficeWriter_Constants.au3
LibreOfficeWriter_Cell.au3
LibreOfficeCalc_Sheet.au3
LibreOfficeCalc_Internal.au3
LibreOfficeCalc_Doc.au3
LibreOfficeCalc_Helper.au3
LibreOfficeCalc_Constants.au3
LibreOfficeCalc_Cell.au3

Expand  

 

btw.
I had a similar situation a few days ago, luckily in my case it was enough to change the name of the function, because it was actually not "Internal"

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

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