Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Proposal: Support progress reports for long-running tasks #822

Open
anagrius opened this issue Nov 4, 2022 · 6 comments
Open

Proposal: Support progress reports for long-running tasks #822

anagrius opened this issue Nov 4, 2022 · 6 comments

Comments

@anagrius
Copy link
Contributor

anagrius commented Nov 4, 2022

Our codebase is about 350.000 lines of Elm code and the ElmLS takes a bit of time to perform certain talks.
Usually the wait is not too bad, but the lack of feedback from the LSP about wether it is working on something or not,
make it "feel" sluggish.

When loading the project I assume ElmLS is indexing, and it takes ca ~20s on Apple M1 Max for things like code actions, reference counts, definition lookup, etc to become available. During this time there is no feedback that something is happening, and you cannot tell if the LSP has crashed.

Have you considered using LSP Work Done Progress notifications?

I think it would greatly improve the UX during start up and e.g. linting and other heavy operations.

@razzeee
Copy link
Member

razzeee commented Nov 4, 2022

We're already doing that, at least on initalization

https://github.com/elm-tooling/elm-language-server/blob/main/src/server.ts#L126

@jmbockhorst
Copy link
Member

Just to note, our progress calculation is incorrect, as it seems we only go from 0% to 66%. I think it is because of this line, parse stages is really just 2:

const PARSE_STAGES = 3;

@anagrius
Copy link
Contributor Author

anagrius commented Nov 4, 2022

That's great @razzeee, thanks! But where do we see it in VScode? Maybe the client doesn't handle it, or am I missing something?

@razzeee
Copy link
Member

razzeee commented Nov 5, 2022

With elm-spa-examle, I can see the message pop up very briefly in the bottom bar of vscode. But it's gone instantly, not sure if that's due to the size, a bug or that we only track the indexing, which might not be what takes up all the time on server start?

@anagrius
Copy link
Contributor Author

anagrius commented Nov 6, 2022

Yeah, you are likely right. But there is diffidently something taking a lot of time, and stalling the ElmLS from being active in vscode. I will try to dive into the logs.

Is it okay, to keep this issue open and track my findings here?

@anagrius
Copy link
Contributor Author

anagrius commented Nov 6, 2022

So the indexing is done in 2 seconds for ~1700 elm files + dependencies. I never see any notification or status anywhere though.
But regardless, initialization is not what is taking time. I will try to investigate further.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants