pylance-release icon indicating copy to clipboard operation
pylance-release copied to clipboard

Functions in os module only show type stubs information (both on hover and when doing "go to definition")

Open ldorigo opened this issue 2 years ago • 5 comments

Issue Type: Bug

Hello,

Seems related to https://github.com/microsoft/pylance-release/issues/2304 but that issue says to open new issues for similar problems, so here goes.

Hovering a function in os shows only type stubs, no docstring:

image

And going to definition (ctrl+click) brings to the stubs rather than implementation (which I guess is normal since it's probably compiled code? but I'd still like to be able to see the docs...)

image

Extension version: 2022.3.3-pre.1 VS Code version: Code 1.65.2 (c722ca6c7eed3d7987c0d5c3df5c45f6b15e77d1, 2022-03-10T14:33:55.248Z) OS version: Windows_NT x64 10.0.19042 Restricted Mode: No Remote OS version: Linux x64 5.4.0-94-generic Remote OS version: Linux x64 5.4.0-94-generic

System Info
Item Value
CPUs Intel(R) Core(TM) i5-8350U CPU @ 1.70GHz (8 x 1896)
GPU Status 2d_canvas: enabled
gpu_compositing: enabled
multiple_raster_threads: enabled_on
oop_rasterization: enabled
opengl: enabled_on
rasterization: enabled
skia_renderer: enabled_on
video_decode: enabled
vulkan: disabled_off
webgl: enabled
webgl2: enabled
Load (avg) undefined
Memory (System) 15.88GB (7.64GB free)
Process Argv --crash-reporter-id 89aeed25-8dc2-46ce-b17c-1f93ab95c565
Screen Reader no
VM 0%
Item Value
Remote SSH: spidsmus.sdma.nzcorp.net
OS Linux x64 5.4.0-94-generic
CPUs Intel(R) Xeon(R) CPU E5-2687W v3 @ 3.10GHz (12 x 3092)
Memory (System) 58.87GB (14.01GB free)
VM 0%
Item Value
Remote SSH: spidsmus.sdma.nzcorp.net
OS Linux x64 5.4.0-94-generic
CPUs Intel(R) Xeon(R) CPU E5-2687W v3 @ 3.10GHz (12 x 3092)
Memory (System) 58.87GB (14.01GB free)
VM 0%

ldorigo avatar Mar 17 '22 10:03 ldorigo

Me too. How should I fix it

zhouchaogitclub avatar Mar 26 '22 12:03 zhouchaogitclub

@bschnurr does the "needs investigation" label mean some information is missing? I'm happy to provide more info/run tests if necessary

ldorigo avatar Jun 04 '22 10:06 ldorigo

@ldorigo "needs investigation" means that the Pylance team needs to spend some time investigating this to determine what action to take.

debonte avatar Jun 06 '22 16:06 debonte

I see on windows 'os.chmod('/tmp/foo', 0o777)' has no docstrings either

bschnurr avatar Jun 09 '22 20:06 bschnurr

turns out that os.py is using some dynamic behaviour to remap functions that breaks our docstring logic. Some new way of mapping these docstrings is needed.

bschnurr avatar Jun 09 '22 21:06 bschnurr