gleam-lang / gleam

⭐️ A friendly language for building type-safe, scalable systems!
https://gleam.run
Apache License 2.0
17.54k stars 729 forks source link

Language Server drastically slows down on large codebase #3585

Open ryanmiville opened 3 weeks ago

ryanmiville commented 3 weeks ago

Reproduction steps

clone this large repo and try to make edits to a file.

Gleam version - 1.41

Runtime - Erlang

Here is an example of adding an import in Zed. I get similar results in VS Code Screen Recording Sept 01

iam-py-test commented 3 weeks ago

Warning: @goncastrum is a known spam bot, and the link they are promoting is malware.

lpil commented 3 weeks ago

Thank you. Let's identify what the issue is here.

giacomocavalieri commented 2 weeks ago

Hello! It looks like the repo is private, the link gives me a 404

lpil commented 2 weeks ago

The link was missing "https://", I've fixed it

giacomocavalieri commented 2 weeks ago

I've had a quick look at the server and it looks like this might be a caching issue. For example, if I'm editing the module src/aws_api/acm.gleam I see the following log from the server when compiling the aws_api package:

 INFO compile{package=aws_api}: analysing_modules count=316

From the look of it, it seems like it's analysing all the modules every time instead of caching those. I've added a couple more logs to see what's actually cached and it looks like it's only caching 3 out of the hundreds of modules:

 INFO compile{package=aws_api}: cached module: "aws_api/internal/metadata"
 INFO compile{package=aws_api}: cached module: "aws_api/internal/request_builder"
 INFO compile{package=aws_api}: cached module: "aws_api_test"

I'm not really familiar with all the caching bits that happen in the LS but this might be useful

lpil commented 1 week ago

Huh, sounds like it's not respecting the caches for some reason! I wonder what it is.