Page 2 of 2

Re: SciTE4ahk custom intellisense generator follow-up

Posted: 20 Jul 2017, 14:54
by tank
/*
comments
*/
function() {
}

Re: SciTE4ahk custom intellisense generator follow-up

Posted: 20 Jul 2017, 15:07
by JnLlnd
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
{
}

Re: SciTE4ahk custom intellisense generator follow-up

Posted: 20 Jul 2017, 17:50
by XeroByte
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?

Re: SciTE4ahk custom intellisense generator follow-up

Posted: 20 Jul 2017, 21:32
by JnLlnd
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.

Re: SciTE4ahk custom intellisense generator follow-up

Posted: 20 Jul 2017, 22:32
by XeroByte
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.

Re: SciTE4ahk custom intellisense generator follow-up

Posted: 21 Jul 2017, 07:56
by JnLlnd
@XeroByte: If you offer to debug using my script, here is the source file: https://raw.githubusercontent.com/JnLln ... sPopup.ahk

Re: SciTE4ahk custom intellisense generator follow-up

Posted: 23 Jul 2017, 23:57
by XeroByte
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.

Re: SciTE4ahk custom intellisense generator follow-up

Posted: 24 Jul 2017, 08:04
by Joe Glines
@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

Re: SciTE4ahk custom intellisense generator follow-up

Posted: 24 Jul 2017, 11:11
by JnLlnd
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.

Re: SciTE4ahk custom intellisense generator follow-up

Posted: 24 Jul 2017, 19:05
by XeroByte
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.

Re: SciTE4ahk custom intellisense generator follow-up

Posted: 24 Jul 2017, 21:48
by JnLlnd
I hope you can find a solution to this "Recursion too deep" issue. Thanks for your time, XeroByte.

Jean

Re: SciTE4ahk custom intellisense generator follow-up

Posted: 15 Nov 2017, 18:48
by XeroByte
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).

Re: SciTE4ahk custom intellisense generator follow-up

Posted: 15 Nov 2017, 19:21
by JnLlnd
No problem, XeroByte. These things happen... Do as you can and let us know :-)

Thanks,

Jean