bobbyache / CodeCat

Store and search for code snippets
GNU General Public License v3.0
0 stars 0 forks source link

Qik Script causes "Unsupported Declaration Argument" when Title is lower case. #109

Closed bobbyache closed 7 years ago

bobbyache commented 7 years ago

This script causes a big error in codeCat. See @dataType text... Occurs because the "Title" parameter is a lower case "title" parameter. Need to fail gracefully in this case!

When this error happens, every time you open CodeCat it crashes if this section is auto-loaded. First thought it was an issue with the new Visual Studio 2017 that you upgraded to!

@table = text [Title="1. Table", Description="The table you wish to add/remove the foreign key to/from."];
@field = text [Title="2. Field", Description="The field in this table that will be the foreign key."];
@foreignTable = text [Title="3. Table (Foreign)", Description="The foreign table."];
@foreignField = text [Title="4. Field (Foreign)", Description="The primary key column int the foreign table."];

@dataType = text[title="5. Field Datatype)", Description="The datatype for the field (column)."];

@foreignKey = expression [Title="Foreign Key Identifier", Description="The name of the foreign key as stored in the database."] {
    return "FK_" + @table + "_" + replace(@field, "Id", "");
};
bobbyache commented 7 years ago

So if you put a breakpoint on:

private void errorReport_ExecutionErrorDetected(object sender, CompileErrorEventArgs e) ...

You'll see that the error does actually get thrown, but it seems that nothing is hooking up to it on the front-end! Need to find out why the front end is not handling this!

CompileEngine.cs, Line 125.

bobbyache commented 7 years ago

Use the test gui to ensure event is being fired. Check it can / is handled at the right time. Why does it get handled in some places but not in others? You should find a way to test...

https://stackoverflow.com/questions/3387134/test-events-with-nunit

https://stackoverflow.com/questions/1429587/verifying-event-registration-using-moq