Jump to content
  • Advertisement
Sign in to follow this  
LittleJimmy

Multiple callbacks for one build error?

This topic is 965 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

Hello,

 

I'm trying to figure out why a single error is split across more than one message callback during build, as an example:

namespace Test
{
    class Main
    {
        t
    }
}

produces 4 message callbacks:

 

1: Expected method or property

2: Instead found 't'

3: Unexpected end of file

4: While parsing namespace

 

I'm storing the errors in a vector as they're coming in and placing them into a list control and its looking weird with 2 errors producing 4 items in the list.

 

Is there a way to prevent this behaviour or perhaps find a way to combine error messages that link to the same error?

 

Thanks,

 

Share this post


Link to post
Share on other sites
Advertisement

Each message refers to a position in the code where the error, warning, or information was originated. If you wish you can combine the messages that have the same position into a single one.

 

But I really recommend that you show them as individual messages as they are given by the engine. Does it really matter if a problem generates 1 or 2 messages? The problem has to be fixed anyway, doesn't it?

 

In some cases, for example your messages 3 and 4 are originated by the same problem but are referring to two different positions. The message 'Unexpected end of file' will give the position of the end of the file, whereas the message 'While parsing namespace' is an informational message that will give the position of the start of the namespace that was being parsed while encountering the end of the file.

 

In other cases, for example when there are multiple function overloads the compiler will write a list of messages to show the possible candidates for a function call.

Share this post


Link to post
Share on other sites

Oh okay I see, no it doesn't really matter that much, I just thought I may have been doing something wrong that was causing it.

 

Thanks for the response Andreas!

Share this post


Link to post
Share on other sites

How ive seen it done in most compilers, is showing the error as one and then have a foldout to show the individual problems. Because many times the first one is not very informative. Also like how vsc++ does it is they have the output window (which has all the information warnings bugs compiler messages, status messages etc) and then they have error list (with the errors and warnings which can be sorted in a variety of ways). This is how i would handle it.

 

chasester

Share this post


Link to post
Share on other sites

How ive seen it done in most compilers, is showing the error as one and then have a foldout to show the individual problems. Because many times the first one is not very informative. Also like how vsc++ does it is they have the output window (which has all the information warnings bugs compiler messages, status messages etc) and then they have error list (with the errors and warnings which can be sorted in a variety of ways). This is how i would handle it.

 

Isn't that the IDE's responsibility? For example, GCC outputs multiple messages just like the example above, and QtCreator (the IDE) gets to decide how to display them. In your case, Microsoft's compiler (which has no GUI) outputs multiple messages and Microsoft's IDE (Visual Studio) is responsible for displaying it in a friendly manner.

 

AngelScript is the non-GUI compiler part (like GCC and Microsoft's compiler), and it's up to the caller to decide how to display that info (like QtCreator and Visual Studio). By providing more details (like different fragments of errors pointing at different lines) it gives more power and flexibility to the IDEs to decide what they want to display, and how they want to display it.

Share this post


Link to post
Share on other sites

 

How ive seen it done in most compilers, is showing the error as one and then have a foldout to show the individual problems. Because many times the first one is not very informative. Also like how vsc++ does it is they have the output window (which has all the information warnings bugs compiler messages, status messages etc) and then they have error list (with the errors and warnings which can be sorted in a variety of ways). This is how i would handle it.

 

Isn't that the IDE's responsibility? 

 

i just figured you where writing an IDE for your game/editor. How you handle call back response is really up to you. Saying you are releasing (what ever) soley as a game then there would be no need for an IDE (unless you really hate trying to figure out whats going on). But if you want to make it modible or you are releasing it as more of a game/engine, then I think a friendly IDE would definitely help with any kind of user made code. But of course its not a "requirement" my any standard.

 

chasester

Share this post


Link to post
Share on other sites
Sign in to follow this  

  • Advertisement
×

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

We are the game development community.

Whether you are an indie, hobbyist, AAA developer, or just trying to learn, GameDev.net is the place for you to learn, share, and connect with the games industry. Learn more About Us or sign up!

Sign me up!