DiamondLightSource / DiamondLightSource/observability-utils

Current span decorator obscures type hints for vscode

Open
#20 0 comments 0 reactions 0 assignees View on GitHub
bug
Dominant language
Python
Stars
0
Forks
0
PR merge metrics
No merged PRs in 30d

Description

When I have a function decorated with `@start_as_current_span`, vscode cannot see or autofill its type hints, see screenshot below:

![Image](https://github.com/user-attachments/assets/2177898a-09ff-48ef-8350-070a37fdc373)

The referenced function

![Image](https://github.com/user-attachments/assets/63ce126a-261d-4dcb-8701-ee52afa271f6)

When I remove the `@start_as_current_span` decorator I can see the type hints and vscode autofills them:

![Image](https://github.com/user-attachments/assets/dc98ac9a-f841-45eb-addf-44db7dd119b8)

## Steps To Reproduce
Steps to reproduce the behaviour:
1. Decorate a function with `@start_as_current_span`
2. Call it somewhere else
3. Hover over the call in vscode

## Acceptance Criteria
- Decorated functions look like the bottom screenshot
- Regression test

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.