Jump to content

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


Recommended Posts

Posted
  On 1/11/2024 at 8:48 AM, Jos said:

Just check any/all your cache tables related to this include for the UDF

Expand  

I had the same issue as @donnyh13 
And after I delete all the *dyn*.tbl files the issue is gone.
Thanks @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)

Thanks @Jos and @mLipok, but I actually already tried deleting every tbl file that was present. Same problem.  I have just tried deleting both scite folders and reinstalling. Same problem. But I found at least the steps to re-create it now.

Calling FormFill from a separate script with WinHTTP only as an include, displays correctly:

2.thumb.png.febb5caa7b5043f9d8f2079f67300784.png

Calling FormFill while in WinHTTP script itself (which I was doing for testing) displays with the underscores. Perhaps I misunderstood when/where the underscores were to be removed?

1.thumb.png.f106e01d193b10280331f15def5f3e9c.png

And this entry in au3.file.dynamic.calltips.api

_WinHttpSimpleFormFill (ByRef $hInternet, $sActionPage=Default, $sFormId=Default, $sFldId1=Default, $sDta1=Default, $sFldId2=Default, $sDta2=Default, \n   $sFldId3=Default, $sDta3=Default, $sFldId4=Default, $sDta4=Default, $sFldId5=Default, $sDta5=Default, $sFldId6=Default, $sDta6=Default, $sFldId7=Default, \n   $sDta7=Default, $sFldId8=Default, $sDta8=Default, $sFldId9=Default, $sDta9=Default, $sFldId10=Default, $sDta10=Default, _$sFldId11=Default, $sDta11=Default, \n   $sFldId12=Default, $sDta12=Default, $sFldId13=Default, $sDta13=Default, $sFldId14=Default, $sDta14=Default, $sFldId15=Default, $sDta15=Default, \n   $sFldId16=Default, $sDta16=Default, $sFldId17=Default, $sDta17=Default, $sFldId18=Default, $sDta18=Default, $sFldId19=Default, $sDta19=Default, \n   $sFldId20=Default, $sDta20=Default, _$sFldId21=Default, $sDta21=Default, $sFldId22=Default, $sDta22=Default, $sFldId23=Default, $sDta23=Default, \n   $sFldId24=Default, $sDta24=Default, $sFldId25=Default, $sDta25=Default, $sFldId26=Default, $sDta26=Default, $sFldId27=Default, $sDta27=Default, \n   $sFldId28=Default, $sDta28=Default, $sFldId29=Default, $sDta29=Default, $sFldId30=Default, $sDta30=Default, _$sFldId31=Default, $sDta31=Default, \n   $sFldId32=Default, $sDta32=Default, $sFldId33=Default, $sDta33=Default, $sFldId34=Default, $sDta34=Default, $sFldId35=Default, $sDta35=Default, \n   $sFldId36=Default, $sDta36=Default, $sFldId37=Default, $sDta37=Default, $sFldId38=Default, $sDta38=Default, $sFldId39=Default, $sDta39=Default, \n   $sFldId40=Default,  $sDta40=Default)  (in current file)

 

Edited by donnyh13

LibreOffice UDF  ; Scite4AutoIt Spell-Checker Using LibreOffice

  Reveal hidden contents

 

  • Developers
Posted
  On 1/11/2024 at 4:55 PM, donnyh13 said:

Calling FormFill while in WinHTTP script itself (which I was doing for testing) displays with the underscores. Perhaps I misunderstood when/where the underscores were to be removed?

Expand  

That is helpful and will have a look to check that. I have already made some more change for editing any standard udf files, so this might already be fixed...  More later

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 @Jos

LibreOffice UDF  ; Scite4AutoIt Spell-Checker Using LibreOffice

  Reveal hidden contents

 

Posted (edited)

Thanks Jos. Just tried it, it seems fixed!.

By the way.... Your Scite installer has some goodies included in it. :) (In the Lua folder)

[snip]

Edited by donnyh13

LibreOffice UDF  ; Scite4AutoIt Spell-Checker Using LibreOffice

  Reveal hidden contents

 

  • Developers
Posted (edited)

Yea I know it did, but it shouldn't be in the current jan 4 version anymore, as I updated both the Exe and Portable zip removing those extra files.

They aren't removed by the installer unless a full uninstall is done.

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

Ah, I have an old installer. Sorry.

LibreOffice UDF  ; Scite4AutoIt Spell-Checker Using LibreOffice

  Reveal hidden contents

 

Posted

@Jos I just did a test by adding consecutive commas separating each parameter:

