SciTE4ahk custom intellisense generator follow-up

Get help with using AutoHotkey (v1.1 and older) and its commands and hotkeys
User avatar
tank
Posts: 3122
Joined: 28 Sep 2013, 22:15
Location: CarrolltonTX
Contact:

Re: SciTE4ahk custom intellisense generator follow-up

20 Jul 2017, 14:54

/*
comments
*/
function() {
}
We are troubled on every side‚ yet not distressed; we are perplexed‚
but not in despair; Persecuted‚ but not forsaken; cast down‚ but not destroyed;
Telegram is the best way to reach me
https://t.me/ttnnkkrr
If you have forum suggestions please submit a
Check Out WebWriter
User avatar
JnLlnd
Posts: 487
Joined: 29 Sep 2013, 21:29
Location: Montreal, Quebec, Canada
Contact:

Re: SciTE4ahk custom intellisense generator follow-up

20 Jul 2017, 15:07

Thanks. I tried with both formats (your is 1 and mine is 2) and only labels get indexed in user.ahk.api, no function.

; comments on 1
Test1Function() {
}

Test2Function()
; comments on 2
{
}
:thumbup: Author of freeware Quick Access Popup, the powerful Windows folders, apps and documents launcher!
:P Now working on Quick Clipboard Editor
:ugeek: The Automator's Courses on AutoHotkey
XeroByte
Posts: 26
Joined: 17 Sep 2014, 01:30

Re: SciTE4ahk custom intellisense generator follow-up

20 Jul 2017, 17:50

JnLlnd wrote:Thanks. I tried with both formats (your is 1 and mine is 2) and only labels get indexed in user.ahk.api, no function.

; comments on 1
Test1Function() {
}

Test2Function()
; comments on 2
{
}
I can't think why you're having this issue. Could you please try run the function on a .ahk file that only has a few test functions and see if it can index them?
User avatar
JnLlnd
Posts: 487
Joined: 29 Sep 2013, 21:29
Location: Montreal, Quebec, Canada
Contact:

Re: SciTE4ahk custom intellisense generator follow-up

20 Jul 2017, 21:32

XeroByte wrote:I can't think why you're having this issue. Could you please try run the function on a .ahk file that only has a few test functions and see if it can index them?
It works now with the following simple file including both labels and functions. Not sure what I was doing wrong before. But it still fail to index functions in my larger "real-life" script (15 K lines).

The test script:

Code: Select all

#NoEnv
#SingleInstance force

BuildUserAhkApi(A_ScriptFullPath,1)
return

Test1Label:
return

; comments on 1
Test1Function() {
}

Test2Function()
; comments on 2
{
}

Test2Label:
return
The resulting user.ahk.api for this file:

Code: Select all

Test1Function ()\n; comments on 1\n; Location: C:\\Dropbox\\AutoHotkey\\SciTE-Intellisense\\TestBuildUserAhkApi.ahk
Test2Function ()\n; comments on 2\n; Location: C:\\Dropbox\\AutoHotkey\\SciTE-Intellisense\\TestBuildUserAhkApi.ahk

Test1Label \n; Location: C:\\Dropbox\\AutoHotkey\\SciTE-Intellisense\\TestBuildUserAhkApi.ahk
Test2Label \n; Location: C:\\Dropbox\\AutoHotkey\\SciTE-Intellisense\\TestBuildUserAhkApi.ahk
I will insert debugging code in your script and try to see if I can find what is happening.
:thumbup: Author of freeware Quick Access Popup, the powerful Windows folders, apps and documents launcher!
:P Now working on Quick Clipboard Editor
:ugeek: The Automator's Courses on AutoHotkey
XeroByte
Posts: 26
Joined: 17 Sep 2014, 01:30

Re: SciTE4ahk custom intellisense generator follow-up

20 Jul 2017, 22:32

JnLlnd wrote:I will insert debugging code in your script and try to see if I can find what is happening.
If it's a RegEx issue (which it sounds like it may be) then I'm not sure that debugging code will help. I guess you probably don't want to send me your real-life script with all its 15K lines - but if you did I could look into it.

Alternatively - if you just sent me (or posted here) your script from the first line until the end of the first function that appears in your script then that may be enough to work with.
User avatar
JnLlnd
Posts: 487
Joined: 29 Sep 2013, 21:29
Location: Montreal, Quebec, Canada
Contact:

Re: SciTE4ahk custom intellisense generator follow-up

21 Jul 2017, 07:56

@XeroByte: If you offer to debug using my script, here is the source file: https://raw.githubusercontent.com/JnLln ... sPopup.ahk
:thumbup: Author of freeware Quick Access Popup, the powerful Windows folders, apps and documents launcher!
:P Now working on Quick Clipboard Editor
:ugeek: The Automator's Courses on AutoHotkey
XeroByte
Posts: 26
Joined: 17 Sep 2014, 01:30

Re: SciTE4ahk custom intellisense generator follow-up

23 Jul 2017, 23:57

