Sign in to follow this  

What are you thinking about refactoring AngelScript scripts?

This topic is 2048 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

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 ?

Share this post


Link to post
Share on other sites
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. Edited by Andreas Jonsson

Share this post


Link to post
Share on other sites
[quote] 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

[b]where is definition[/b]( ctrl + mouse click )

[b]where is use[/b] ( find use, rename, height light after select )

[b]classes in this file [/b]( 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)

[CODE]
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
[/CODE]

Share this post


Link to post
Share on other sites
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.

Share this post


Link to post
Share on other sites
I've heard that [url="http://www.codelite.org/"]codelite [/url]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.

Share this post


Link to post
Share on other sites
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 :)

Share this post


Link to post
Share on other sites
[quote name='Andreas Jonsson' timestamp='1336070704' post='4937175']
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.
[/quote]

let's wait[img]http://public.gamedev.net//public/style_emoticons/default/smile.png[/img]

Share this post


Link to post
Share on other sites
[quote name='saejox' timestamp='1336069415' post='4937168']
Is it possible to trick visual studio to run intellisense with Angelscript?

syntax is similar enough that it might just work.
[/quote]

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.

Share this post


Link to post
Share on other sites
[quote name='Andreas Jonsson' timestamp='1336070704' post='4937175']
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.
[/quote]
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 :).

Share this post


Link to post
Share on other sites

This topic is 2048 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

Sign in to follow this