basedpyright icon indicating copy to clipboard operation
basedpyright copied to clipboard

Add maxLiteralStringLength as a configuration property

Open Minibrams opened this issue 3 months ago • 1 comments

We introduce a new configuration property maxLiteralStringLength that fixes #1416 and #1655. The property can be set either in the serverSettings (e.g. .vscode/settings.json):

{
  "basedpyright.analysis.maxLiteralStringLength": 100
}

or in the pyproject.toml:

[tool.basedpyright]
maxLiteralStringLength = 100

or in the pyrightconfig.json:

{
  "maxLiteralStringLength": 100
}

Know issues

It looks like we can't control the render-length of completion suggestions, which is unfortunate. However, even though completion suggestions are still truncated after 50 characters, the effective value on auto-complete respects the configuration property.

Minibrams avatar Nov 26 '25 23:11 Minibrams

@DetachHead This touches a lot of stuff, so it will probably be a huge pain to merge with future pyright releases... Don't know how you typically handle this. Let me know if it can be improved.

Minibrams avatar Nov 26 '25 23:11 Minibrams