Skip to content

Duplicated quotes when auto-completing string literals, with autoClosingQuotes disabled #8037

@yueyinqiu

Description

@yueyinqiu

Type: Bug

Behaviour

With "editor.autoClosingQuotes": "never", write:

from typing import Literal
x: Literal["x"] = "

It will show an auto-complete suggestion "x" (as expected):

Image

However, when choosing it, the final code includes a duplicated ":

Image

(This won't happen when autoClosingQuotes is enabled.)

Diagnostic data

(There seems no related logs?)


Environment

(The following environment is generated by the issue reporter on a remote device. I have also tested on my local machine (Windows), and it also happens. I believe this issue is unrelated to the environment.)

Extension version: 2026.4.0
VS Code version: Code 1.116.0 (560a9dba96f961efea7b1612916f89e5d5d4d679, 2026-04-15T00:28:13Z)
OS version: Windows_NT x64 10.0.19045
Modes:
Remote OS version: Linux x64 5.15.0-164-generic

  • Python version (& distribution if applicable, e.g. Anaconda):
  • Type of virtual environment used (e.g. conda, venv, virtualenv, etc.): Unknown
  • Value of the python.languageServer setting: Default
User Settings


languageServer: "Pylance"

terminal
• activateEnvironment: false

Installed Extensions
Extension Name Extension Id Version
csdevkit ms- 3.10.14
csharp ms- 2.130.5
debugpy ms- 2025.18.0
even-better-toml tam 0.21.2
flake8 ms- 2025.2.0
hexeditor not 1.8.2
js-debug ms- 1.112.0
js-debug-companion ms- 1.1.3
jsts-chat-features Typ 0.0.2
markdown-all-in-one yzh 3.6.3
markdown-mermaid bie 1.32.0
pdf tom 1.2.2
python ms- 2026.4.0
rainbow-csv mec 3.24.1
remote-explorer ms- 0.5.0
remote-ssh ms- 0.122.0
remote-ssh-edit ms- 0.87.0
sqlite-viewer qwt 25.12.2
vscode-dotnet-runtime ms- 3.0.0
vscode-github-actions git 0.31.3
vscode-js-profile-table ms- 1.0.10
vscode-language-pack-zh-hans MS- 1.110.2026041514
vscode-pydata-viewer Per 0.0.15
vscode-pylance ms- 2026.2.1
vscode-python-envs ms- 1.28.0
zip-viewerx Mak 1.0.0
System Info
Item Value
CPUs Intel(R) Core(TM) i7-8650U CPU @ 1.90GHz (8 x 2112)
GPU Status 2d_canvas: enabled
GPU0: VENDOR= 0x8086, DEVICE=0x5917 [Intel(R) UHD Graphics 620], DRIVER_VENDOR=Intel, DRIVER_VERSION=31.0.101.2134 ACTIVE
GPU1: VENDOR= 0x8086, DEVICE=0x5917 [Intel(R) UHD Graphics 620], DRIVER_VERSION=31.0.101.2134
GPU2: VENDOR= 0x1414, DEVICE=0x008c [Microsoft Basic Render Driver], DRIVER_VERSION=10.0.19041.5794
Machine model name:
Machine model version:
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
webgl: enabled
webgl2: enabled
webgpu: enabled
webnn: disabled_off
Load (avg) undefined
Memory (System) 7.88GB (0.84GB free)
Process Argv --crash-reporter-id f48474c2-14f7-477c-8807-2e8ae5bb3bdd
Screen Reader no
VM 0%
Item Value
Remote SSH: illusion
OS Linux x64 5.15.0-164-generic
CPUs Intel(R) Xeon(R) Gold 6348 CPU @ 2.60GHz (56 x 3400)
Memory (System) 1007.53GB (860.73GB free)
VM 0%
A/B Experiments
vsliv368cf:30146710
binariesv615:30325510
nativeloc1:31344060
dwcopilot:31170013
dwoutputs:31242946
copilot_t_ci:31333650
e5gg6876:31282496
pythonrdcb7:31342333
6518g693:31463988
aj953862:31281341
6abeh943:31336334
envsactivate1:31464700
cloudbuttont:31379625
42190218_ostrepl:31403339
use-responses-api:31390855
ddidtcf:31399634
je187915:31454425
ec5jj548:31422691
cp_cls_c_966_ss:31454199
inlinechat_v2_hd992725:31485760
4je02754:31466945
8hhj4413:31478653
38bie571_auto:31426784
cp_cls_c_1081:31454833
conptydll_false:31489735
e9c30283:31461165
test_treatment2:31471001
idci7584:31464702
e3e4d672:31494082
ei9d7968:31496641
534a6447:31496642
chat:31457767
dfc2j404:31496396
cpptoolson-v2:31475363
ghj88844:31492074
h08i8180_copy:31475368
ec1eg703:31491645
client_tst_t:31495907
ddid_t:31478206
getcmakediagnosticson:31489824
cp_cls_c_1082:31491634
f5b8g904_t:31489328
logging_disabled_new:31493366
748c7209:31497895

Metadata

Metadata

Assignees

Labels

ai-triage-respondedIndicate whether the AI triage agent has responded to this issue.team needs to reproduceIssue has not been reproduced yet

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions