Sublime Forum

Sublime Warning Messages

#1

For some reason, when I downloaded sublime text 3 about 10 months ago, I got these really nice warning/error messages that would pop up whenever I did something wrong/worthy of a warning. While this is present on my laptop, no matter how many times I try copying sublime to my new computer, these error/warning messages no longer show up. I don’t remember downloading a plugin, so I have no clue where these came from, but I want to keep them on my new system. Any help you guys could give me would be highly appreciated.

0 Likes

#2

Are you using a build system that you created yourself, one from a package or the one that ships with Sublime?

Inline build errors are placed there as a result of doing a build, but a few things need to be in place for them to work the way you expect.

First, the following setting needs to be enabled. As seen here it’s enabled by default, so this is probably not the issue unless you accidentally turned it off.

    // Shows build errors just under the line on which they occur.
    "show_errors_inline": true,

The setting tells the build system that it should display errors in files, but it also requires that the build system, you’re using (i.e. the sublime-build file) to contain a file_regex (and possibly also line_regex, depending on the tools used in the build) that is capable of capturing the errors in the output.

These capture the same build errors as are used to power the navigation between errors via the menu items in Tools > Build Results or the associated keys. If using those commands after a build navigates you somewhere, then the errors are being captured; otherwise that’s the problem.

The last thing is that by default build systems use the exec command to execute tools used during the build, and it’s the exec command that is injecting the error phantoms into the file. It’s possible for a build system to specify a different command to execute the build, in which case that command becomes responsible for making sure that the phantoms are displayed. You can double check that by looking at the sublime-build file to see if it contains a target key; if it does not, it’s using exec.

1 Like

#3

I am using “bash on ubuntu on windows” to compile my files, but it seems sublime uses cmd ( [shell_cmd: g++ “C:\Users\demarj3\Dropbox\CompOrg\Labs\lab11\lab11.c” -o “C:\Users\demarj3\Dropbox\CompOrg\Labs\lab11/lab11”] ). I ran my program through cmd and got the same warnings, but I’m not sure why they show up on this build and not my other. I’ll look more into what you said when I get back home. Thank you for the quick response!

0 Likes

#4

The cmd and shell_cmd arguments are used to determine what should be executed, but it’s the exec command that’s doing the job of actually running the commands that are outlined in those arguments (if you’re curious, you can use View Package File from the command palette to open Default/exec.py and see what it’s doing).

The C++ Single File build that ships with Sublime should support this out of the box, but it sounds like you may have created your own build file or used one made by someone else? It may be a good idea to check that the same build is being used on both machines just to be sure. :slight_smile:

1 Like

#5

Interesting stuff! The error ended up being that I hadn’t added mingw to my PATH properly, resulting in no error/warning messages from gcc/g++. Typically CS student looking in the wrong area to solve a problem. Thanks again for all the help!

1 Like