# What are you thinking about refactoring AngelScript scripts?

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

## 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 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 on other sites
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 

##### Share on other sites
Is it possible to trick visual studio to run intellisense with Angelscript?

syntax is similar enough that it might just work.

##### 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 on other sites
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.

##### 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 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.

let's wait

##### Share on other sites

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.

##### Share on other sites

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 .

1. 1
2. 2
Rutin
25
3. 3
4. 4
5. 5

• 9
• 13
• 19
• 14
• 9
• ### Forum Statistics

• Total Topics
632940
• Total Posts
3009328
• ### Who's Online (See full list)

There are no registered users currently online

×