Skip to content

Commit

Permalink
Fix sample conf
Browse files Browse the repository at this point in the history
  • Loading branch information
nilehmann committed Jul 8, 2024
1 parent 2b02516 commit 2dfc9d9
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 8 deletions.
7 changes: 3 additions & 4 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -63,13 +63,13 @@ echo = true

# `env` allows specifying additional environment variables for the child process.
[env]
CLICOLOR_FORCE = "1" # e.g., force ANSI colors
CLICOLOR_FORCE = "1" # e.g., try forcing ANSI colors
RUST_LIB_BACKTRACE = "0" # e.g., disable lib backtrace

# `links` configures the emission of hyperlinks for file paths in the backtrace output.
# `hyperlinks` configures the mission of hyperlinks for file paths in the backtrace output.
[hyperlinks]
enabled = true # Enable or disable hyperlinking.
url = "vscode://file${FILE_PATH}:{$LINE}:{$COLUMN}" # Template for generating file links.
url = "vscode://file${FILE_PATH}:${LINE}:${COLUMN}" # Template for generating file links.

# `hide` sections define rules to exclude specific frames from the backtrace output.
# Frames can be hidden based on regex patterns or ranges between start and end patterns.
Expand All @@ -82,5 +82,4 @@ pattern = "panic_macro::fn2" # Regex pattern to match frames for exclusion.
[[hide]]
begin = "core::panicking" # Start pattern.
end = "rust_begin_unwind" # End pattern (optional). If omitted, hides all subsequent frames.

```
8 changes: 4 additions & 4 deletions backtracetk.toml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# Backtracetk Configuration File
# Sample Configuration File

# `style` sets the backtrace detail level.
# Options:
Expand All @@ -13,13 +13,13 @@ echo = true

# `env` allows specifying additional environment variables for the child process.
[env]
CLICOLOR_FORCE = "1" # e.g., force ANSI colors
CLICOLOR_FORCE = "1" # e.g., try forcing ANSI colors
RUST_LIB_BACKTRACE = "0" # e.g., disable lib backtrace

# `links` configures the emission of hyperlinks for file paths in the backtrace output.
# `hyperlinks` configures the mission of hyperlinks for file paths in the backtrace output.
[hyperlinks]
enabled = true # Enable or disable hyperlinking.
url = "vscode://file${FILE_PATH}:{$LINE}:{$COLUMN}" # Template for generating file links.
url = "vscode://file${FILE_PATH}:${LINE}:${COLUMN}" # Template for generating file links.

# `hide` sections define rules to exclude specific frames from the backtrace output.
# Frames can be hidden based on regex patterns or ranges between start and end patterns.
Expand Down
2 changes: 2 additions & 0 deletions src/render.rs
Original file line number Diff line number Diff line change
Expand Up @@ -237,6 +237,8 @@ impl fmt::Display for Link {
}

fn encode_file_path_for_url(path: &str) -> Option<String> {
println!("{path:?}");
let path = Path::new(path).canonicalize().ok()?;
println!("{path:?}");
Some(format!("{}", path.display()))
}

0 comments on commit 2dfc9d9

Please sign in to comment.