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

Adding error codes and better logging #957

Merged
merged 2 commits into from
Dec 5, 2024
Merged

Adding error codes and better logging #957

merged 2 commits into from
Dec 5, 2024

Conversation

rtetley
Copy link
Collaborator

@rtetley rtetley commented Dec 4, 2024

This was initially related to #953.
However the strategies invoked below don't work for the moment.
I opened an issue here: microsoft/language-server-protocol#2069
Aksed a question here: https://stackoverflow.com/questions/79254724/how-to-get-a-partialresulttoken-from-the-textdocument-documentsymbol-request-in
Depending on the response I will also open an issue in the vscode repo.

@rtetley
Copy link
Collaborator Author

rtetley commented Dec 4, 2024

I have explored several options:

  • First I tried to implement it using a partialResult or workDone tokens (see here). But vscode does not seem to send such tokens alongside the textDocument/documentSymbol request... Even when the server declares supporting the capability... Maybe something needs to be done client side.
  • I also tried, after seeing this, to send back a ServerCancelled error code when the document is busy parsing. The client receives the request but never sends a second one...

@rtetley
Copy link
Collaborator Author

rtetley commented Dec 4, 2024

I will investigate some more and I am opening this PR anyways since it opens up important features:

  • using custom error codes instead of always sending a RequestFailed one.
  • giving a document_state (right now only Parsing and Parsed but later Executing and Executed maybe ?)

@rtetley rtetley changed the title Fixing the outline Adding error codes and better logging Dec 5, 2024
@rtetley rtetley marked this pull request as ready for review December 5, 2024 12:51
@rtetley
Copy link
Collaborator Author

rtetley commented Dec 5, 2024

Even though this doesn't fix the original problem I think I will merge anyways because it adds interesting functionality. @gares ?

Lsp specifies a number of useful error codes, like ServerCancelled
which allows to tell the client the server is busy.
This implements the possiblity of passing a different error code.
This will help debug lsp problems.
@rtetley rtetley force-pushed the outline-regression branch from db65590 to 4cf45ed Compare December 5, 2024 12:52
@rtetley rtetley merged commit 034078f into main Dec 5, 2024
28 checks passed
@rtetley rtetley deleted the outline-regression branch December 13, 2024 14:24
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

Successfully merging this pull request may close these issues.

1 participant