JnLlnd wrote:@XeroByte: If you offer to debug using my script, here is the source file: https://raw.githubusercontent.com/JnLln ... sPopup.ahk
The main problem I found is that in your file the lines all end in just the LF character rather than CR + LF. This interferes with the 'beginning' and 'end' of lines detection by the RegEx.
As soon as I converted the file to Windows CR LF (using notepad++ Edit > EOL Conversion > Windows Format) then this issue disappears. It may be possible to account for this in the RegEx, but I probably won't because I don't believe that it is normal for AHK code to be written without the windows CR LF end of lines.

The other issue I can see is (something I should probably fix) - labels are being identified - but they're not actually supposed to be labels since they are inside /* */ comment blocks.

Let me know how you go with this, and if you're OK with converting your AHK to the Windows CRLF end of line.
User avatar
Joe Glines
Posts: 770
Joined: 30 Sep 2013, 20:49
Location: Dallas
Contact:

Re: SciTE4ahk custom intellisense generator follow-up

24 Jul 2017, 08:04

@JnLlnd: I was looking at changing the default line break in SciTE. Perhaps you've changed the default but below is how you can control it in your User.Properties file.

# Setting default End of Line: LF for Unix, CR for Mac prior to OS X CRLF for Dos/Windows
eol.mode=CRLF
Sign-up for the 🅰️HK Newsletter

ImageImageImageImage:clap:
AHK Tutorials:Web Scraping | | Webservice APIs | AHK and Excel | Chrome | RegEx | Functions
Training: AHK Webinars Courses on AutoHotkey :ugeek:
YouTube

:thumbup: Quick Access Popup, the powerful Windows folders, apps and documents launcher!
User avatar
JnLlnd
Posts: 487
Joined: 29 Sep 2013, 21:29
Location: Montreal, Quebec, Canada
Contact:

Re: SciTE4ahk custom intellisense generator follow-up

24 Jul 2017, 11:11

Hi,

Thanks for looking at the file on GitHub.

It seems that somewhere in the transfers from my system to GitHub from GitHub to yours, the EOL were transformed because on my system the file is saved with CR/LF. See screen capture:

Image

Could you try with my original file zipped here?
http://www.jeanlalonde.ca/temp/QuickAcc ... Source.zip

> The other issue I can see is (something I should probably fix) - labels are being identified - but they're not actually supposed to be labels since they are inside /* */ comment blocks.

Yes, I saw that the "Version: x.x..." were indexed as labels even if they are inside a comment block. If the regex could fix it, it would be great.

@Joe: Thanks for the tip. I check my user.properties file and there is no specific config for EOL.
:thumbup: Author of freeware Quick Access Popup, the powerful Windows folders, apps and documents launcher!
:P Now working on Quick Clipboard Editor
:ugeek: The Automator's Courses on AutoHotkey
XeroByte
Posts: 26
Joined: 17 Sep 2014, 01:30

Re: SciTE4ahk custom intellisense generator follow-up

24 Jul 2017, 19:05

JnLlnd wrote:Could you try with my original file zipped here?
http://www.jeanlalonde.ca/temp/QuickAcc ... Source.zip.
Hey Jean,

My apologies - looks like I jumped to the wrong conclusion there. I got a bit excited when I saw just the LF, so i didn't investigate any further. I've inspected it a bit closer now and realised that it was exactly as you said - no functions were appearing in the api file, only labels.

A little digging showed the RegEx is producing a -21 error which I have never seen before. Apparently this means "Recursion too deep"... I need to dig a little deeper into this but the AHK docs say to modify the pattern to be more restrictive. I'll put a bit of work into that and see if i can get it working on your file.

For the moment I believe this error will only trigger on large files like yours.
User avatar
JnLlnd
Posts: 487
Joined: 29 Sep 2013, 21:29
Location: Montreal, Quebec, Canada
Contact:

Re: SciTE4ahk custom intellisense generator follow-up

24 Jul 2017, 21:48

I hope you can find a solution to this "Recursion too deep" issue. Thanks for your time, XeroByte.

Jean
:thumbup: Author of freeware Quick Access Popup, the powerful Windows folders, apps and documents launcher!
:P Now working on Quick Clipboard Editor
:ugeek: The Automator's Courses on AutoHotkey
XeroByte
Posts: 26
Joined: 17 Sep 2014, 01:30

Re: SciTE4ahk custom intellisense generator follow-up

15 Nov 2017, 18:48

Hi All, Sorry it's been so long.

I've attempted to tackle this issue a few times now but couldn't come up a reasonable solution. I think this will take a near complete rewrite (probably involving splitting up the different coding styles and dealing with them individually).
User avatar
JnLlnd
Posts: 487
Joined: 29 Sep 2013, 21:29
Location: Montreal, Quebec, Canada
Contact:

Re: SciTE4ahk custom intellisense generator follow-up

15 Nov 2017, 19:21

No problem, XeroByte. These things happen... Do as you can and let us know :-)

Thanks,

Jean
:thumbup: Author of freeware Quick Access Popup, the powerful Windows folders, apps and documents launcher!
:P Now working on Quick Clipboard Editor
:ugeek: The Automator's Courses on AutoHotkey

Return to “Ask for Help (v1)”

Who is online

Users browsing this forum: marypoppins_1, OrangeCat, RussF and 129 guests