What are you thinking about refactoring AngelScript scripts?

Started by
8 comments, last by virious 11 years, 11 months ago
Hi Andreas!


I really love AngelScript!!!

But, i need to write scripts, many many code lines, and need to change, change code!

when code lines > 10, 20k it a realy problem!

What are you thinking about refactoring code ?
Advertisement
You mean in terms of having an IDE to help automate refactoring, e.g. identify all locations where a function call needs to be modified, or renaming classes, etc?

I have no plans on writing an IDE myself, as I'm fully occupied with the library itself. Though if someone wants to do so I'll gladly aid with any features that might be necessary in AngelScript to make it easier to write that.

AngelCode.com - game development and more - Reference DB - game developer references
AngelScript - free scripting library - BMFont - free bitmap font generator - Tower - free puzzle game

identify all locations where a function call needs to be modified, or renaming classes, etc?[/quote]

yes yes yes!

AngelScript have methods for work to debbug - it's greate work, easy implement !

and need functions to work with refactoring

where is definition( ctrl + mouse click )

where is use ( find use, rename, height light after select )

classes in this file ( see pix )


and if possible, work to intellisense, I do not know maybe it's done or not - because Information will need at the time of writing the script (which means the script will not compile)


class Dog
{
void Gav(){}
void Sleep(){}
void Update(){}
}

Dog a;

a. <- after wrilte '.' get type from var "a", and get all method's to show
Is it possible to trick visual studio to run intellisense with Angelscript?

syntax is similar enough that it might just work.
The implementation of these kind of things belong in the IDE.

There are however a few things that I'm planning on implementing in AngelScript that might help with the implementation of an IDE. One such is to add methods for querying where a function or other entity has been declared (i.e. script section and line number). I may also implement ways to enumerate what variables and functions that are accessed from a function.

Still, all that I will implement will only work on scripts that compile correctly. An IDE should be able to work with scripts that are not compiled too, so it needs to have it's own parser that can identify declarations etc on its own, without first compiling the script.

The code that is in the CScriptBuilder add-on shows how declarations can be identified without compiling the script, as this is used to collect the metadata for functions and variables before compiling the scripts.

AngelCode.com - game development and more - Reference DB - game developer references
AngelScript - free scripting library - BMFont - free bitmap font generator - Tower - free puzzle game

I've heard that codelite has support for intellisense with AngelScript code. I haven't tried it myself though, nor do I know if it is part of the stable release or if requires manual compilation of the codelite source code from a specific branch.

AngelCode.com - game development and more - Reference DB - game developer references
AngelScript - free scripting library - BMFont - free bitmap font generator - Tower - free puzzle game

Good news for Visual Assist X users!

Add *.as extension to HKEY_CURRENT_USER\Software\Whole Tomato\Visual Assist X\ at ExtSource

Code completion works, jump to implementation work, parses all files in project, Find references works, knows class methods and members, Renaming works etc... lots of stuff work.

why was i struggling with text editors :)

The implementation of these kind of things belong in the IDE.

There are however a few things that I'm planning on implementing in AngelScript that might help with the implementation of an IDE. One such is to add methods for querying where a function or other entity has been declared (i.e. script section and line number). I may also implement ways to enumerate what variables and functions that are accessed from a function.

Still, all that I will implement will only work on scripts that compile correctly. An IDE should be able to work with scripts that are not compiled too, so it needs to have it's own parser that can identify declarations etc on its own, without first compiling the script.

The code that is in the CScriptBuilder add-on shows how declarations can be identified without compiling the script, as this is used to collect the metadata for functions and variables before compiling the scripts.


let's waitsmile.png

Is it possible to trick visual studio to run intellisense with Angelscript?

syntax is similar enough that it might just work.


It definitely is: http://www.gamedev.net/topic/594639-symbols-table-andor-syntax-tree/page__p__4806355#entry4806355
Some more screens: http://www.gamedev.net/topic/603001-creating-as-ide-thoughts/page__p__4817006#entry4817006
It needs a bit of preparations to work (like making a tool to replace T[] with array<T> all over the code), but once they are done, it requires no further maintenance and the benefits are great - most of the msvs features work like gold.

There are however a few things that I'm planning on implementing in AngelScript that might help with the implementation of an IDE. One such is to add methods for querying where a function or other entity has been declared (i.e. script section and line number). I may also implement ways to enumerate what variables and functions that are accessed from a function.

Still, all that I will implement will only work on scripts that compile correctly. An IDE should be able to work with scripts that are not compiled too, so it needs to have it's own parser that can identify declarations etc on its own, without first compiling the script.

That is great news to hear! Now I have to do many of this things by myself, adding them in the future to the library would clean up all the additional code I had to write for my intellisense sysem :).

This topic is closed to new replies.

Advertisement