Skip to content

Commit b3b404e

Browse files
committed
Fix regex for PathBuf
According to logic in #120557 (comment) the capture groups may be unnecessary and could possibly go with something as simple as `std::path::PathBuf` as done in CodeLLDB: https://github.com/vadimcn/codelldb/blob/05502bf75e4e7878a99b0bf0a7a81bba2922cbe3/formatters/rust.py#L59C56-L59C74 However for consistency will follow the pattern for now and consider updating all of regexes in a future PR.
1 parent b0623c0 commit b3b404e

File tree

2 files changed

+2
-2
lines changed

2 files changed

+2
-2
lines changed

src/etc/lldb_commands

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,6 @@ type summary add -F lldb_lookup.summary_lookup -e -x -h "^(core::([a-z_]+::)+)R
1717
type summary add -F lldb_lookup.summary_lookup -e -x -h "^(core::([a-z_]+::)+)RefCell<.+>$" --category Rust
1818
type summary add -F lldb_lookup.summary_lookup -e -x -h "^(core::([a-z_]+::)+)NonZero<.+>$" --category Rust
1919
type summary add -F lldb_lookup.summary_lookup -e -x -h "^core::num::([a-z_]+::)*NonZero.+$" --category Rust
20-
type summary add -F lldb_lookup.summary_lookup -e -x -h "^std::path::PathBuf$" --category Rust
2120
type summary add -F lldb_lookup.summary_lookup -e -x -h "^&(mut )?std::path::Path$" --category Rust
21+
type summary add -F lldb_lookup.summary_lookup -e -x -h "^(std::([a-z_]+::)+)PathBuf$" --category Rust
2222
type category enable Rust

src/etc/rust_types.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -67,8 +67,8 @@ class RustType(object):
6767
STD_REF_MUT_REGEX = re.compile(r"^(core::(\w+::)+)RefMut<.+>$")
6868
STD_REF_CELL_REGEX = re.compile(r"^(core::(\w+::)+)RefCell<.+>$")
6969
STD_NONZERO_NUMBER_REGEX = re.compile(r"^core::num::([a-z_]+::)*NonZero.+$")
70-
STD_PATHBUF_REGEX = re.compile(r"^std::path::PathBuf$")
7170
STD_PATH_REGEX = re.compile(r"^&(mut )?std::path::Path$")
71+
STD_PATHBUF_REGEX = re.compile(r"^(std::([a-z_]+::)+)PathBuf$")
7272

7373
TUPLE_ITEM_REGEX = re.compile(r"__\d+$")
7474

0 commit comments

Comments
 (0)