About Store Forum Documentation Contact



Post Reply 
[Code Editor] Bugs
Author Message
Driklyn Offline
Member

Post: #1
[Code Editor] Bugs
So, I've been using the Code Editor for a week now and I've been finding quite a few bugs, some I've already reported (which are now fixed), this thread is for the rest of them.

Struct constructors within a class:

This one I would like to see fixed as soon as possible, if you have the time smile

PHP Code:
class MyClass
{
    
struct MyStruct
    
{
        
Str8 myString;

        
MyClass::MyStruct(             ) {                        } // works...
        
MyClass::MyStruct(Str8 myString) { T.myString myString; } // doesn't work...
    
}


Code:
Error: class dependency.
class "MyClass" is dependent on the following classes:
    "MyClass"

This one doesn't seem to be a Visual Studio error. It occurs right away, before any project building begins. The same code works in Visual Studio.


Project building:

Code Editor does not detect the following as "changes" so it skips building altogether and simply loads the pre-existing .exe:

Undo:
Make a change, build the project, close the .exe, hit Undo, build the project again (it skips this step).

Adding/removing/updating certain functions/variables:
Sometimes when you add, remove, or change a function or variable, you get a whole bunch of errors related to pre-existing code that you know is error-free. Once you hit rebuild, these errors go away.

Changes while the project is being built:
Build the project, type a few keys into the editor, close the .exe, build the project again (it skips this step).


Current solution: You must rebuild the project.


World objects:

PHP Code:
Game::World.init().setObjType(); // doesn't work (builds, but ObjMemx elms is 0)

Game::World.init();
Game::World.setObjType(); // works (must be on a separate line) 
04-28-2011 08:33 AM
Find all posts by this user Quote this message in a reply
Esenthel Online
Administrator

Post: #2
RE: [Code Editor] BUGS!
thanks,
Quote:Struct constructors within a class:
this will work in next sdk release

Quote:Adding/removing/updating certain functions/variables:
Sometimes when you add, remove, or change a function or variable, you get a whole bunch of errors related to pre-existing code that you know is error-free. Once you hit rebuild, these errors go away.
I know about this, but not sure where's the bug in the codes, it happens during editing, if you know exact steps how to reproduce this , please let me know, like this:
step1 : with this .es source code file "..."
step2 : type this in line ..
step3 : errors occur

Code:
Game::World.init().setObjType(); // doesn't work (builds, but ObjMemx elms is 0)

Game::World.init();
Game::World.setObjType(); // works (must be on a separate line)
are you sure?
I've just tested it and it works fine, this code in .es
Code:
void proc()
{
   Game.ObjMemx<Game.Chr> chrs;
   Game::World.init().setObjType(chrs,0); // doesn't work (builds, but ObjMemx elms is 0)

   Game::World.init();
   Game::World.setObjType(chrs,0); // works (must be on a separate line)
}
gets translated into this code in .cpp
Code:
void proc()
{
   Game::ObjMemx<Game::Chr> chrs;
   Game::World.init().setObjType(chrs,0); // doesn't work (builds, but ObjMemx elms is 0)

   Game::World.init();
   Game::World.setObjType(chrs,0); // works (must be on a separate line)
}

you can use "menu/play/open in visual studio" to see what gets produced as CPP

Quote:Undo:
Make a change, build the project, close the .exe, hit Undo, build the project again (it skips this step).
Changes while the project is being built:
Build the project, type a few keys into the editor, close the .exe, build the project again (it skips this step).
will be fixed
04-28-2011 10:34 AM
Find all posts by this user Quote this message in a reply
Esenthel Online
Administrator

Post: #3
RE: [Code Editor] Bugs
fixes are available on Autoupdate (7z is still uploading)
04-28-2011 11:37 AM
Find all posts by this user Quote this message in a reply
Driklyn Offline
Member

Post: #4
RE: [Code Editor] Bugs
(04-28-2011 10:34 AM)Esenthel Wrote:  I know about this, but not sure where's the bug in the codes, it happens during editing, if you know exact steps how to reproduce this , please let me know, like this:
step1 : with this .es source code file "..."
step2 : type this in line ..
step3 : errors occur

I think this requires a fairly lengthy file before you start seeing these errors. I can't seem to reproduce it in a simple code sample; however, if you download and run the EEDevTools Code Editor project, it is quite easy to reproduce.

Be sure to build the project once before doing these methods:

