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

String interpolation (f strings) is breaking autocomplete

Open red8888 opened this issue 1 year ago • 1 comments

The "Create on github" button is broken for me so adding this manually.

Version: 1.87.1 (Universal)
Commit: 1e790d77f81672c49be070e04474901747115651
Date: 2024-03-06T00:23:16.418Z
Electron: 27.3.2
ElectronBuildId: 26836302
Chromium: 118.0.5993.159
Node.js: 18.17.1
V8: 11.8.172.18-electron.0
OS: Darwin arm64 23.4.0
CPUs | Apple M2 Max (12 x 24)
-- | --
GPU Status | 2d_canvas: enabled canvas_oop_rasterization: enabled_on 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 video_decode: enabled video_encode: enabled webgl: enabled webgl2: enabled webgpu: enabled
Load (avg) | 2, 2, 2
Memory (System) | 32.00GB (1.83GB free)
Process Argv | --crash-reporter-id 96d26004-b6a2-41a4-a0ba-b026e700ad63
Screen Reader | no
VM | 0%
vsliv368:30146709
vspor879:30202332
vspor708:30202333
vspor363:30204092
vscod805:30301674
binariesv615:30325510
vsaa593cf:30376535
py29gd2263:30899288
c4g48928:30535728
azure-dev_surveyone:30548225
2i9eh265:30646982
962ge761:30959799
pythongtdpath:30769146
welcomedialogc:30910334
pythonidxpt:30866567
pythonnoceb:30805159
asynctok:30898717
pythontestfixt:30902429
pythonregdiag2:30936856
pyreplss1:30897532
pythonmypyd1:30879173
pythoncet0:30885854
2e7ec940:30986170
pythontbext0:30879054
accentitlementst:30887150
dsvsc016:30899300
dsvsc017:30899301
dsvsc018:30899302
pydisww1:30981707
cppperfcontrol:30979541
d34g3935:30971562
fegfb526:30981948
bg6jg535:30979843
dsvsc020:30976470
7ghi1836:30988842

Here I get auto-complete:

enter image description here

Here I do not:

enter image description here

In the second case if I start typing though I will come up:

enter image description here

This has to be a bug right? Or is string interpolation like this expected to break auto-complete?

red8888 avatar Mar 19 '24 12:03 red8888

looks like after fstring, pylance doesn't determine right position to calculate completion.

heejaechang avatar Mar 28 '24 17:03 heejaechang