question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Progress report capabilities

See original GitHub issue

Hi there,

I am trying to setup a progress report from the LS to Visual Code.

I implemented the following functions :

@diplomat_server.command(DiplomatLanguageServer.CMD_TST_PROGRESS_STRT)
def on_start_progress(ls : DiplomatLanguageServer, *args):
	initiate_progress(ls)
	print("Start progress on uuid",ls.progress_uuid)
	ls.send_notification("$/progress",WorkDoneProgressParams(token=ls.progress_uuid,value=WorkDoneProgressBegin(title = "Working hard")))


@diplomat_server.command(DiplomatLanguageServer.CMD_TST_PROGRESS_STOP)
def on_stop_progress(ls : DiplomatLanguageServer, *args):
	print("Stop progress")

	ls.send_notification("$/progress",WorkDoneProgressParams(token=ls.progress_uuid, value=WorkDoneProgressEnd(message = "Stuff done.")))

@diplomat_server.command(WINDOW_WORK_DONE_PROGRESS_CREATE)
def initiate_progress(ls : DiplomatLanguageServer, *args) -> ProgressToken:
	ls.progress_uuid = uuid.uuid4().int
	return ls.progress_uuid

When I execute on_start_progress and on_stop_progress from a client command, I do get the appropriates prints on the python side, however, I have no reaction at all even though I expect to have an indefinite progress bar.

I haven’t found any resource about this in the documentation so is there a limitation that I’m not aware of or an obvious mistake ? I suspect my initiate_progress command or its call are the problem, but I have no clue about how to do otherwise…

If there is a place to ask for help which is more appropriate than GH issues, please let me know.

Best regards, Julien Faucher

Issue Analytics

  • State:closed
  • Created 2 years ago
  • Comments:5 (4 by maintainers)

github_iconTop GitHub Comments

1reaction
danixeeecommented, Jun 14, 2021

@suzizecat Progress reporting is now added to the server.

0reactions
danixeeecommented, Apr 13, 2021

We will add some helper methods to the server class, like get_configuration and get_configuration_async.

You can see differences between thread, async, and callback approaches in the json example.

In your case:

@server.thread()
@server.command("SHOW_PROGRESS")
def on_progress_show(ls: DiplomatLanguageServer, *args):
   progress_token = uuid.uuid4().int

    # Tell the client to create a progress bar
    ls.lsp.send_request(
        WINDOW_WORK_DONE_PROGRESS_CREATE,
        WorkDoneProgressCreateParams(
            token=progress_token
        )
    ).result(1) # waits for 1 second before raise the exception

    ...
Read more comments on GitHub >

github_iconTop Results From Across the Web

What is a progress report and how can you effectively manage ...
A progress report allows you to get important information on project completion. ScrumGenius is a simple, yet powerful, tool that can improve your...
Read more >
Progress Report: What is it & How to Write it? (Steps & Format)
A well-defined progress report is like the pulse of a project! It determines your relationship with your readers, highlights all the updates- big...
Read more >
7.3 Progress Reports – Technical Writing Essentials
The main function of a progress report is persuasive: to reassure clients and supervisors that you are making progress, that the project is...
Read more >
Progress report: What it is and how to write progress report
A progress report is a part of project documentation that confirms how far the team has progressed toward its goal. In other words,...
Read more >
How to Write a Progress Report: A Step-by-Step Guide - Slite
A progress report is a formal, documented, and structured way of keeping people in the know. There are many types of progress reports...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found