question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Sometimes problem matchers don't find the end pattern on Windows

See original GitHub issue

I have the following task.json:

{
  "type": "npm",
  "script": "watch-esbuild",
  "group": "build",
  "isBackground": true,
  "problemMatcher": {
    "fileLocation": "relative",
    "pattern": [
      // Doesn't match esbuild errors, just here to get background to work
      {
        "regexp": "^([^\\\\s].*)\\\\((\\\\d+,\\\\d+)\\\\):\\\\s*(.*)$",
        "file": 1,
        "location": 2,
        "message": 3
      }
    ],
    "background": {
      "activeOnStart": true,
      "beginsPattern": "build started",
      "endsPattern": "build finished"
    }
  },
  "presentation": {
    "group": "vscode"
  }
},

Sometimes this happens where the problem matcher never stops it’s progress indicator:

image

This is because of conpty causing onLineData to fire something unexpected. Given that this problem isn’t likely to go away from conpty, what if on Windows we verified the last line was actually checked after the terminal has been idle for a little bit, that way the problem would be self correcting for a lot of cases shortly after builds finish (provided the end pattern was the last line).

Version: 1.69.0-insider (user setup) Commit: fbf1cf3832d43088e27837dbb68d24ab65a098c1 Date: 2022-06-17T05:16:33.731Z Electron: 18.3.3 Chromium: 100.0.4896.160 Node.js: 16.13.2 V8: 10.0.139.17-electron.0 OS: Windows_NT x64 10.0.22000

Issue Analytics

  • State:open
  • Created a year ago
  • Reactions:1
  • Comments:6 (6 by maintainers)

github_iconTop GitHub Comments

1reaction
r3m0tcommented, Jul 15, 2022

Looks like my issue is a separate one, webpack isn’t emitting newlines so onLineData isn’t fired- (I have process.env.WEBPACK_CLI_START_FINISH_FORCE_LOG set to “1” )

https://github.com/webpack/webpack-cli/blob/d390d32fe0f2491c5cc3a8dfae3ccc3962a5911b/packages/webpack-cli/src/plugins/CLIPlugin.ts#L58-L61

esbuild does emit newlines as shown in @Tyriar 's screenshot and here:

https://github.com/evanw/esbuild/blob/698898f86615a69f52d2e00681a13fe2b8635e88/pkg/api/api_impl.go#L1269

I didn’t repro @Tyriar 's issue. I think I’ll just submit a PR to webpack to solve my issue.

Read more comments on GitHub >

github_iconTop Results From Across the Web

IsMatch, Match, and MatchAll functions in Power Apps
The IsMatch function tests whether a text string matches a pattern that can comprise ordinary characters, predefined patterns, or a regular ...
Read more >
regex - Match linebreaks - \n or \r\n? - Stack Overflow
I'm fully aware of the m -flag (multiline - makes ^ match the start and $ the end of a line), but sometimes...
Read more >
Everything you need to know about Regular Expressions
After reading this article you will have a solid understanding of what regular expressions are, what they can do, and what they can't...
Read more >
Tasks in Visual Studio Code
When prompted for the problem matcher to use, select ESLint stylish. Tasks ESLint Problem ... Sometimes it is necessary to define your own...
Read more >
Lookahead and Lookbehind Tutorial—Tips &Tricks - RexEgg
It is that at the end of a lookahead or a lookbehind, the regex engine ... Therefore, do not expect the pattern A(?=5)...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found