Support MSbuild row-column format in PathWithPosition (#15589)

This implements #15412. Row-column parsing is changed into a regex to
support more complex patterns like the MSBuild diagnostics. Terminal
`word_regex` is also relaxed to match those suffixes.

Release Notes:

- N/A
This commit is contained in:
Santeri Salmijärvi 2024-08-09 10:21:56 +03:00 committed by GitHub
parent 7a600411cf
commit 06833d7360
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
2 changed files with 86 additions and 63 deletions

View file

@ -427,7 +427,10 @@ impl TerminalBuilder {
let _io_thread = event_loop.spawn(); // DANGER
let url_regex = RegexSearch::new(r#"(ipfs:|ipns:|magnet:|mailto:|gemini://|gopher://|https://|http://|news:|file://|git://|ssh:|ftp://)[^\u{0000}-\u{001F}\u{007F}-\u{009F}<>"\s{-}\^⟨⟩`]+"#).unwrap();
let word_regex = RegexSearch::new(r#"[\$\+\w.\[\]:/\\@\-~]+"#).unwrap();
// Optional suffix matches MSBuild diagnostic suffixes for path parsing in PathLikeWithPosition
// https://learn.microsoft.com/en-us/visualstudio/msbuild/msbuild-diagnostic-format-for-tasks
let word_regex =
RegexSearch::new(r#"[\$\+\w.\[\]:/\\@\-~]+(?:\((?:\d+|\d+,\d+)\))?"#).unwrap();
let terminal = Terminal {
task,