  1. Open Console.es, cut and paste the entire Data struct (it's at the top) to right above the "class Console" line. Hit build, and you should get some errors. Hit rebuild at this point, and the errors go away. If you undo until Data becomes apart of Console once again, the same errors reappear until you hit rebuild.
  2. Cut the "public:" keyword (about 40% down the file) and paste it above the "Bool validCommand()" method (it's the first method above "public:"), build, and you will get errors. Note: Be sure to delete the : and re-type it, or else you'll get a syntax error (another bug?)

(04-28-2011 10:34 AM)Esenthel Wrote:  are you sure?
I've just tested it and it works fine, this code in .es

You must actually load objects from a world. I should have noted that.

Code:
Game::World.init().setObjType(Players, Game::World.objType("OBJ_CHR")).New(); // elms = 0

Game::World.init();
Game::World.setObjType(Players, Game::World.objType("OBJ_CHR")); // elms = 1
Game::World.New();

You can also test this inside of the EEDevTools project. In Main.es, just comment out the objType("OBJ_CHR") line and add it onto the init() line. The camera will then load at Vec(0) and not be attach to any player.

(04-28-2011 10:34 AM)Esenthel Wrote:  you can use "menu/play/open in visual studio" to see what gets produced as CPP

Yes, I do that quite often when I get errors I can't figure out...

----------

Thanks for all the fixes thus far!
(This post was last modified: 04-30-2011 12:35 AM by Driklyn.)
04-30-2011 12:30 AM
Find all posts by this user Quote this message in a reply
Esenthel Online
Administrator

Post: #5
RE: [Code Editor] Bugs
Quote:Game::World.init().setObjType(Players, Game::World.objType("OBJ_CHR")).New(); // elms = 0

Game::World.init();
Game::World.setObjType(Players, Game::World.objType("OBJ_CHR")); // elms = 1
Game::World.New();
I'll fix that, but it's not related to Code Editor (it happens in VS too)
Quote:1.Open Console.es, cut and paste the entire Data struct ..
fixed
Quote:2.2.Cut the "public:" keyword
fixed
04-30-2011 09:39 AM
Find all posts by this user Quote this message in a reply
Driklyn Offline
Member

Post: #6
RE: [Code Editor] Bugs
(04-30-2011 09:39 AM)Esenthel Wrote:  I'll fix that, but it's not related to Code Editor (it happens in VS too)

Interesting. I didn't actually test that in VS until now (I just assumed it would work); however, I don't understand why this doesn't work. How does splitting the code into two lines instead of one make a difference?

----------

Usability Issues:

Multiline functions:
Let's say you're using a single D.text call to print out 5 variables, but you don't want to put them on one line because that line would become rather lengthy, so you decide to put each variable on a new line like so:

Code:
D.text(0, 0, S + "a => " + a
               + "b => " + b
               + "c => " + c
               + "d => " + d
               + "e => " + e);

This is nearly impossible to type because the Header Browser window that pops up is sitting on top of the text, as it does not get pushed down when you hit Enter to go to a new line.

Autocompletion window off the screen:
Type enough text (doesn't really matter what) so that a horizontal scrollbar appears. Then, type a period so the autocomplete window appears. It shows up nearly entirely off the right side of the screen, so you can't read anything that's on it, making it impossible to use at that point.

End of Line Cursor Clip:
You added this option a week or so ago, but it only applies for the mouse. If you use the up/down arrows, it does not clip to the end of the line.

Also, I just noticed that clicking on an empty line at the end of a file, clips the cursor to the last line of text (thanks for that!); however, if you double click, it still goes to wherever you clicked at. Not that big of deal, just thought I'd bring it up...
05-01-2011 01:21 AM
Find all posts by this user Quote this message in a reply
Esenthel Online
Administrator

Post: #7
RE: [Code Editor] Bugs
Quote:Multiline functions:
thanks, cursor position will affect this in next SDK
Quote:End of Line Cursor Clip:
I don't plan to change this
05-01-2011 10:15 AM
Find all posts by this user Quote this message in a reply
Driklyn Offline
Member

Post: #8
RE: [Code Editor] Bugs
Here's some more bugs/usability issues I've ran into over the past few weeks...

Bugs:

Renaming is case-insensitive:
For example, renaming a file from "main.es" to "Main.es" has no effect.

Can't type text codes:
Typing "[ color=FF0000 ]" or "[ /color ]" (without the spaces, of course) is impossible as the text is automatically formatted inside Code Editor (same in Header Browser, find Text::code and you'll see the sample text is actually red, it doesn't say "[ color=FF0000 ]Text with code[ /color ]").

Broken REP/FREP autocompletion window:
For example, typing "FREP(D." does not bring up any autocompletion window.

Pointer to non-pointer build error:
I believe this one requires a lengthy class before it will occur, but it occurs along these lines:

PHP Code:
class MyClass
{
    
CMenuElm *elm;
}

MyClass myClass;
myClass.elm.setOn(true); // will crash upon execution, but that's irrelevant 

Build and run the program, then remove the * from *elm and re-build, you will get the following error:

Code:
error C2819: type 'EE::CMenuElm' does not have an overloaded member 'operator ->'
did you intend to use '.' instead?

As you can see, it's building it as a pointer, which it no longer is. A simple rebuild fixes this problem currently. Again, this only appears to happen within a lengthy class.

Adding elements to Node<CMenuElm> issues:
  1. Autocompletion:
    PHP Code:
    Node<CMenuElmnode;
    Node<CMenuElm> &file = (node += "File");

    file.New(). // autocomplete only shows "children" and "New()", which is inaccurate 
  2. Simplified creation:
    PHP Code:
    file.New().create("Save").kbsc(KbSc(KB_F2)); // doesn't work, outputs "->kbsc" instead of ".kbsc"

    CMenuElm &save file.New();
    save.create("Save").kbsc(KbSc(KB_F2)); // works 

Static array declaration doesn't work:
  1. As class member:
    PHP Code:
    class MyClass
    {
        
    // gives redeclaration error due to missing [] in initialization in VS
        
    static CChar *qualities[] = { "Lowest""Low""Medium""High""Highest" };

  2. As global:
    PHP Code:
    // incorrectly adds "static" to header file in VS causing C2159 error
    static CChar *qualities[] = { "Lowest""Low""Medium""High""Highest" }; 

Usability Issues:

Esc to cancel builds:
Would be nice if you could press 'Esc' to cancel builds.

Shift+Click doesn't select text:
Shift+Click should select text like how Click+Drag does.

VS Autodetection doesn't work for me:
I'm using Windows 7 64-bit and VS2010. I'm assuming it's not detecting VS properly either because my VS is installed to "C:\Program Files (x86)\Microsoft Visual Studio 10.0", or because I'm using 2010 instead of 2008.
05-20-2011 09:15 AM
Find all posts by this user Quote this message in a reply
Morto Offline
Member

Post: #9
RE: [Code Editor] Bugs
Hi,

the static is not just on array declaration i think its wide.

for instance
Code:
//this does not work gives the error C2159: more than one storage class specified
static Memc<Str> SkelFiles,AnimFiles,MeshFiles,ObjFiles;


it can't be my code

Code:
static Memc<Str> SkelFiles,AnimFiles,MeshFiles,ObjFiles;

void InitPre()
{
   App.name("Esenthel MMO Server");
   App.flag=APP_WORK_IN_BACKGROUND|APP_NO_FX|APP_MINIMIZABLE;
   D.sync(true);
   DataPath("../../Data");
   Paks.add("engine.pak");
}
Bool Init()
{
  
   return true;
}
void Shut()
{
}
Bool Update()
{
   if(Kb.bp(KB_ESC))return false;
   return true;
}
void Draw()
{
   D.clear(GREY);
   D.text(0,0.9f,"Hello World");
}
05-20-2011 11:17 AM
Find all posts by this user Quote this message in a reply
Esenthel Online
Administrator

Post: #10
RE: [Code Editor] Bugs
@Morto: global static variables which are not inside class are not currently supported (all variables are visible across all files) - remove static keyword
@Driklyn : I'll check those things
05-22-2011 07:03 PM
Find all posts by this user Quote this message in a reply
Morto Offline
Member

Post: #11
RE: [Code Editor] Bugs
Thanks Esenthel,
thats what i did.

sorry Driklyn for using your thread for this next question.
Esenthel there is another thing that i didn't find a workaround, thats the
Code:
#define SOMECONSTANT 123
is not working on the code editor.

is this intended ?
05-23-2011 02:08 AM
Find all posts by this user Quote this message in a reply
Esenthel Online
Administrator

Post: #12
RE: [Code Editor] Bugs
Custom macros is on the roadmap
Please use const int
05-23-2011 10:18 AM
Find all posts by this user Quote this message in a reply
Post Reply