Custom Function Documentation using SciTE

The popular SciTE-based AutoHotkey Script Editor
JRP

Custom Function Documentation using SciTE

07 Mar 2017, 09:37

Hi,

I am using SciTE for editing ahk-files and one feature I find very useful is the "help" for functions, e.g. IniWrite, Value, Filename, Section [, Key]. Is there a way to have such a feature for custom functions?

Thanks,
J.
User avatar
boiler
Posts: 2370
Joined: 21 Dec 2014, 02:44

Re: Custom Function Documentation using SciTE

08 Mar 2017, 00:48

Funny you should mention that. I don't think one exists, but I've been sort of outlining how to do this for this and some other editors. When I get some free time, I'll put some more effort into it. I have one approach almost working this editor. Have to get past one issue to get a simple one working.
Helgef
Posts: 2990
Joined: 17 Jul 2016, 01:02
Contact:

Re: Custom Function Documentation using SciTE

08 Mar 2017, 16:59

I'm not exactly sure which help you are refering to, but if you mean the small pop-ups showing all parameters when you type a function or command name, you can add your own in the AHK.api file in your SciTe folder. For example,

Code: [Select all] [Download] (Untitled.txt)GeSHi © Codebox Plus

MyFunc(a,[b,c]) \nThis shows a comment below MyFunc...
MyFunc()\nYou can add multiple versions, then you get the up down arrows.

scite.png
scite.png (2.53 KiB) Viewed 3512 times
User avatar
boiler
Posts: 2370
Joined: 21 Dec 2014, 02:44

Re: Custom Function Documentation using SciTE

08 Mar 2017, 17:12

That might be okay for the OP, but it wouldn't be the answer for what I'm looking to do. I'm looking to have it show me the definitions of functions that are unique to the script I'm writing, not for reused library-type functions that would warrant being added to the AHK.api file. In fact, the parameter list often changes as I write and modify the code. It's definitely not something I would add to that file. It would just find the definition in the the script I'm editing (or perhaps in an included file), and it would show that.
Helgef
Posts: 2990
Joined: 17 Jul 2016, 01:02
Contact:

Re: Custom Function Documentation using SciTE

08 Mar 2017, 18:09

boiler wrote:I'm looking to have it show me the definitions of functions that are unique to the script I'm writing

That would be most excellent :thumbup:
boiler wrote:I have one approach almost working this editor

How SciTe specific is your approach? I'm not using SciTe :(

Cheers.
User avatar
boiler
Posts: 2370
Joined: 21 Dec 2014, 02:44

Re: Custom Function Documentation using SciTE

08 Mar 2017, 21:04

My long term-goal is to develop something for Notepad++ and Sublime Text 3, although I might target SciTE4AHK first because I think I can implement that one easier.

I really like SciTE4AHK a lot, but it's missing a key feature for me, which is to have two or more active and synced editing panes looking at the same file (you can have two windows with the same file in each, but if you edit one, the other isn't also updated, which can lead to big problems). Both Notepad++ and Sublime Text 3 have this capability, and I currently use Sublime Text 3 for my larger scripts.

The main reason I don't use Notepad++ for AHK anymore is that I don't believe the command hints/intellisense or whatever you call it has been fully implemented. It seems that the one that has been implemented only works for AHK functions but not commands (no one has answered my post in that thread where I try to find out if that's correct). If I get this thing working, I plan on extending it to work for AHK built-in functions and commands as well.
Helgef
Posts: 2990
Joined: 17 Jul 2016, 01:02
Contact:

Re: Custom Function Documentation using SciTE

09 Mar 2017, 03:11

I get the occasional pop-up hint in Notepad++, it is definitely not complete, but I don't remember installing it either, may there are newer versions now. There is the regular auto-complete suggestion pop-up, and also suggestions for all words in the file. For parameter hints I'm using this hotstring script. I find it moderately useful, the big drawback is that I have to type the whole function/command to get the hint, so I have made an auto-complete script with the parameter hint expansion, but it is not quite done yet.
Script specific function parameter hints would be very nice, personally I don't have any good ideas on how to implement it, looking forward to see your stuff, if you get the time to finish it :cookie:

Cheers.
User avatar
boiler
Posts: 2370
Joined: 21 Dec 2014, 02:44

Re: Custom Function Documentation using SciTE

09 Mar 2017, 04:58

How did I miss your parameter hint hotstring script? I thought I see every new thread in that forum, but somehow I missed that. That is just what I was looking for! Thanks for sharing it. Looking forward to your auto-complete script as well. I probably will switch to Notepad++ full time now thanks to this.

Perhaps you should cross-post a link to that thread in the Editors forum. Not that it gets as much traffic as the Scripts and Functions forum, but when someone is looking through the Editors forum for all information on a particular editor (as I was recently), they will find your excellent script.
Helgef
Posts: 2990
Joined: 17 Jul 2016, 01:02
Contact:

Re: Custom Function Documentation using SciTE

09 Mar 2017, 05:45

boiler wrote:How did I miss your parameter hint hotstring script? I thought I see every new thread in that forum, but somehow I missed that. That is just what I was looking for! Thanks for sharing it. Looking forward to your auto-complete script as well. I probably will switch to Notepad++ full time now thanks to this.

Glad you find it useful :)
boiler wrote:Perhaps you should cross-post a link to that thread in the Editors forum.

Editor forum description wrote:Discuss features, issues, about Editors for AHK

Posting the hotstring script there could be considered off topic, although it is meant to be used with your ahk-editor :think: . I'll consider posting the auto-complete script under editors, if I complete it. If a moderator reads this, your comments in the matter would be appreciated.
User avatar
boiler
Posts: 2370
Joined: 21 Dec 2014, 02:44

Re: Custom Function Documentation using SciTE

09 Mar 2017, 08:06

After a month-long discussion about starting up the Editors forum, I feel confident that this is exactly what it is for. The mods are the ones that moved the other similar threads there like the "Setup Notepad++ for AutoHotkey" to that forum. It's an extension that makes that editor more useful specifically for AutoHotkey. I understand wanting to have a mod weigh in on it. Hopefully they will confirm this view.
User avatar
jNizM
Posts: 2317
Joined: 30 Sep 2013, 01:33
GitHub: jNizM
Contact:

Re: Custom Function Documentation using SciTE

09 Mar 2017, 08:21

@Helgef is your hotstring parameter function for editors?
[AHK] 1.1.28.02 x64 Unicode | [WIN] 10 Pro (Version 1803) x64 | [GitHub] Profile
Donations are appreciated if I could help you
Helgef
Posts: 2990
Joined: 17 Jul 2016, 01:02
Contact:

Re: Custom Function Documentation using SciTE

09 Mar 2017, 09:00

@ boiler, I agree.
@ jNizM, indeed it is.
User avatar
jNizM
Posts: 2317
Joined: 30 Sep 2013, 01:33
GitHub: jNizM
Contact:

Re: Custom Function Documentation using SciTE

09 Mar 2017, 09:30

Welcome to your new home @Editors-Subforum =)
[AHK] 1.1.28.02 x64 Unicode | [WIN] 10 Pro (Version 1803) x64 | [GitHub] Profile
Donations are appreciated if I could help you

Return to “SciTE4AutoHotkey”

Who is online

Users browsing this forum: No registered users and 2 guests