Browse Source

Fixed prettier error message parsing, and can now run prettier on HTML files

merge-requests/399/head
eidheim 6 years ago
parent
commit
5f6c67458e
  1. 4
      src/source.cc

4
src/source.cc

@ -641,7 +641,7 @@ void Source::View::setup_signals() {
void Source::View::setup_format_style(bool is_generic_view) { void Source::View::setup_format_style(bool is_generic_view) {
static auto prettier = filesystem::find_executable("prettier"); static auto prettier = filesystem::find_executable("prettier");
if(!prettier.empty() && language && if(!prettier.empty() && language &&
(language->get_id() == "js" || language->get_id() == "json" || language->get_id() == "css")) { (language->get_id() == "js" || language->get_id() == "json" || language->get_id() == "css" || language->get_id() == "html")) {
if(is_generic_view) { if(is_generic_view) {
goto_next_diagnostic = [this] { goto_next_diagnostic = [this] {
place_cursor_at_next_diagnostic(); place_cursor_at_next_diagnostic();
@ -721,7 +721,7 @@ void Source::View::setup_format_style(bool is_generic_view) {
} }
} }
else if(is_generic_view) { else if(is_generic_view) {
static std::regex regex(R"(^\[error\] stdin: (.*) \(([0-9]*):([0-9]*)\)$)"); static std::regex regex(R"(^\[error\] [^:]*: (.*) \(([0-9]*):([0-9]*)\)$)");
std::string line; std::string line;
std::getline(stderr_stream, line); std::getline(stderr_stream, line);
std::smatch sm; std::smatch sm;

Loading…
Cancel
Save