1
Fork 0

Introduce -Zterminal-urls to use OSC8 for error codes

Terminals supporting the OSC8 Hyperlink Extension can support inline
anchors where the text is user defineable but clicking on it opens a
browser to a specified URLs, just like `<a href="URL">` does in HTML.

https://gist.github.com/egmontkob/eb114294efbcd5adb1944c9f3cb5feda
This commit is contained in:
Esteban Küber 2023-02-09 10:16:00 +00:00
parent a00e24d76a
commit a576514e13
16 changed files with 99 additions and 9 deletions

View file

@ -8,7 +8,7 @@ use rustc_span::{BytePos, Span};
use rustc_data_structures::sync::Lrc;
use rustc_errors::emitter::EmitterWriter;
use rustc_errors::{Handler, MultiSpan, PResult};
use rustc_errors::{Handler, MultiSpan, PResult, TerminalUrl};
use std::io;
use std::io::prelude::*;
@ -152,6 +152,7 @@ fn test_harness(file_text: &str, span_labels: Vec<SpanLabel>, expected_output: &
None,
false,
false,
TerminalUrl::No,
);
let handler = Handler::with_emitter(true, None, Box::new(emitter));
#[allow(rustc::untranslatable_diagnostic)]