basedpyright icon indicating copy to clipboard operation
basedpyright copied to clipboard

Limiting the length of the string literal makes wrong completion

Open STofone opened this issue 6 months ago • 1 comments

Description

Image This will make code completion add `...` into my code. Vscode will auto show `...` in completion panel, there is no need to `substring` onCompletion

SEO: truncate

STofone avatar Aug 04 '25 07:08 STofone

here's a repro:

from typing import Literal


type Foo = Literal["aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa"]

foo: Foo = '' # completion here

thanks for finding the code

DetachHead avatar Aug 06 '25 12:08 DetachHead