ty icon indicating copy to clipboard operation
ty copied to clipboard

Inlay Hints Variable Types Not Respected in VS Code

Open agedburd opened this issue 3 weeks ago • 1 comments

Summary

The "Inlay Hints: Variable Types" setting for both User and Workspace are not respected in the VS Code extension.

Image Image

VS Code version 1.107.1

Example code:

import pandas as pd
temp = {}
ref_df = pd.DataFrame.from_records(
    list(temp.values()),
    index=list(temp.keys()),
    columns=["start_date", "end_date"],
)

Version

ty 0.0.6

agedburd avatar Dec 24 '25 20:12 agedburd

This setting seems to be working when I tried to reproduce it locally. Could these inlay hints be coming from pylance?

Image

ntBre avatar Dec 24 '25 21:12 ntBre

I do have pylance installed, but have my language server set to None as per the editor integration page:

Image

The default for pylance, and my current setting, is to have variable type inlay hints off:

Image

Updated to 0.0.8 and this is still occurring. It's definitely coming from ty or some unexpected interaction with ty.

https://github.com/user-attachments/assets/e466b5eb-a0fb-4d6d-bdf1-17b65693adec

https://github.com/user-attachments/assets/fcd04906-e04c-43a1-8254-f5e809914d7e

agedburd avatar Dec 29 '25 16:12 agedburd

I just realized I also had a ty dependency in my pyproject.toml that was causing the whole thing. Thank you for your time.

agedburd avatar Dec 29 '25 16:12 agedburd

No worries. I'm glad you figured it out and thanks for letting us know that it's now working. Happy holidays

MichaReiser avatar Dec 29 '25 16:12 MichaReiser