SciTE4ahk custom intellisense generator follow-up

Post a reply

Confirmation code
Enter the code exactly as it appears. All letters are case insensitive.
Smilies
:D :) ;) :( :o :shock: :? 8-) :lol: :x :P :oops: :cry: :evil: :twisted: :roll: :!: :?: :idea: :| :mrgreen: :geek: :ugeek: :arrow: :angel: :clap: :crazy: :eh: :lolno: :problem: :shh: :shifty: :sick: :silent: :think: :thumbup: :thumbdown: :salute: :wave: :wtf: :yawn: :facepalm: :bravo: :dance: :beard: :morebeard: :xmas: :HeHe: :trollface: :cookie: :rainbow: :monkeysee: :monkeysay: :happybday: :headwall: :offtopic: :superhappy: :terms: :beer:
View more smilies

BBCode is ON
[img] is OFF
[flash] is OFF
[url] is ON
Smilies are ON

Topic review
   

Expand view Topic review: SciTE4ahk custom intellisense generator follow-up

Re: SciTE4ahk custom intellisense generator follow-up

Post by JnLlnd » 15 Nov 2017, 19:21

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

Thanks,

Jean

Re: SciTE4ahk custom intellisense generator follow-up

Post by XeroByte » 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).

Re: SciTE4ahk custom intellisense generator follow-up

Post by JnLlnd » 24 Jul 2017, 21:48

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

Post by XeroByte » 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.

Re: SciTE4ahk custom intellisense generator follow-up

Post by JnLlnd » 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.

Re: SciTE4ahk custom intellisense generator follow-up

Post by Joe Glines » 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

Re: SciTE4ahk custom intellisense generator follow-up

Post by XeroByte » 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.

Re: SciTE4ahk custom intellisense generator follow-up

Post by JnLlnd » 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

Re: SciTE4ahk custom intellisense generator follow-up

Post by XeroByte » 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.

Re: SciTE4ahk custom intellisense generator follow-up

Post by JnLlnd » 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] [Expand]GeSHi © Codebox Plus


The resulting user.ahk.api for this file:

Code: [Select all]GeSHi © Codebox Plus

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

Post by XeroByte » 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?

Re: SciTE4ahk custom intellisense generator follow-up

Post by JnLlnd » 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
{
}

Re: SciTE4ahk custom intellisense generator follow-up

Post by tank » 20 Jul 2017, 14:54

/*
comments
*/
function() {
}

Re: SciTE4ahk custom intellisense generator follow-up

Post by JnLlnd » 20 Jul 2017, 12:57

@tank: How do you write your functions? My format is:

FunctionName()
; comment
{
}

Re: SciTE4ahk custom intellisense generator follow-up

Post by tank » 20 Jul 2017, 12:28

Thanks JnLlnd that solved my problem. No i cant duplicate your problem

Re: SciTE4ahk custom intellisense generator follow-up

Post by JnLlnd » 20 Jul 2017, 10:50

Now that I can run it, I found that it indexes the labels well. Unfortunately, no function was indexed. Anybody has the same issue?

Re: SciTE4ahk custom intellisense generator follow-up

Post by JnLlnd » 20 Jul 2017, 10:28

OK... I'm re-discovering my own SciTE setup! I'm running SciTE under the Program Files protected folder. And my user folder is located under my Documents folder:
C:\Users\Jean\Documents\AutoHotkey\SciTE

I succeeded by setting the default path in function BuildUserAhkApi as:
BuildUserAhkApi(AhkScriptPaths, OverwriteAhkApi:="1", RecurseIncludes:="1", Labels:="1", WrapWidth:="265", AhkApiPath:="C:\Users\Jean\Documents\AutoHotkey\SciTE\user.ahk.api", RecursionCall:="0")

No need to re-install SciTE ;-)

@tank: If you have a setup similar to mine, you just need to find where is your SciTE user folder and edit the default value for AhkApiPath in the copy of AhkApiPath.ahk in your Lib folder.

Re: SciTE4ahk custom intellisense generator follow-up

Post by JnLlnd » 20 Jul 2017, 09:49

I have the same issue. The script cannot write the file user.ahk.api because it is located under the protected C:\Program Files\ folder (C:\Program Files\AutoHotkey\SciTE\user\user.ahk.api)

Should SciTE be running in a not protexted folder (as the under "Documents")?

And thank you XeroByte for your work!

Re: SciTE4ahk custom intellisense generator follow-up

Post by tank » 20 Jul 2017, 09:34

I cant get Scite to recognize C:\Program Files\AutoHotkey\SciTE\user\user.ahk.api

Re: SciTE4ahk custom intellisense generator follow-up

Post by Joe Glines » 20 Jul 2017, 09:22

@ XeroByte- No need to apologize! Thank you for your work on this! I'm looking forward to playing with it! :)

Top