python-lsp/python-lsp-server

Processing a lot of unneeded files

eyalk11 opened this issue · 3 comments

I noticed that it does process files in packages I never import, and are completely unrlated . So I wonder what is the logic? does it process the entire site-packages?
What assures it doesn't cause unneeded load on the CPU ? Is it capped at certain cpu?

2023-12-25 12:55:07,359 Jerusalem Standard Time - DEBUG - pylsp_jsonrpc.endpoint - Sending notification:
$/progress {'token': '0be4e853-dc68-4e61-8d9d-d617bc97f61e', 'value': {'kind': 'report', 'message': 'Working on
site-packages/torch/fx/passes/graph_manipulation.py 703/29825', 'percentage': 2}}

This is a rope thing. rope scans all python modules in sys.path (by default) and creates a SQLite database from it, so that autoimport suggestions work (which should work before you imported the library, otherwise the autoimport suggestion would be necessary anymore :)).

And it generates it for every project separately by default as it is saved in .ropeproject under each project. Right?
Can you change the default? It takes a lot of processing both in terms of memory(probably - nvim reaches 75 gb ) ,cpu(probably) and disk space(128mb per project).

Rope takes the root URI of the language server as the root folder basis. You can set the root URI here via the initialize message