SciTE4ahk custom intellisense generator follow-up

Get help with using AutoHotkey and its commands and hotkeys
User avatar
JnLlnd
Posts: 221
Joined: 29 Sep 2013, 21:29
Location: Montreal, Quebec, Canada

SciTE4ahk custom intellisense generator follow-up

26 Jun 2017, 22:17

This is a follow-up on this thread on the old (closed) forum: https://autohotkey.com/board/topic/1112 ... generator/. I hope the OP XeroByte can see it here.

@XeroByte: Joe Glines recently posted a video tutorial about your script (http://the-automator.com/personalizing- ... tocorrect/). Thanks for sharing BuildUserAhkApi.ahk. This script incredibly improves coding with SciTE4AutoHotkey.

But I have an issue with it. AHK lets you format your script and place brackets around functions, if, loop (etc) quite freely. Unfortunately, my personal coding style for functions differs from the style supported by your script. It seems that my own way of putting curly brackets around my functions is not the way BuildUserAhkApi expects them. For example, this is my formatting for functions:

Code: [Select all] [Download] GeSHi © Codebox Plus

MyFunc(var)
; my function description
{
return var
}

But, based on my tests, BuildUserAhkApi expects this:

Code: [Select all] [Download] GeSHi © Codebox Plus

MyFunc(var){
; my function description
return var
}

Do you think your script can be adapted to support various coding style? If not, I can understand that you shared your script based on your own (and quite widespread) coding style. I just want to assess if I would have to convert (retrofit) my functions and... change my habit ;-)

