Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

How to prevent autocomplete of type hints #3599

Closed
GBrachetta opened this issue Nov 9, 2022 · 11 comments
Closed

How to prevent autocomplete of type hints #3599

GBrachetta opened this issue Nov 9, 2022 · 11 comments
Assignees
Labels
fixed in next version (main) A fix has been implemented and will appear in an upcoming version waiting for user response Requires more information from user

Comments

@GBrachetta
Copy link

I would like to deactivate the autocompletion of type hints, such as described in the video below.

Screen.Recording.2022-11-09.at.16.19.58.mov

How can I get rid of those type hints in the autocomplete?

@bschnurr
Copy link
Member

bschnurr commented Nov 9, 2022

isn't that copilot?

@judej judej added the waiting for user response Requires more information from user label Nov 9, 2022
@judej
Copy link
Contributor

judej commented Nov 9, 2022

Could you also let us know what the version of VSCode and Pylance you are using?

Also are you using another extension for inline errors?

@GBrachetta
Copy link
Author

I'm using VSCode 1.73.0 and Pylance v2022.11.10.

The behaviour (the autocompletion of the type hints) disappears when I disable Pylance, but of course that's not what I'd want to do.

Autocomplete of just list_display is what I'd want, but not all the type hints I'm deleting in the video.

@bschnurr
Copy link
Member

bschnurr commented Nov 9, 2022

Could be intellicode. you could try disabling that extension

@GBrachetta
Copy link
Author

GBrachetta commented Nov 9, 2022

I'm afraid it's not intellicode. Same behaviour uninstalling it.

Maybe my issue is pretty easy to replicate if you're interested to debug it.

I'm pretty sure the type hints autocompletion comes from Pylance.

@bschnurr
Copy link
Member

bschnurr commented Nov 9, 2022

Ah.. I see it now.. yes we are including the annotation type from the django stubs.

this could be an enhancement to control annotation printing.

@heejaechang
Copy link
Contributor

so the behavior is because of this - https://github.com/microsoft/pyright/blob/main/packages/pyright-internal/src/languageService/completionProvider.ts#L985

currently there is no option to control the behavior.

@GBrachetta
Copy link
Author

Thanks for spotting the cause. Yes, it would be great to be able to toggle this behaviour on/off because it wastes a lot of time for people not using annotation types.

@heejaechang
Copy link
Contributor

heejaechang commented Nov 11, 2022

we are discussing a way to mitigate the issue. either providing option to toggle, or use type checking mode, or provide separate completion that has the type annotation when user type : after the member variable or etc.

we are currently leaning to separete completion after : since it gives more flexibility to users. they can easily add type annotation for ones they want or never bothered by it if they don't care.

@heejaechang heejaechang self-assigned this Nov 11, 2022
@GBrachetta
Copy link
Author

Thanks, that's great, as soon as it still lets autocomplete the variable alone if we don't type the colon (:).

@heejaechang heejaechang added the fixed in next version (main) A fix has been implemented and will appear in an upcoming version label Nov 17, 2022
@rchiodo
Copy link
Contributor

rchiodo commented Nov 30, 2022

This issue has been fixed in prerelease version 2022.11.41, which we've just released. You can find the changelog here: CHANGELOG.md

@rchiodo rchiodo closed this as completed Nov 30, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
fixed in next version (main) A fix has been implemented and will appear in an upcoming version waiting for user response Requires more information from user
Projects
None yet
Development

No branches or pull requests

5 participants