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

Wrongly auto-completes `tru` to `np.true_divide` instead of python's `True`

Open Michal-Martinek opened this issue 3 months ago • 1 comments

steps to reproduce

in python file import numpy as np then type tru or something similar and hit Enter

Type: Bug

very annoying, True is basic python keywork (and the uppercase T makes it akward to type, hence this 'bug' complicates my life)

Extension version: 2025.8.2 VS Code version: Code 1.104.1 (0f0d87fa9e96c856c5212fc86db137ac0d783365, 2025-09-17T23:36:24.973Z) OS version: Windows_NT x64 10.0.26100 Modes:

System Added Logs
2025-09-19 21:45:29.059 [info] (Client) Pylance client (2025.8.2) started with python extension (2025.14.0)
2025-09-19 21:45:30.570 [info] (16852) Server root directory: file:///c%3A/Users/micha/.vscode/extensions/ms-python.vscode-pylance-2025.8.2/dist
2025-09-19 21:45:30.570 [info] (16852) Pylance language server 2025.8.2 (pyright version 1.1.405, commit d64f3fa0) starting
2025-09-19 21:45:30.578 [info] (16852) Starting service instance "Image_to_sound" for workspace "c:\Users\micha\source\Cloned\Image_to_sound"
2025-09-19 21:45:30.732 [info] (16852) Starting Mcp server id:5738 ...
2025-09-19 21:45:30.812 [info] (16852) Setting environmentName for service "Image_to_sound": "3.13.0 (global)"
2025-09-19 21:45:30.813 [info] (16852) Setting pythonPath for service "Image_to_sound": "C:\Users\micha\AppData\Local\Programs\Python\Python313\python.exe"
2025-09-19 21:45:30.813 [info] (16852) No include entries specified; assuming c:\Users\micha\source\Cloned\Image_to_sound
2025-09-19 21:45:30.815 [info] (16852) Auto-excluding **/node_modules
2025-09-19 21:45:30.815 [info] (16852) Auto-excluding **/__pycache__
2025-09-19 21:45:30.815 [info] (16852) Auto-excluding **/.*
2025-09-19 21:45:30.979 [info] (16852) Assuming Python version 3.13.0.final.0
2025-09-19 21:45:31.417 [info] (16852) Found 3 source files
2025-09-19 21:45:31.509 [info] (16852) Settings have not changed. Skipping update.
2025-09-19 21:45:32.938 [info] (16852) BG: Priority queue background worker(2) root directory: file:///c%3A/Users/micha/.vscode/extensions/ms-python.vscode-pylance-2025.8.2/dist
2025-09-19 21:45:32.939 [info] (16852) BG: Priority queue background worker(2) started
2025-09-19 21:45:34.165 [info] (16852) BG: Indexer background runner(3) root directory: file:///c%3A/Users/micha/.vscode/extensions/ms-python.vscode-pylance-2025.8.2/dist (index)
2025-09-19 21:45:34.370 [info] (16852) BG: Indexing(3) started
2025-09-19 21:45:37.099 [info] (16852) BG: [IDX(3)] Long operation: scan packages file:///c%3A/Users/micha/source/Cloned/Image_to_sound (2837ms)
2025-09-19 21:45:37.099 [info] (16852) BG: scanned(3) 936 files over 1 exec env
2025-09-19 21:45:41.922 [info] (16852) Starting service instance "<default>" for workspace ""
2025-09-19 21:45:41.977 [info] (16852) Setting environmentName for service "<default>": "3.13.0 (global)"
2025-09-19 21:45:41.978 [info] (16852) Setting pythonPath for service "<default>": "c:\Users\micha\AppData\Local\Programs\Python\Python313\python.exe"
2025-09-19 21:45:41.979 [info] (16852) No include entries specified; assuming \<default workspace root>
2025-09-19 21:45:41.979 [info] (16852) Auto-excluding **/node_modules
2025-09-19 21:45:41.980 [info] (16852) Auto-excluding **/__pycache__
2025-09-19 21:45:41.980 [info] (16852) Auto-excluding **/.*
2025-09-19 21:45:42.147 [info] (16852) Assuming Python version 3.13.0.final.0
2025-09-19 21:45:42.489 [error] (16852) File or directory "\<default workspace root>" does not exist.
2025-09-19 21:45:42.490 [info] (16852) No source files found.
2025-09-19 21:45:43.810 [info] (16852) BG: Priority queue background worker(5) root directory: file:///c%3A/Users/micha/.vscode/extensions/ms-python.vscode-pylance-2025.8.2/dist
2025-09-19 21:45:43.813 [info] (16852) BG: Priority queue background worker(5) started
2025-09-19 21:45:46.854 [info] (16852) BG: [IDX(3)] Long operation: index execution environment file:///c%3A/Users/micha/source/Cloned/Image_to_sound (9428ms)
2025-09-19 21:45:46.983 [info] (16852) BG: [IDX(3)] Long operation: index packages file:///c%3A/Users/micha/source/Cloned/Image_to_sound (9575ms)
2025-09-19 21:45:46.983 [info] (16852) BG: indexed(3) 936 files over 1 exec env
2025-09-19 21:45:47.306 [info] (16852) BG: Indexing finished(3).
2025-09-19 21:46:03.470 [info] (16852) Found 2 source files
2025-09-19 21:46:06.113 [info] (16852) Settings have not changed. Skipping update.
2025-09-19 21:46:06.113 [info] (16852) Settings have not changed. Skipping update.

System Info
Item Value
CPUs Intel(R) Core(TM) i5-10310U CPU @ 1.70GHz (8 x 2208)
GPU Status 2d_canvas: enabled
direct_rendering_display_compositor: disabled_off_ok
gpu_compositing: enabled
multiple_raster_threads: enabled_on
opengl: enabled_on
rasterization: enabled
raw_draw: disabled_off_ok
skia_graphite: disabled_off
trees_in_viz: disabled_off
video_decode: enabled
video_encode: enabled
vulkan: disabled_off
webgl: enabled
webgl2: enabled
webgpu: enabled
webnn: disabled_off
Load (avg) undefined
Memory (System) 15.78GB (6.97GB free)
Process Argv --crash-reporter-id 449fe2c9-e1bc-4f0f-86bb-481abee0ed9b
Screen Reader no
VM 0%

Michal-Martinek avatar Sep 19 '25 19:09 Michal-Martinek

@heejaechang, don't we have an MRU list for completions? So that if 'tru' turns into 'True', the next time it should be favored in the list?

rchiodo avatar Nov 26 '25 00:11 rchiodo