pyrefly icon indicating copy to clipboard operation
pyrefly copied to clipboard

auto complete `__doc__` missing

Open asukaminato0721 opened this issue 3 months ago • 7 comments

Describe the Bug

Image
from pathlib import Path
Path(".").read_text.__do

Sandbox Link

No response

(Only applicable for extension issues) IDE Information

vscode-insider

0.35.0

asukaminato0721 avatar Sep 30 '25 03:09 asukaminato0721

@asukaminato0721 thanks for reporting this!

@kinto0 (when you're back), thoughts?

connernilsen avatar Oct 01 '25 22:10 connernilsen

My first thought is it's likely related to this: https://github.com/facebook/pyrefly/issues/1076

It requires further investigation though.

kinto0 avatar Oct 02 '25 16:10 kinto0

This issue has someone assigned, but has not had recent activity for more than 2 weeks.

If you are still working on this issue, please add a comment so everyone knows. Otherwise, please unassign yourself and allow someone else to take over.

Thank you for your contributions!

github-actions[bot] avatar Oct 29 '25 00:10 github-actions[bot]

It's here...

https://github.com/python/typeshed/blob/65b8a85e4b775d5465e7fdb7382c181fb7efa958/stdlib/types.pyi#L76

asukaminato0721 avatar Nov 06 '25 08:11 asukaminato0721

I think it's because because it's inherited from object

https://github.com/python/typeshed/blob/65b8a85e4b775d5465e7fdb7382c181fb7efa958/stdlib/builtins.pyi#L110

We skip object's attributes for completions, per the definition of completions_class (according to the comment, this is because there were a lot of things cluttering the results)

https://github.com/facebook/pyrefly/blob/main/pyrefly/lib/alt/attr.rs#L2017

Maybe the fix should be that we should start giving results for object, only if regular completions w/o object don't give any results?

Curious to hear everyone's thoughts.

yangdanny97 avatar Nov 26 '25 04:11 yangdanny97

Maybe the fix should be that we should start giving results for object, only if regular completions w/o object don't give any results?

That works, or we just sort object items to the bottom. Sorting seems easier since changing completions as it's typed would mean chaing our isIncomplete behavior

kinto0 avatar Nov 26 '25 17:11 kinto0

Depends on whether we want to keep completions list short, i suppose.

yangdanny97 avatar Nov 26 '25 17:11 yangdanny97