pyrefly icon indicating copy to clipboard operation
pyrefly copied to clipboard

Strange signature handling

Open Dan7h3x opened this issue 4 months ago • 14 comments

Describe the Bug

Image I think the rendering of signature help can be improved

Sandbox Link

No response

(Only applicable for extension issues) IDE Information

No response

Dan7h3x avatar Nov 07 '25 10:11 Dan7h3x

that is one crazy signature, haha.

would this formatting look good to you if we made it on new lines for each param?

( 
    start: _NestedSequence[_SupportsArray[dtype[numpy.bool[builtins.bool] | float64 | integer[Any]]]] | _NestedSequence[float] | _SupportsArray[dtype[numpy.bool[builtins.bool] | float64 | integer[Any]]] | float,
    stop: _NestedSequence[_SupportsArray[dtype[numpy.bool[builtins.bool] | float64 | integer[Any]]]] | _NestedSequence[float] | _SupportsArray[dtype[numpy.bool[builtins.bool] | float64 | integer[Any]]] | float,
    num: SupportsIndex = 50,
    endpoint: builtins.bool = True,
    retstep: Literal[False] = False,
    dtype: None = None,
    axis: SupportsIndex = 0,
    *,
    device: Literal['cpu'] | None = None
 ) -> ndarray[tuple[Any, ...], dtype[float64]]

kinto0 avatar Nov 11 '25 03:11 kinto0

I think there must be a renderer that convert this signature info as markdown to get pretty docs similar to "pyright" or "pylsp"

Another thing is huge amount of ram consuming ~2G for lsp. I think its not efficient for laptops or arm devices

Dan7h3x avatar Nov 11 '25 03:11 Dan7h3x

Another thing is huge amount of ram consuming ~2G for lsp. I think its not efficient for laptops or arm devices

would you be able to share your project so we can look into memory usage? which version are you on? we have improved it a lot, but there are still problems.

if you want to put the details here that would be appreciated!

kinto0 avatar Nov 11 '25 04:11 kinto0

Since #1092 is closed, i put info here.

version = 0.41.0 (recent updated from 0.40.0) cpu = i7-6700K os = Arch Linux

The current ram consumption is about ~1.6G with helix editor default config for pyrefly

Dan7h3x avatar Nov 11 '25 05:11 Dan7h3x

Since #1092 is closed, i put info here.

version = 0.41.0 (recent updated from 0.40.0) cpu = i7-6700K os = Arch Linux

The current ram consumption is about ~1.6G with helix editor default config for pyrefly

do you have a link to the project you're using pyrefly with?

kinto0 avatar Nov 11 '25 17:11 kinto0

No there is no special project i have right now, i test pyrefly as lsp for neovim

Dan7h3x avatar Nov 11 '25 17:11 Dan7h3x

No there is no special project i have right now, i test pyrefly as lsp for neovim

so what files did you open to cause the memory use?

kinto0 avatar Nov 11 '25 17:11 kinto0

A simple 50 line python scripts, even on empty scripts when lsp gets activated the ram goes up

Dan7h3x avatar Nov 11 '25 18:11 Dan7h3x

A simple 50 line python scripts, even on empty scripts when lsp gets activated the ram goes up

what kind of python environment? what do you import? large site-packages in your python interpreter? (pyrefly sometimes looks at your dependencies but we have gotten better about it).

kinto0 avatar Nov 11 '25 18:11 kinto0

Global os environment

Dan7h3x avatar Nov 11 '25 18:11 Dan7h3x

I can reproduce this with the following:

  • pip list with lots of dependencies
(test) PS C:\Users\kylei\projects\test> uv pip list
Package                  Version
------------------------ -----------
boto3                    1.37.38
botocore                 1.37.38
filelock                 3.16.1
fsspec                   2025.3.0
googleapis-common-protos 1.72.0
grpcio                   1.70.0
grpcio-status            1.70.0
jinja2                   3.1.6
jmespath                 1.0.1
markupsafe               2.1.5
mpmath                   1.3.0
networkx                 3.1
numpy                    1.24.4
pandas                   2.0.3
protobuf                 5.29.5
python-dateutil          2.9.0.post0
pytz                     2025.2
s3transfer               0.11.5
setuptools               75.3.2
six                      1.17.0
sympy                    1.13.3
torch                    2.4.1
typing-extensions        4.13.2
tzdata                   2025.2
urllib3                  1.26.20
  • open empty file, no ram (<130mb)
  • autocomplete import
  • ram goes to 1.2gb

kinto0 avatar Nov 11 '25 18:11 kinto0

@kinto0 can i work on this !!!!!

AryanBagade avatar Nov 11 '25 19:11 AryanBagade

I've spun the memory issue out into https://github.com/facebook/pyrefly/issues/1547.

rchen152 avatar Nov 11 '25 19:11 rchen152

This issue has someone assigned, but has not had recent activity for more than 2 weeks.

If you are still working on this issue, please add a comment so everyone knows. Otherwise, please unassign yourself and allow someone else to take over.

Thank you for your contributions!

github-actions[bot] avatar Dec 02 '25 00:12 github-actions[bot]