Skip to content

Commit

Permalink
feat(smcache): Expose token name via Python bindings
Browse files Browse the repository at this point in the history
  • Loading branch information
kamilogorek committed Oct 31, 2022
1 parent 5d0846f commit e10c3d5
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 0 deletions.
6 changes: 6 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,11 @@
# Changelog

## Unreleased

**Features**:

- Add `name` to `SourceMapCacheToken` Python bindings ([#703](https://github.com/getsentry/symbolic/pull/703))

## 10.0.0

**Features**:
Expand Down
1 change: 1 addition & 0 deletions py/symbolic/sourcemapcache.py
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@ def _from_objptr(cls, tm):
rv.line = tm.line
rv.col = tm.col
rv.src = decode_str(tm.src, free=False) or None
rv.name = decode_str(tm.name, free=False) or None
rv.function_name = decode_str(tm.function_name, free=False) or None

rv.context_line = decode_str(tm.context_line, free=False) or None
Expand Down
3 changes: 3 additions & 0 deletions symbolic-cabi/src/sourcemapcache.rs
Original file line number Diff line number Diff line change
Expand Up @@ -65,6 +65,8 @@ pub struct SymbolicSmTokenMatch {
pub col: u32,
/// The path to the original source.
pub src: SymbolicStr,
/// The name of the source location as it is defined in the SourceMap.
pub name: SymbolicStr,
/// The name of the function containing the token.
pub function_name: SymbolicStr,

Expand Down Expand Up @@ -156,6 +158,7 @@ fn make_token_match(token: SourceLocation, context_lines: u32) -> *mut SymbolicS
line: token.line() + 1,
col: token.column() + 1,
src: SymbolicStr::new(token.file_name().unwrap_or_default()),
name: SymbolicStr::new(token.name().unwrap_or_default()),
function_name: SymbolicStr::new(function_name),

pre_context,
Expand Down

0 comments on commit e10c3d5

Please sign in to comment.