Skip to content

evandroforks/HighlightBuildErrors

 
 

Repository files navigation

Highlight Build Errors

A plugin for Sublime Text 3 that highlights the lines that caused errors in the build.

Screen capture with the Monokai theme

Feature

  • Does only one thing: highlights the erroneous lines after a build
  • Highlights are visible in the mini-map
  • Customizable display (fill, outline, underline, icon...)
  • Works fine with Better Build System

Installation

By Package Control

  1. Download & Install Sublime Text 3 (https://www.sublimetext.com/3)
  2. Go to the menu Tools -> Install Package Control, then, wait few seconds until the installation finishes up
  3. Now, Go to the menu Preferences -> Package Control
  4. Type Add Channel on the opened quick panel and press Enter
  5. Then, input the following address and press Enter
    https://raw.githubusercontent.com/evandrocoan/StudioChannel/master/channel.json
    
  6. Go to the menu Tools -> Command Palette... (Ctrl+Shift+P)
  7. Type Preferences: Package Control Settings – User on the opened quick panel and press Enter
  8. Then, find the following setting on your Package Control.sublime-settings file:
    "channels":
    [
        "https://packagecontrol.io/channel_v3.json",
        "https://raw.githubusercontent.com/evandrocoan/StudioChannel/master/channel.json",
    ],
  9. And, change it to the following, i.e., put the https://raw.githubusercontent... line as first:
    "channels":
    [
        "https://raw.githubusercontent.com/evandrocoan/StudioChannel/master/channel.json",
        "https://packagecontrol.io/channel_v3.json",
    ],
    • The https://raw.githubusercontent... line must to be added before the https://packagecontrol.io... one, otherwise, you will not install this forked version of the package, but the original available on the Package Control default channel https://packagecontrol.io...
  10. Now, go to the menu Preferences -> Package Control
  11. Type Install Package on the opened quick panel and press Enter
  12. Then, search for HighlightBuildErrors and press Enter

See also:

  1. ITE - Integrated Toolset Environment
  2. Package control docs for details.

Configuration

As many Sublime Text plugins, the configuration can be modified from the menu Preferences / Package Settings / Hightlight Build Errors.

Here is the content of the default settings file:

{
  // the plugin tests each regex and stops at the first match
  // "scope" is a key in the .tmTheme file
  // "display" can be "fill", "outline", "solid_underline", "stippled_underline" or "squiggly_underline"
  "colors": [
   {
      "regex": "note",
      "icon": "Packages/Highlight Build Errors/information.png"
    },
    {
      "regex": "warning",
      "scope": "invalid",
      "display": "outline",
      "icon": "Packages/Highlight Build Errors/warning.png"
    },
    {
      // default color, when none of the above matches
      "scope": "invalid",
      "display": "fill",
      "icon": "Packages/Highlight Build Errors/error.png"
    }
  ]
}

You can specify a regex on your project settings like this

{
  "build_systems":
  [
    {
      // ...
    }
  ],
  "folders":
  [
    {
      "path": "."
    },
  ],
  "settings":
  {
    "tab_size": 2,
    "highlight_build_errors_result_file_regex": "^(..[^:]*):([0-9]+):?([0-9]+)?:? (.*)$"
  }
}

The highlight_build_errors_result_file_regex will be used for your project, instead of the standard file_regex.

The highlight_build_errors_result_file_regex an alternate error file regex for you build system, other than the standard file_regex as when it is capturing more things which are not errors.

Usage

Build as usual (Ctrl+B or Cmd+B).

Erroneous words or lines will be highlighted in the source files.

Contributors

Credits

License

See the LICENSE file under this repository.