Adventure Game Studio

AGS Support => Advanced Technical Forum => Topic started by: RickJ on Sun 30/11/2003 18:56:44

Title: Suggestion: Script Editor
Post by: RickJ on Sun 30/11/2003 18:56:44
CJ I am really impressed the latest enhancements of the script editor.  I of course really like the autocomplete and the popup help, really nice.

I have recently discovered that if you select a block of stuff and press tab the whole block is tabbed over, really cool.  The only thing is that the tab setting is something like 8 spaces over.  

What I was wondering is this:  In the future would it be possible to expose the editor's config file so that we can modify it  or alternatively would it be possible to publish the lang/config file that contains the auto-complete stuff so that we could use Scite as our external editor and still have the auto-complete features?  

I think that something similiar to what I have suggested would address many feature requests from advanced scripters.  

Really nice work Chris.  It's greatly appreciated.
Title: Re:Suggestion: Script Editor
Post by: Pumaman on Sun 30/11/2003 19:36:30
Well, the editor doesn't have a config file - it just uses the default settings for the Scintilla control.

As for publishing the autocomplete file - yes, that's possible, do you know what format Scite needs the file in? I've never used it myself.
Title: Re:Suggestion: Script Editor
Post by: RickJ on Sun 30/11/2003 21:48:47
Scite is just a scintilla wrapper so I'm thinking that probably you already have something that is very close, if not exactly the same thing as the .api files required by SciTE.

Here is what the SciTE website has to say about it.  Is this similar to what you are doing with the internal editor?  Maybe using the C++ lexer and an ags.api  lang file?

http://www.scintilla.org/SciTEDoc.html (http://www.scintilla.org/SciTEDoc.html)
Quote
Supporting a new language

For languages very similar to existing supported languages, which may only differ in a minor feature such as the keywords used, the existing lexers can often be reused. The set of keywords can then be changed to suit the new language. Java and JavaScript could have reasonably reused the C++ lexer. The Java lexer was added only to support doc comments.

For languages that can not be lexed with the existing lexers, a new lexer can be coded in C++.

Installing a lexer into SciTE

The open.filter should be modified to include the file extensions used for the new language and entries added for command.compile, command.build, command.go and command.go.needs for the language.


Creating API files

The .api files can be generated by hand or by using a program.

For C/C++ headers, an API file can be generated using ctags and then the tags2api Python script (which assumes C/C++ source) on the tags file to grab complete multiple line function prototypes. Some common headers surround parameter lists with a __P macro and may have comments. The cleanapi utility may be used on these files.

To generate an API file for Python modules, there is a gen_python script.

To generate an API file for Java classes, there is a ApiBuilder.java program.  

I appologize if this ends up being a huge undertaking.  However if it's a matter of including a file or two (that may already exist)  then if would be worth the effort.  If I can be of any help please let me know.  Thanks for listening.
Title: Re:Suggestion: Script Editor
Post by: Pumaman on Sun 30/11/2003 22:38:02
Yep, I'm using the C lexer with a custom keyword list. They are:

"int char short long void return function string if else while struct import export"

The autocomplete uses the following file, which is parsed by the editor and put into scintilla - you might need to modify it to get Scite to recognise it:

http://www.agsforums.com/scriptFuncDefs.txt
Title: Re:Suggestion: Script Editor
Post by: RickJ on Mon 01/12/2003 08:22:24
Thanks CJ.  That's exactly what I need.  When I get something optimized for AGS I'll document and make available for the rest of the crew.   The text file only needs to be renamed  ro something.api and the keywords need to be put into a property file.  

If I can make this work a few of us should get some benefit.  Thanks.