notskm / vscode-clang-tidy

MIT License
49 stars 25 forks source link

Fix: Diagnostics sometimes aren't being reported #36

Closed notskm closed 4 years ago

notskm commented 4 years ago

For some reason, the regex matching clang-tidy's yaml output sometimes failed. I couldn't make a regex that worked consistently.

The solution is to use string.search with a very simple regex that matches a "---" line exactly. This gives us the index where the yaml part of clang-tidy's output begins. From there, string.substring gives us the full yaml text.