_WinHttpSimpleFormFill(,,,,

call tip appears correctly - showing correct parameter.

image.thumb.png.e81c077476375cfb9a3321892cc0930f.png

 

When I type "X" correct parameter is highlighted

image.thumb.png.23521d4e67fa4c09a19ba8e1e92a9608.png

When I delete few comma/parameters then it still highilight the $sData2 instead $sActionPage:

image.thumb.png.fcb808a4abe940a0a58c1217b623d656.png

 

Is it something related to LUA or to internal SciTE (N.H.) ?

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 1/12/2024 at 12:45 PM, mLipok said:

Is it something related to LUA or to internal SciTE (N.H.) ?

Expand  

That is a known internal thing which I've noticed for ages but honestly not too bothered about it

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

Hi Jos.

I was wondering if there is any kind of setting in Scite that you can think of, for delay, or time out, when opening scripts for editing (When Scite is already open)? Or if this is  a bug?  If I select several scripts, 4, 6, 8, etc. and right click and select edit script, often the already running Scite instance opens most of them, but one or two open in a new Scite instance.

I'm not sure who is to blame, either windows or Scite, but I'm guessing either one or the other sees Scite as unresponsive eventually and tries opening a new instance ?

LibreOffice UDF  ; Scite4AutoIt Spell-Checker Using LibreOffice

  Reveal hidden contents

 

Posted (edited)

Hi Jos,

I was wondering if the wrapping function (in AutoIt.Tools.lua, line 592+) for syntax

if fBroken then
                    if string.len(paramSynt) + string.len(parameter) + iOptionals + 2 + 19 > defLineMax then
                        outSyntax = outSyntax .. paramSynt .. nl .. ';' .. string.rep(' ', 18)
                        paramSynt = ''
                        fBroken = true
                    end
                else
                    if string.len(outSyntax) + string.len(paramSynt) + string.len(parameter) + iOptionals + 2 + 19 > defLineMax then
                        outSyntax = outSyntax .. paramSynt .. nl .. ';' .. string.rep(' ', 18)
                        paramSynt = ''
                        fBroken = true
                    end
                end

used in the Header creation tool (ctrl+alt_h) is still necessary? The UDF spec seems to indicate that the Syntax line shouldn't be wrapped, and as far as I have also heard, wrapping headers to 129 column is no longer needed anyway?

Edited by donnyh13

LibreOffice UDF  ; Scite4AutoIt Spell-Checker Using LibreOffice

  Reveal hidden contents

 

  • Developers
Posted (edited)

This UDF isn't written by me nor do I ever use it, so any proposal for change that makes sense and is agreed upon by this community can be integrated. :) 

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

Okay, sounds good Jos. Thanks for the info. So post a separate post and make a vote?

LibreOffice UDF  ; Scite4AutoIt Spell-Checker Using LibreOffice

  Reveal hidden contents

 

  • Developers
Posted

No voting needed as far as i am concerned, just post the changed code here so people can respond in case they want. I will gladly update the file after.

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/18/2024 at 10:57 PM, donnyh13 said:

The UDF spec seems to indicate that the Syntax line shouldn't be wrapped, and as far as I have also heard, wrapping headers to 129 column is no longer needed anyway?

Expand  

So far, the UDF specification has indicated that the syntax line should be wrapped.

  Quote

The header is 129 characters wide, and any text within it should be wrapped to that length.

Expand  

It was discussed in MVP forum because I sow how terrible it looked in very advanced UDFs (especially yours LibreOffice UDF) and considering that a lot has changed since this specification was introduced (18:33, 24 September 2012‎), I mean above all the quality and size of computer monitors solves the problem of the need to wrap text but also including AutoIt.chm for which this specification was prepared.

As the last unrebutted arguments (in MVP discussion) were for removing this restriction, and considering that 2 months have passed since that discussion and nothing new has been contributed, as a result I have just made a change:

https://www.autoitscript.com/w/index.php?title=UDF-spec&curid=2813&diff=14883&oldid=14099

Current version you can see here:

https://www.autoitscript.com/wiki/UDF-spec

 


 

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 1/19/2024 at 7:05 PM, mLipok said:

UDF specification has indicated that the syntax line should be wrapped

Expand  

What I meant was the actual Syntax line, which UDF spec actually indicated shouldn't be wrapped.

  Quote

The exception to that rule is the Syntax line, which should not be wrapped.

Expand  

But the changes to wiki look good to me @mLipok.

And I also agree, that now line wrapping seems unneeded. Even Scite has a built in Line wrap feature.

Edited by donnyh13

LibreOffice UDF  ; Scite4AutoIt Spell-Checker Using LibreOffice

  Reveal hidden contents

 

Posted (edited)

Hi Jos,
This is what I have done so far. I think that is all that is needed?
- Removed the following section used for wrapping the syntax line.

if fBroken then
                    if string.len(paramSynt) + string.len(parameter) + iOptionals + 2 + 19 > defLineMax then
                        outSyntax = outSyntax .. paramSynt .. nl .. ';' .. string.rep(' ', 18)
                        paramSynt = ''
                        fBroken = true
                    end
                else
                    if string.len(outSyntax) + string.len(paramSynt) + string.len(parameter) + iOptionals + 2 + 19 > defLineMax then
                        outSyntax = outSyntax .. paramSynt .. nl .. ';' .. string.rep(' ', 18)
                        paramSynt = ''
                        fBroken = true
                    end
                end


- Removed the declaration of the variable fBroken (it wont be used anymore)

local fBroken = false

- ReArranged and modified the section for determining the Parameter type as follows:
1. Moved the check for “fu”, “tag”, and “id” to the top of the “if” block.
2. Changed the check for “id”, it was never possible to be true before (it was checking if a one character string matched “id”). It was always being identified as an integer instead.
3. Arranged the remaining elseif’s into alphabetical order.
4. Changed the parameter type “id” from “AutoIt controlid” to “AutoIt controlID”
5. Added parameter type “e” -- “constant variant” to the list. Is this proper?
6. Added parameter type “a” -- “array”. There is already a check for Array, but once found, it tries to determine the subtype, which if it was another array (Local $aaText), it would say it was an array of unknowns. Is this good?
- If the parameter is an array, I added a new variable, iStart, so that when determining the subtype a search for “id” and “tag” etc. can still be performed.

I did a simple test, and all seems to work? I would be interested in hearing your and @mLipok’s input.

Complete new code:

--------------------------------------------------------------------------------
-- CreateFunctionHeader(s, p)
--
-- Creates a function header for an AutoIt 3 function.
--
-- Parameters:
--  s - The name of a function.
--  p - The parameters to the function.
--
-- Returns:
--  A string containing the function header.
--------------------------------------------------------------------------------
function AutoItTools:CreateFunctionHeader(s, p)
    -- Change these :)
    local defAuthor = props['UDFCreator'] -- Initial Author value
    local defLineMax = 129              -- Max length of line. AutoIt standard is 129.
    local defSplit = 21                 -- Default index for '-' after param.

    local nl = self:NewLineInUse()

    local outStart = 'FUNCTION'
    local outName = s
    local outDesc = ''
    local outSyntax = ''
    local outParams = ''
    local outReturn = 'None'
    local outAuthor = defAuthor
    local outModify = ''
    local outRemarks = ''
    local outRelated = ''
    local outLink = ''
    local outExample = 'No'

    local name = s
    local params = string.gsub(p, '[Ff][Uu][Nn][Cc].-%((.*)%)', '(%1)')

    if name:sub(0, 2) == '__' then
        outStart = 'INTERNAL_USE_ONLY'
    end

    outSyntax = name .. '('

    local paramSynt = ''
    local iOptionals = 0
    local sModifiers = ''
    if params ~= '()' and params ~= nil then
        for byref, parameter, optional in string.gmatch(params, '(%w-%s*%w*)%s*($[%w_]+)%s*[=]?%s*(.-)[,%)]') do
            if parameter ~= '' and parameter ~= nil then
                if outParams ~= '' then
                    outParams = outParams .. nl .. ';' .. string.rep(' ', 18)
                end

                outParams = outParams .. parameter .. string.rep(' ', defSplit - string.len(parameter)) .. '- '

                sModifiers = ''
                if optional ~= '' and optional ~= nil then
                    outParams = outParams .. '[optional] '

                    if paramSynt ~= '' then
                        paramSynt = paramSynt .. '[, '
                    else
                        paramSynt = paramSynt .. '['
                    end

                    iOptionals = iOptionals + 1
                else
                    byref = string.gsub(byref:lower(), '%s', '')
                    if byref ~= '' then
                        if byref == 'byref' then
                            outParams = outParams .. '[in/out] '
                            sModifiers = 'ByRef '
                        else
                            if byref == 'const' then
                                outParams = outParams .. '[const] '
                                sModifiers = 'Const '
                            else
                                if byref == 'byrefconst' or byref == 'constbyref' then
                                    outParams = outParams .. '[in/out and const] '
                                    sModifiers = 'Const ByRef '
                                else
                                    print("Unrecognised parameter modifiers: '" .. byref .. "'")
                                end
                            end
                        end
                    end

                    if paramSynt ~= '' then
                        paramSynt = paramSynt .. ', '
                    end
                end
                
                paramSynt = paramSynt .. sModifiers .. parameter

                if optional ~= '' and optional ~= nil then
                    paramSynt = paramSynt .. ' = ' .. optional
                end

                local paramtype = parameter:sub(2, 2)
                local isarray = false
                local iStart = 2
                if paramtype == 'a' then
                    paramtype = parameter:sub(3, 3)
                    isarray = true
                    iStart = 3
                end

                local sAdd
                
                if parameter:sub(iStart, iStart + 1) == 'fu' then
                    sAdd = 'function (first class object)'
                elseif parameter:sub(iStart, iStart + 2) == 'tag' then
                    sAdd = 'structures definition'
                elseif parameter:sub(iStart, iStart + 1) == 'id' then
                    sAdd = 'AutoIt controlID'
                elseif paramtype == 'a' then
                    sAdd = 'array'
                elseif paramtype == 'b' then
                    sAdd = 'boolean'
                elseif paramtype == 'd' then
                    sAdd = 'binary variant'
                elseif paramtype == 'e' then
                    sAdd = 'constant variant'
                elseif paramtype == 'f' then
                    sAdd = 'floating point'
                elseif paramtype == 'h' then
                    sAdd = 'handle' 
                elseif paramtype == 'i' then
                    sAdd = 'integer'
                elseif paramtype == 'm' then
                    sAdd = 'map'
                elseif paramtype == 'n' then
                    sAdd = 'general number'
                elseif paramtype == 'o' then
                    sAdd = 'object' 
                elseif paramtype == 'p' then
                    sAdd = 'pointer'    
                elseif paramtype == 's' then
                    sAdd = 'string'
                elseif paramtype == 't' then
                    sAdd = 'dll struct'
                elseif paramtype == 'v' then
                    sAdd = 'variant'
                else
                    sAdd = 'unknown'
                end

                if isarray then
                    outParams = outParams .. 'an array of ' .. sAdd .. 's.'
                else
                    if sAdd == 'object' then
                        outParams = outParams .. 'an ' .. sAdd .. '.'
                    elseif sAdd == 'map' then
                        outParams = outParams .. 'a ' .. sAdd .. '.'
                    elseif sAdd == 'structures definition' then
                        outParams = outParams .. 'a ' .. sAdd .. '.'
                    elseif sAdd == 'function (first class object)' then
                        outParams = outParams .. '' .. sAdd .. '.'
                    else
                        if sAdd:sub(1, 1):find('[AEIOUaeiou]') ~= nil then
                            outParams = outParams .. 'an ' .. sAdd .. ' value.'
                        else
                            outParams = outParams .. 'a ' .. sAdd .. ' value.'
                        end
                    end
                end

                if optional ~= '' and optional ~= nil then
                    outParams = outParams .. ' Default is ' .. optional .. '.'
                end
            end
        end
    else
        outParams = 'None'
    end

    outSyntax = outSyntax .. paramSynt .. string.rep(']', iOptionals) .. ')'

    local res = '; #' .. outStart .. '# ' .. string.rep('=', defLineMax - 5 - outStart:len()) .. nl
    res = res .. '; Name ..........: ' .. outName .. nl
    res = res .. '; Description ...: ' .. outDesc .. nl
    res = res .. '; Syntax ........: ' .. outSyntax .. nl
    res = res .. '; Parameters ....: ' .. outParams .. nl
    res = res .. '; Return values .: ' .. outReturn .. nl
    res = res .. '; Author ........: ' .. outAuthor .. nl
    res = res .. '; Modified ......: ' .. outModify .. nl
    res = res .. '; Remarks .......: ' .. outRemarks .. nl
    res = res .. '; Related .......: ' .. outRelated .. nl
    res = res .. '; Link ..........: ' .. outLink .. nl
    res = res .. '; Example .......: ' .. outExample .. nl
    res = res .. '; ' .. string.rep('=', defLineMax - 2) .. nl

    return res
end -- CreateFunctionHeader()

 

Edited by donnyh13

LibreOffice UDF  ; Scite4AutoIt Spell-Checker Using LibreOffice

  Reveal hidden contents

 

  • Developers
Posted

I have merged the update into my version of AutoItTools.lua, and looked a the changes made and will be in the next Beta version upload soon.  tnx :) 

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)

Hi Jos,

I just noticed Autocomplete sorting seems to be a little off still? I would think the short name should be at the top, no? Though I don't know if it can be improved, since lua does the sorting?

[snip]

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