Jean
Author of freeware apps Quick Access Popup (http://www.quickaccesspopup.com),
FoldersPopup and CSV Buddy (http://code.jeanlalonde.ca)
XeroByte
Posts: 22
Joined: 17 Sep 2014, 01:30

Re: SciTE4ahk custom intellisense generator follow-up

26 Jun 2017, 22:42

Hey Jean,

Thanks for the PM.

Wow, thanks for pointing out that my script has been featured. Honestly i'm a bit shocked :shock:
I wrote this quite a long time ago and I don't think I've made any major edits to it since I posted it. I still heavily rely on it, so I'm really excited to see that other people are interested and find value in it.

I'll take some time hopefully this week to look over my code and see if there's anything I can do to allow for the alternate coding style you pointed out.
User avatar
JnLlnd
Posts: 221
Joined: 29 Sep 2013, 21:29
Location: Montreal, Quebec, Canada

Re: SciTE4ahk custom intellisense generator follow-up

26 Jun 2017, 22:47

Thanks XeroByte. Glad to see you taking a look at it. And to see that PM works on this forum :-)

Jean
Author of freeware apps Quick Access Popup (http://www.quickaccesspopup.com),
FoldersPopup and CSV Buddy (http://code.jeanlalonde.ca)
User avatar
Joe Glines
Posts: 420
Joined: 30 Sep 2013, 20:49
Facebook: https://www.facebook.com/theAutomatorGuru/
Google: https://plus.google.com/105328929654286634910
GitHub: joetazz
Location: Dallas
Contact:

Re: SciTE4ahk custom intellisense generator follow-up

27 Jun 2017, 05:15

@Jean- Thanks for the mention! I'm glad you bumped it out to the new forum & I hope it gets some awareness as it is really helpful!

@XeroByte- Thank you for your work on this! I heavily rely on my lib folder so I was thinking about adding some functionality to this script to keep track of what has been incorporated / processed and then to automatically run if a new file shows-up in my LIB folder. Would anyone else be interested?

Between this script and the other one I use from lexicos to improve auto-complete, I'm seeing huge increases in my productivity!
BoBo
Posts: 849
Joined: 13 May 2014, 17:15

Re: SciTE4ahk custom intellisense generator follow-up

27 Jun 2017, 06:03

@ JnLlnd
welcome to the club of code aesthetics :) (erm, I'm your counterpart :shifty:)
I'm constantly annoyed that AHK won't allow me to use XeroByte's preferred OTB coding style for an (advanced) => Loop :roll:
No idea why it's possible to set up different comment formats, and/or exclude specific characters from further processing but an opening curly brace is kinda coding Anti OTB "Westwall" :lol:. Meh ... (if someone has a UDF in place to bypass that restriction, I'll owe one's a beer!)

"The One True Brace (OTB) style may optionally be used with normal loops (but not specialized loops such as file-pattern and parsing). For example: ..."

Well, back to the topic. Good luck & may your wish come true :thumbup:
User avatar
JnLlnd
Posts: 221
Joined: 29 Sep 2013, 21:29
Location: Montreal, Quebec, Canada

Re: SciTE4ahk custom intellisense generator follow-up

27 Jun 2017, 09:16

@Bobo: When posting this yesterday, I did not remember this "OTB" style had a name. Doing further research, I found my style is named Allman and is inherited from my Pascal coding early days :-)
Author of freeware apps Quick Access Popup (http://www.quickaccesspopup.com),
FoldersPopup and CSV Buddy (http://code.jeanlalonde.ca)
XeroByte
Posts: 22
Joined: 17 Sep 2014, 01:30

Re: SciTE4ahk custom intellisense generator follow-up

04 Jul 2017, 09:15

Just wanted to give a quick update.

I've put together a new RegEx string to find function definitions and their surrounding comments that should allow for additional coding styles including the examples Jean brought to my attention plus comments immediately prior to a function definition.

Now I just need to insert the RegEx, review the rest of the function and test.

It will still only support the semi-colon single line comments and not the multi-line /* */ comments. I'll ponder this and see if I can manage to get those included as well.
User avatar
JnLlnd
Posts: 221
Joined: 29 Sep 2013, 21:29
Location: Montreal, Quebec, Canada

Re: SciTE4ahk custom intellisense generator follow-up

04 Jul 2017, 10:42

Thanks for the follow-up XeroByte :-) Can't wait to fill SciTE with all my functions defs !
Author of freeware apps Quick Access Popup (http://www.quickaccesspopup.com),
FoldersPopup and CSV Buddy (http://code.jeanlalonde.ca)
User avatar
JnLlnd
Posts: 221
Joined: 29 Sep 2013, 21:29
Location: Montreal, Quebec, Canada

Re: SciTE4ahk custom intellisense generator follow-up

18 Jul 2017, 10:54

Hi,

XeroByte wrote:Now I just need to insert the RegEx, review the rest of the function and test.

Any update on this? No pressure :-) I was just reminded to follow on this with you because of a webinar that Joe is giving this afternoon about SciTE and AHK.

For those interested, you can register (free) here:
https://zoom.us/meeting/register/a9e829 ... 1539e44ee6

Thanks,

Jean
Author of freeware apps Quick Access Popup (http://www.quickaccesspopup.com),
FoldersPopup and CSV Buddy (http://code.jeanlalonde.ca)
XeroByte
Posts: 22
Joined: 17 Sep 2014, 01:30

Re: SciTE4ahk custom intellisense generator follow-up

18 Jul 2017, 15:52

JnLlnd wrote:Any update on this? No pressure :-)

I'm so sorry Jean, life & work have been getting in the way. Thanks for the gentle push :-)

I am committed to doing this, but I apologise if it takes a bit longer.

I did insert the Regex, it required a bit of code rewriting - there are still a few things that I'm not quite happy with. I have actually been using this new version for a week or more now and haven't noticed anything going wrong.

I'll try do some more work on it today and I'll decide if it's worthy of being posted yet.
XeroByte
Posts: 22
Joined: 17 Sep 2014, 01:30

Re: SciTE4ahk custom intellisense generator follow-up

20 Jul 2017, 08:46

Hi All,

I haven't cleaned this up at all yet - I intend on phasing out the use of Poly's grep() function in favor of the RegExMatchGlobal() function by JustMe.

I have really limited time, so I apologise that I haven't tested this fully and I haven't released a proper blurb on everything - there are a few additional things here such as
  • you can pass in an array of AHK scripts and/or folders
  • Some exclusion lists for any files/functions/labels you don't want added to the intellisense (I added this a while back - I actually want to clean this up a bit). for the moment I've defined them inside the function and not as parameters to the function - I'm trying to think of a better way of doing it.

Please let me know if you run into any bugs or if you have suggestions.

Code: [Select all] [Expand] [Download] GeSHi © Codebox Plus

User avatar
tank
Posts: 2047
Joined: 28 Sep 2013, 22:15
Facebook: charlie.simmons.7334
GitHub: ttnnkkrr
Location: Louisville KY
Contact:

Re: SciTE4ahk custom intellisense generator follow-up

20 Jul 2017, 09:34

I cant get Scite to recognize C:\Program Files\AutoHotkey\SciTE\user\user.ahk.api
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;
https://www.facebook.com/ahkscript.org
User avatar
JnLlnd
Posts: 221
Joined: 29 Sep 2013, 21:29
Location: Montreal, Quebec, Canada

Re: SciTE4ahk custom intellisense generator follow-up

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!
Author of freeware apps Quick Access Popup (http://www.quickaccesspopup.com),
FoldersPopup and CSV Buddy (http://code.jeanlalonde.ca)
User avatar
JnLlnd
Posts: 221
Joined: 29 Sep 2013, 21:29
Location: Montreal, Quebec, Canada

Re: SciTE4ahk custom intellisense generator follow-up

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.
Author of freeware apps Quick Access Popup (http://www.quickaccesspopup.com),
FoldersPopup and CSV Buddy (http://code.jeanlalonde.ca)
User avatar
JnLlnd
Posts: 221
Joined: 29 Sep 2013, 21:29
Location: Montreal, Quebec, Canada

Re: SciTE4ahk custom intellisense generator follow-up

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?
Author of freeware apps Quick Access Popup (http://www.quickaccesspopup.com),
FoldersPopup and CSV Buddy (http://code.jeanlalonde.ca)
User avatar
tank
Posts: 2047
Joined: 28 Sep 2013, 22:15
Facebook: charlie.simmons.7334
GitHub: ttnnkkrr
Location: Louisville KY
Contact:

Re: SciTE4ahk custom intellisense generator follow-up

20 Jul 2017, 12:28

Thanks JnLlnd that solved my problem. No i cant duplicate your problem
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;
https://www.facebook.com/ahkscript.org
User avatar
JnLlnd
Posts: 221
Joined: 29 Sep 2013, 21:29
Location: Montreal, Quebec, Canada

Re: SciTE4ahk custom intellisense generator follow-up

20 Jul 2017, 12:57

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

FunctionName()
; comment
{
}
Author of freeware apps Quick Access Popup (http://www.quickaccesspopup.com),
FoldersPopup and CSV Buddy (http://code.jeanlalonde.ca)

Return to “Ask For Help”

Who is online

Users browsing this forum: Bing [Bot], Noesis, Yahoo [Bot] and 21 guests